MCPcopy Create free account
hub / github.com/ByConity/ByConity / prepareQueryForLogging

Function prepareQueryForLogging

src/Interpreters/executeQuery.cpp:398–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397
398static String prepareQueryForLogging(const String & query, ContextPtr context)
399{
400 String res = query;
401
402 // wiping sensitive data before cropping query by log_queries_cut_to_length,
403 // otherwise something like credit card without last digit can go to log
404 if (auto * masker = SensitiveDataMasker::getInstance())
405 {
406 auto matches = masker->wipeSensitiveData(res);
407 if (matches > 0)
408 {
409 ProfileEvents::increment(ProfileEvents::QueryMaskingRulesMatch, matches);
410 }
411 }
412
413 res = res.substr(0, context->getSettingsRef().log_queries_cut_to_length);
414
415 return res;
416}
417
418
419/// Log query into text log (not into system table).

Callers 1

executeQueryImplFunction · 0.85

Calls 2

wipeSensitiveDataMethod · 0.80
incrementFunction · 0.50

Tested by

no test coverage detected