@@ -232,6 +232,7 @@ void process_mz_test_def(const nlohmann::json& test_def, const char* c_query, co
232
232
bool no_digest = true ;
233
233
int lowercase = 0 ;
234
234
bool keep_comment = false ;
235
+ bool replace_null = true ;
235
236
236
237
if (mz_test_def.contains (" digest_max_size" )) {
237
238
digest_max_size = mz_test_def.at (" digest_max_size" );
@@ -255,6 +256,9 @@ void process_mz_test_def(const nlohmann::json& test_def, const char* c_query, co
255
256
if (mz_test_def.contains (" keep_comment" )) {
256
257
keep_comment = mz_test_def.at (" keep_comment" );
257
258
}
259
+ if (mz_test_def.contains (" replace_null" )) {
260
+ replace_null = mz_test_def.at (" replace_null" );
261
+ }
258
262
259
263
int backup_digest_max_length = mysql_thread___query_digests_max_query_length;
260
264
mysql_thread___query_digests_max_query_length = digest_max_size;
@@ -266,6 +270,8 @@ void process_mz_test_def(const nlohmann::json& test_def, const char* c_query, co
266
270
mysql_thread___query_digests_no_digits = replace_digits;
267
271
int lowercase_backup = mysql_thread___query_digests_lowercase;
268
272
mysql_thread___query_digests_lowercase = lowercase_backup;
273
+ int replace_null_backup = mysql_thread___query_digests_replace_null;
274
+ mysql_thread___query_digests_replace_null = replace_null;
269
275
int keep_comment_backup = mysql_thread___query_digests_keep_comment;
270
276
mysql_thread___query_digests_keep_comment = keep_comment;
271
277
@@ -287,6 +293,7 @@ void process_mz_test_def(const nlohmann::json& test_def, const char* c_query, co
287
293
mysql_thread___query_digests_no_digits = no_digits_backup;
288
294
mysql_thread___query_digests_lowercase = lowercase_backup;
289
295
mysql_thread___query_digests_keep_comment = keep_comment_backup;
296
+ mysql_thread___query_digests_replace_null = replace_null_backup;
290
297
291
298
if (query.size () >= QUERY_DIGEST_BUF) {
292
299
free (c_res);
@@ -772,9 +779,10 @@ int main(int argc, char** argv) {
772
779
bool exec_grouping_tests = true ;
773
780
bool exec_regular_tests = true ;
774
781
std::string tests_filter_str {};
782
+ std::string digests_file_arg {};
775
783
776
784
// check parameters for test filtering
777
- if (argc = = 2 ) {
785
+ if (argc > = 2 ) {
778
786
tests_filter_str = argv[1 ];
779
787
780
788
if (tests_filter_str.find (" crashing" ) == std::string::npos) {
@@ -786,9 +794,15 @@ int main(int argc, char** argv) {
786
794
if (tests_filter_str.find (" regular" ) == std::string::npos) {
787
795
exec_regular_tests = false ;
788
796
}
797
+
798
+ if (argc == 3 ) {
799
+ digests_file_arg = argv[2 ];
800
+ }
789
801
}
790
802
791
- const string digests_filepath { string (cl.workdir ) + DIGESTS_TEST_FILENAME };
803
+ const string digests_filepath {
804
+ digests_file_arg.empty () ? string (cl.workdir ) + DIGESTS_TEST_FILENAME : digests_file_arg
805
+ };
792
806
const string crashing_payloads { string (cl.workdir ) + " tokenizer_payloads/crashing_payloads.hjson" };
793
807
794
808
uint32_t max_groups = 10 ;
0 commit comments