rezataroosheh commented on code in PR #13745:
URL: https://github.com/apache/ignite/pull/13745#discussion_r4493999623
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlDiagnosticIntegrationTest.java:
##########
@@ -1040,6 +1040,39 @@ public void testSqlFieldsQueryWithInitiatorId() throws
Exception {
assertTrue(logLsnr.check(1000));
}
+ /** Checks that query parameters are printed in the long query warning
only when sensitive data is allowed. */
+ @Test
+ public void testLongQueryParametersInLog() throws Exception {
+ IgniteCache<Long, Long> cache = prepareTestCache(grid(0));
+
+ long arg = LONG_QRY_TIMEOUT + LONG_QRY_TIMEOUT / 2;
+
+ boolean includeSensitive = QueryUtils.INCLUDE_SENSITIVE;
+
+ try {
+ for (boolean incl : new boolean[] {true, false}) {
+ QueryUtils.INCLUDE_SENSITIVE = incl;
+
+ LogListener paramsLsnr =
LogListener.matches(LONG_QUERY_FINISHED_MSG)
+ .andMatches("params=[" + arg + "]").build();
+
+ LogListener finishedLsnr =
LogListener.matches(LONG_QUERY_FINISHED_MSG).build();
+
+ log.registerListener(paramsLsnr);
+ log.registerListener(finishedLsnr);
+
+ cache.query(new SqlFieldsQuery("SELECT sleep(?)").setArgs(arg))
Review Comment:
Done in 6d5a333360, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]