diff --git a/lib/c_tokenizer.cpp b/lib/c_tokenizer.cpp index 38cdc484f..9e696406d 100644 --- a/lib/c_tokenizer.cpp +++ b/lib/c_tokenizer.cpp @@ -8,8 +8,8 @@ extern __thread int mysql_thread___query_digests_max_query_length; extern __thread bool mysql_thread___query_digests_lowercase; extern __thread bool mysql_thread___query_digests_replace_null; extern __thread bool mysql_thread___query_digests_no_digits; -extern __thread bool mysql_thread___query_digests_grouping_limit; -extern __thread bool mysql_thread___query_digests_groups_grouping_limit; +extern __thread int mysql_thread___query_digests_grouping_limit; +extern __thread int mysql_thread___query_digests_groups_grouping_limit; extern __thread bool mysql_thread___query_digests_keep_comment; void tokenizer(tokenizer_t *result, const char* s, const char* delimiters, int empties ) diff --git a/lib/pgsql_tokenizer.cpp b/lib/pgsql_tokenizer.cpp index 607eeeeda..13cb201e2 100644 --- a/lib/pgsql_tokenizer.cpp +++ b/lib/pgsql_tokenizer.cpp @@ -9,8 +9,8 @@ extern __thread int pgsql_thread___query_digests_max_query_length; extern __thread bool pgsql_thread___query_digests_lowercase; extern __thread bool pgsql_thread___query_digests_replace_null; extern __thread bool pgsql_thread___query_digests_no_digits; -extern __thread bool pgsql_thread___query_digests_grouping_limit; -extern __thread bool pgsql_thread___query_digests_groups_grouping_limit; +extern __thread int pgsql_thread___query_digests_grouping_limit; +extern __thread int pgsql_thread___query_digests_groups_grouping_limit; extern __thread bool pgsql_thread___query_digests_keep_comment; #define SIZECHAR sizeof(char) diff --git a/test/tap/tests/tokenizer_payloads/regular_tokenizer_digests.hjson b/test/tap/tests/tokenizer_payloads/regular_tokenizer_digests.hjson index 2843350d3..a71d0edff 100644 --- a/test/tap/tests/tokenizer_payloads/regular_tokenizer_digests.hjson +++ b/test/tap/tests/tokenizer_payloads/regular_tokenizer_digests.hjson @@ -1053,7 +1053,39 @@ "grouping_limit": 3, "groups_grouping_limit": 7, "digest": "INSERT INTO db.table (col1,col2,col3) VALUES (?,?,?,...),(?,?,?,...),(?,?,?,...),(?,?,?,...),(?,?,?,...),(?,?,?,...),(?,?,?,...),... ON DUPLICATE KEY UPDATE col1 = VALUES(col2)" - } - ] - } -] + } + ] + }, + { + "q": ["SELECT * FROM t WHERE id IN (1,2,3,4,5)"], + "mz": [ + { + "grouping_limit": 1, + "digest": "SELECT * FROM t WHERE id IN (?,...)" + }, + { + "grouping_limit": 2, + "digest": "SELECT * FROM t WHERE id IN (?,?,...)" + }, + { + "grouping_limit": 3, + "digest": "SELECT * FROM t WHERE id IN (?,?,?,...)" + } + ] + }, + { + "q": ["INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9)"], + "mz": [ + { + "grouping_limit": 1, + "groups_grouping_limit": 1, + "digest": "INSERT INTO t VALUES (?,...),..." + }, + { + "grouping_limit": 1, + "groups_grouping_limit": 2, + "digest": "INSERT INTO t VALUES (?,...),(?,...),..." + } + ] + } + ]