Skip to content

Commit 0a481dd

Browse files
committed
fix: don't log query 'select $$'
Looks like it is kind of erroneous query sent by some versions of mysql cli. ref: #2772
1 parent 2e07579 commit 0a481dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/daemon/query_log.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,11 @@ void LogSphinxqlError ( const char * sStmt, const Str_t & sError )
702702
if ( g_eLogFormat != LOG_FORMAT::SPHINXQL || g_iQueryLogFile < 0 || !sStmt || IsEmpty ( sError ) )
703703
return;
704704

705+
// some mysql cli, like mysql 9.0.1, 9.1.0, 9.3.0, may be others, fire 'select $$' query after connect
706+
// that produces some noise in query log, so let's just filter out these queries. #2772
707+
if ( !strcmp (sStmt, "select $$") )
708+
return;
709+
705710
StringBuilder_c tBuf;
706711
tBuf << "/* ";
707712
FormatTimeConnClient ( tBuf );

0 commit comments

Comments
 (0)