diff options
author | kent@mysql.com <> | 2004-10-22 08:54:14 +0200 |
---|---|---|
committer | kent@mysql.com <> | 2004-10-22 08:54:14 +0200 |
commit | bd3d0f6ceab5556cc1ce5d01538d040758766dbe (patch) | |
tree | 4dfdf68fff2d99fbd3b59b3362ab6e76e2801912 /sql/sql_parse.cc | |
parent | 04b8a57b0179b2f38677b369cf51e0c17743fd5f (diff) | |
download | mariadb-git-bd3d0f6ceab5556cc1ce5d01538d040758766dbe.tar.gz |
sql_parse.cc:
Bug#6167 One element missing in 'uc_update_queries[]'
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index daa0bc1e063..8279e32c8de 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -501,12 +501,17 @@ void free_max_user_conn(void) /* Mark all commands that somehow changes a table This is used to check number of updates / hour + + sql_command is actually set to SQLCOM_END sometimes + so we need the +1 to include it in the array. */ -char uc_update_queries[SQLCOM_END]; +char uc_update_queries[SQLCOM_END+1]; void init_update_queries(void) { + bzero((gptr) &uc_update_queries, sizeof(uc_update_queries)); + uc_update_queries[SQLCOM_CREATE_TABLE]=1; uc_update_queries[SQLCOM_CREATE_INDEX]=1; uc_update_queries[SQLCOM_ALTER_TABLE]=1; @@ -531,6 +536,7 @@ void init_update_queries(void) bool is_update_query(enum enum_sql_command command) { + DBUG_ASSERT(command >= 0 && command <= SQLCOM_END); return uc_update_queries[command]; } |