1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines

When running Stored Routines the Status Variable "Questions" was wrongly
incremented. According to the manual it should contain the "number of
statements that clients have sent to the server"
              
Introduced a new status variable 'questions' to replace the query_id
variable which currently corresponds badly with the number of statements
sent by the client.
            
The new behavior is ment to be backward compatible with 4.0 and at the
same time work with new features in a similar way.
            
This is a backport from 6.0

mysql-test/r/status2.result:
  Added test case
mysql-test/t/status2.test:
  Added test case
sql/mysqld.cc:
  Introduced a new status variable 'questions' to replace the query_id
  variable which currently corresponds badly with the number of statements
  sent by the client.
sql/sql_class.h:
  Introduced a new status variable 'questions' to replace the query_id
  variable which currently corresponds badly with the number of statements
  sent by the client.
sql/sql_parse.cc:
  To be backward compatible with 4.0 and at the same time extend the 
  interpretation of the Question variable, it should be increased on
  all COM-commands but COM_STATISTICS, COM_PING, COM_STMT_PREPARE,
  COM_STMT_CLOSE and COM_STMT_RESET.
  Since COM_QUERY can process multiple statements, there has to be an
  extra increase there as well.
sql/sql_show.cc:
  Removed deprecated SHOW_QUESTION status code.
sql/structs.h:
  Removed deprecated SHOW_QUESTION status code.
This commit is contained in:
Kristofer Pettersson
2008-10-09 09:26:42 +02:00
parent eb3c08069d
commit f985e78775
7 changed files with 164 additions and 9 deletions

View File

@@ -664,10 +664,17 @@ typedef struct system_status_var
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
/*
Number of statements sent from the client
*/
ulong questions;
/*
Status variables which it does not make sense to add to
global status variable counter
IMPORTANT!
SEE last_system_status_var DEFINITION BELOW.
Below 'last_system_status_var' are all variables which doesn't make any
sense to add to the /global/ status variable counter.
*/
double last_query_cost;
} STATUS_VAR;
@@ -678,7 +685,7 @@ typedef struct system_status_var
counter
*/
#define last_system_status_var com_stmt_close
#define last_system_status_var questions
void free_tmp_table(THD *thd, TABLE *entry);