diff options
author | monty@mysql.com <> | 2004-05-15 09:08:03 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-05-15 09:08:03 +0300 |
commit | 1e860400f3a260c01a00bada514df7f34ec462c0 (patch) | |
tree | c06f8d43d8562af60ba084e2156426de344720cc /sql/sql_parse.cc | |
parent | 7bcb79e76bad694de07cbc65996325bb3391f679 (diff) | |
download | mariadb-git-1e860400f3a260c01a00bada514df7f34ec462c0.tar.gz |
Extra safety fixes (probably not needed, but can't hurt)
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 77032bef698..7e68db0dcd2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1067,6 +1067,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, packet_length--; } /* We must allocate some extra memory for query cache */ + thd->query_length= 0; // Extra safety: Avoid races if (!(thd->query= (char*) thd->memdup_w_gap((gptr) (packet), packet_length, thd->db_length+2+ @@ -2982,8 +2983,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length) { DBUG_ENTER("mysql_parse"); - mysql_init_query(thd); thd->query_length = length; + mysql_init_query(thd); if (query_cache_send_result_to_client(thd, inBuf, length) <= 0) { LEX *lex=lex_start(thd, (uchar*) inBuf, length); |