diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-11-12 15:56:21 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-11-12 15:56:21 +0300 |
commit | 78fa2e4d6d89b8d0bb4b26fe648668b97c9400b9 (patch) | |
tree | 47b1a5ab7416e5cc83776aa9a0543a058f35d724 /sql/sql_error.h | |
parent | f11b9a88eb3e18a1da2530257a66e224473bef3c (diff) | |
download | mariadb-git-78fa2e4d6d89b8d0bb4b26fe648668b97c9400b9.tar.gz |
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.
Diffstat (limited to 'sql/sql_error.h')
-rw-r--r-- | sql/sql_error.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sql/sql_error.h b/sql/sql_error.h index 87e98e27673..14dc5e6d12c 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -79,12 +79,6 @@ public: const char* get_sqlstate() const { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; } - uint server_status() const - { - DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF); - return m_server_status; - } - ulonglong affected_rows() const { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; } @@ -111,15 +105,6 @@ private: char m_sqlstate[SQLSTATE_LENGTH+1]; /** - Copied from thd->server_status when the diagnostics area is assigned. - We need this member as some places in the code use the following pattern: - thd->server_status|= ... - my_eof(thd); - thd->server_status&= ~... - Assigned by OK, EOF or ERROR. - */ - uint m_server_status; - /** The number of rows affected by the last statement. This is semantically close to thd->row_count_func, but has a different life cycle. thd->row_count_func stores the value returned by |