mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
Merge branch '11.4' into 11.8
This commit is contained in:
@@ -1604,6 +1604,7 @@ dispatch_command_return dispatch_command(enum enum_server_command command, THD *
|
||||
NET *net= &thd->net;
|
||||
bool error= 0;
|
||||
bool do_end_of_statement= true;
|
||||
bool log_slow_done= false;
|
||||
DBUG_ENTER("dispatch_command");
|
||||
DBUG_PRINT("info", ("command: %d %s", command,
|
||||
(command_name[command].str != 0 ?
|
||||
@@ -1830,6 +1831,7 @@ dispatch_command_return dispatch_command(enum enum_server_command command, THD *
|
||||
case COM_STMT_BULK_EXECUTE:
|
||||
{
|
||||
mysqld_stmt_bulk_execute(thd, packet, packet_length);
|
||||
log_slow_done= true;
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd))
|
||||
{
|
||||
@@ -1841,6 +1843,7 @@ dispatch_command_return dispatch_command(enum enum_server_command command, THD *
|
||||
case COM_STMT_EXECUTE:
|
||||
{
|
||||
mysqld_stmt_execute(thd, packet, packet_length);
|
||||
log_slow_done= true;
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd))
|
||||
{
|
||||
@@ -2017,6 +2020,7 @@ dispatch_command_return dispatch_command(enum enum_server_command command, THD *
|
||||
mysql_parse(thd, beginning_of_next_stmt, length, &parser_state);
|
||||
|
||||
}
|
||||
log_slow_done= thd->lex->sql_command == SQLCOM_EXECUTE;
|
||||
|
||||
DBUG_PRINT("info",("query ready"));
|
||||
break;
|
||||
@@ -2473,22 +2477,19 @@ resume:
|
||||
if (likely(!thd->is_error() && !thd->killed_errno()))
|
||||
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_RESULT, 0, 0);
|
||||
|
||||
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_STATUS,
|
||||
thd->get_stmt_da()->is_error() ?
|
||||
thd->get_stmt_da()->sql_errno() : 0,
|
||||
command_name[command].str);
|
||||
if (!log_slow_done)
|
||||
mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_STATUS,
|
||||
thd->get_stmt_da()->is_error() ?
|
||||
thd->get_stmt_da()->sql_errno() : 0,
|
||||
command_name[command].str);
|
||||
|
||||
thd->update_all_stats();
|
||||
|
||||
/*
|
||||
Write to slow query log only those statements that received via the text
|
||||
protocol except the EXECUTE statement. The reason we do that way is
|
||||
that for statements received via binary protocol and for the EXECUTE
|
||||
statement, the slow statements have been already written to slow query log
|
||||
inside the method Prepared_statement::execute().
|
||||
for backward compatibility we only log COM_QUERY here,
|
||||
as if COM_STMT_PREPARE or COM_FIELD_LIST couldn't be slow.
|
||||
*/
|
||||
if(command == COM_QUERY &&
|
||||
thd->lex->sql_command != SQLCOM_EXECUTE)
|
||||
if (command == COM_QUERY && !log_slow_done)
|
||||
log_slow_statement(thd);
|
||||
else
|
||||
delete_explain_query(thd->lex);
|
||||
|
||||
Reference in New Issue
Block a user