summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-03-16 13:38:35 +0100
committerSergei Golubchik <sergii@pisem.net>2010-03-16 13:38:35 +0100
commita117dfb087459000b4ebc13cd3a83842dc4b8897 (patch)
tree7504806512538a57804f1cd65fc19acba4bbf414 /sql
parent5f47217e2e271295e35510493fbfd8c147452130 (diff)
downloadmariadb-git-a117dfb087459000b4ebc13cd3a83842dc4b8897.tar.gz
fixes for the status_user.test in ps protocol
sql/sql_class.cc: reset userstat_running after the data were colleced to prevent double accounting. don't assert for COM_QUERY, many more are possible. don't update_stats() here, it's too late, lex->sql_command may be already reset sql/sql_parse.cc: update_stats() here, when the current arena is still valid
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_class.cc6
-rw-r--r--sql/sql_parse.cc1
2 files changed, 2 insertions, 5 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 6f71bdd4e1a..cd5840ac32e 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -921,9 +921,6 @@ void THD::update_stats(void)
/* sql_command == SQLCOM_END in case of parse errors or quit */
if (lex->sql_command != SQLCOM_END)
{
- /* The replication thread has the COM_CONNECT command */
- DBUG_ASSERT(command == COM_QUERY || command == COM_CONNECT);
-
/* A SQL query. */
if (lex->sql_command == SQLCOM_SELECT)
select_commands++;
@@ -959,9 +956,8 @@ void THD::update_all_stats()
status_var_add(status_var.cpu_time, cpu_time);
status_var_add(status_var.busy_time, busy_time);
- /* Updates THD stats and the global user stats. */
- update_stats();
update_global_user_stats(this, TRUE, save_time);
+ userstat_running= 0;
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 822e4a73b7a..3890e74304f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5040,6 +5040,7 @@ create_sp_error:
break;
}
thd_proc_info(thd, "query end");
+ thd->update_stats();
/*
Binlog-related cleanup: