Index: modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheSqlQueryErrorSelfTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheSqlQueryErrorSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheSqlQueryErrorSelfTest.java --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheSqlQueryErrorSelfTest.java (revision d1b236b1928436bdb1c48a4465eee17fde6b43ce) +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheSqlQueryErrorSelfTest.java (date 1651836601578) @@ -19,8 +19,10 @@ import java.util.concurrent.Callable; import javax.cache.CacheException; +import org.apache.ignite.IgniteSystemProperties; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.junits.WithSystemProperty; import org.junit.Test; /** @@ -194,6 +196,29 @@ "Failed to parse query. Syntax error in SQL statement \"ALTER TABLE TEST DROP COLUMN [*]"); } + /** + * Check sensitive data in wrong syntax DML error message. + * + * @throws Exception If failed. + */ + @Test + @WithSystemProperty(key = IgniteSystemProperties.IGNITE_TO_STRING_INCLUDE_SENSITIVE, value = "false") + public void testDmlWrongSyntaxSensitiveParamFalse() throws Exception { + final String SENSITIVE_DATA = "SENSITIVE_DATA"; + + GridTestUtils.assertThrows(null, new Callable() { + + @Override public Object call() throws Exception { + execute("insert test (id, val) values (3, '" + SENSITIVE_DATA + "')"); + + fail("Exception is expected"); + + return null; + } + }, CacheException.class, SENSITIVE_DATA); + + } + /** * Checks SQL error message. *