diff options
author | Jan Lindström <jplindst@mariadb.org> | 2014-01-25 11:02:49 +0200 |
---|---|---|
committer | Jan Lindström <jplindst@mariadb.org> | 2014-01-25 11:02:49 +0200 |
commit | d43afb8828e358f9c3bb690d0fdcd88b0637f155 (patch) | |
tree | f977f3b5fa3c938183510750aecbea31bccc67ef /sql/sql_class.h | |
parent | d0f77b83611077344ff29db02ea5593c9da62537 (diff) | |
parent | 02765f4c614069ece1f30976848b6299ba6f24bd (diff) | |
download | mariadb-git-d43afb8828e358f9c3bb690d0fdcd88b0637f155.tar.gz |
Merge MariaDB-10.0.7 revision 3961.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index cfce0f81621..6144dd42a0a 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1,5 +1,4 @@ -/* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2009, 2013, Monty Program Ab. This program is free software; you can redistribute it and/or modify @@ -475,6 +474,7 @@ enum killed_type #include "sql_lex.h" /* Must be here */ +extern LEX_STRING sql_statement_names[(uint) SQLCOM_END + 1]; class Delayed_insert; class select_result; class Time_zone; @@ -3353,7 +3353,11 @@ public: */ bool set_db(const char *new_db, size_t new_db_len) { - bool result; + /* + Acquiring mutex LOCK_thd_data as we either free the memory allocated + for the database and reallocating the memory for the new db or memcpy + the new_db to the db. + */ mysql_mutex_lock(&LOCK_thd_data); /* Do not reallocate memory if current chunk is big enough. */ if (db && new_db && db_length >= new_db_len) @@ -3367,7 +3371,7 @@ public: db= NULL; } db_length= db ? new_db_len : 0; - result= new_db && !db; + bool result= new_db && !db; mysql_mutex_unlock(&LOCK_thd_data); #ifdef HAVE_PSI_THREAD_INTERFACE if (result) |