mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Implement a fix for Bug#57058 -- send SERVER_QUERY_WAS_SLOW over
network when a query was slow. When a query is slow, sent a special flag to the client indicating this fact. Add a test case. Implement review comments. include/mysql_com.h: Clear SERVER_QUERY_WAS_SLOW at end of each statement. Since this patch removes the technique when thd->server_status is modified briefly only to execute my_eof(), reset more server status bit that may remain in the status from execution of the previous statement. sql/protocol.cc: Always use thd->server_status to in net_* functions to send the latest status to the client. sql/sp_head.cc: Calculate if a query was slow before sending EOF packet. sql/sql_cursor.cc: Remove juggling with thd->server_status. The extra status bits are reset at start of the next statement. sql/sql_db.cc: Remove juggling with thd->server_status. The extra status bits are reset at start of the next statement. sql/sql_error.cc: Remove m_server_status member, it's not really part of the Diagnostics_area. sql/sql_error.h: Remove server_status member, it's not part of the Diagnostics_area. The associated hack is removed as well. sql/sql_parse.cc: Do not calculate if a query was slow twice. Use a status flag in thd->server_status. tests/mysql_client_test.c: Add a test case for Bug#57058. Check that the status is present at the client, when sent.
This commit is contained in:
@@ -277,7 +277,6 @@ int Materialized_cursor::open(JOIN *join __attribute__((unused)))
|
||||
rc= result->send_result_set_metadata(item_list, Protocol::SEND_NUM_ROWS);
|
||||
thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
|
||||
result->send_eof();
|
||||
thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -318,12 +317,10 @@ void Materialized_cursor::fetch(ulong num_rows)
|
||||
case 0:
|
||||
thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
|
||||
result->send_eof();
|
||||
thd->server_status&= ~SERVER_STATUS_CURSOR_EXISTS;
|
||||
break;
|
||||
case HA_ERR_END_OF_FILE:
|
||||
thd->server_status|= SERVER_STATUS_LAST_ROW_SENT;
|
||||
result->send_eof();
|
||||
thd->server_status&= ~SERVER_STATUS_LAST_ROW_SENT;
|
||||
close();
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user