Commit e24caa75 authored by Sergei Golubchik's avatar Sergei Golubchik

small cleanup

* keep all com_xxx constants together in struct system_status_var
* fix an outdated comment in sql_cmd.h
* fix an off-by-one bug in mysqld.cc
parent c47acc21
......@@ -3919,7 +3919,7 @@ void init_sql_statement_info()
while (var->name != NULL)
{
ptr= (size_t)(var->value);
if ((first_com <= ptr) && (ptr <= last_com))
if ((first_com <= ptr) && (ptr < last_com))
{
com_index= ((int)(ptr - first_com))/record_size;
DBUG_ASSERT(com_index < (uint) SQLCOM_END);
......
......@@ -674,8 +674,17 @@ typedef struct system_variables
typedef struct system_status_var
{
ulong com_other;
ulong com_stat[(uint) SQLCOM_END];
ulong com_other;
ulong com_stmt_prepare;
ulong com_stmt_reprepare;
ulong com_stmt_execute;
ulong com_stmt_send_long_data;
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
ulong created_tmp_disk_tables_;
ulong created_tmp_tables_;
ulong ha_commit_count;
......@@ -728,14 +737,6 @@ typedef struct system_status_var
ulong filesort_rows_;
ulong filesort_scan_count_;
ulong filesort_pq_sorts_;
/* Prepared statements and binary protocol */
ulong com_stmt_prepare;
ulong com_stmt_reprepare;
ulong com_stmt_execute;
ulong com_stmt_send_long_data;
ulong com_stmt_fetch;
ulong com_stmt_reset;
ulong com_stmt_close;
/* Features used */
ulong feature_dynamic_columns; /* +1 when creating a dynamic column */
......
......@@ -96,7 +96,7 @@ enum enum_sql_command {
/*
When a command is added here, be sure it's also added in mysqld.cc
in "struct show_var_st status_vars[]= {" ...
in "struct show_var_st com_status_vars[]= {" ...
*/
/* This should be the last !!! */
SQLCOM_END
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment