diff options
author | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-08-21 16:34:31 +0300 |
---|---|---|
committer | Seppo Jaakola <seppo.jaakola@codership.com> | 2013-08-21 16:34:31 +0300 |
commit | 4222b2520bdea2be41b50b888f930a63f5af8991 (patch) | |
tree | 02fcc81139a9a099f0d07c25d03e8b3f40f4c6b6 /sql/sql_class.h | |
parent | 551ad1cf6f80ad1fab35746eee304d733baa9adf (diff) | |
parent | c7973615e723b13c6457b494b72be2fac35bfd18 (diff) | |
download | mariadb-git-4222b2520bdea2be41b50b888f930a63f5af8991.tar.gz |
Merge with mariadb 5.5: bzr merge lp:maria/5.5 --rtag:mariadb-5.5.32
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index d2ed282bf45..f6391f82b02 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef SQL_CLASS_INCLUDED @@ -1622,6 +1622,7 @@ public: Protects THD data accessed from other threads: - thd->query and thd->query_length (used by SHOW ENGINE INNODB STATUS and SHOW PROCESSLIST + - thd->db and thd->db_length (used in SHOW PROCESSLIST) - thd->mysys_var (used by KILL statement and shutdown). Is locked when THD is deleted. */ @@ -2898,6 +2899,7 @@ public: */ bool set_db(const char *new_db, size_t new_db_len) { + 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) memcpy(db, new_db, new_db_len+1); @@ -2910,6 +2912,7 @@ public: db= NULL; } db_length= db ? new_db_len : 0; + mysql_mutex_unlock(&LOCK_thd_data); return new_db && !db; } @@ -2926,8 +2929,13 @@ public: */ void reset_db(char *new_db, size_t new_db_len) { - db= new_db; - db_length= new_db_len; + if (new_db != db || new_db_len != db_length) + { + mysql_mutex_lock(&LOCK_thd_data); + db= new_db; + db_length= new_db_len; + mysql_mutex_unlock(&LOCK_thd_data); + } } /* Copy the current database to the argument. Use the current arena to @@ -4207,6 +4215,11 @@ inline bool add_order_to_list(THD *thd, Item *item, bool asc) return thd->lex->current_select->add_order_to_list(thd, item, asc); } +inline bool add_gorder_to_list(THD *thd, Item *item, bool asc) +{ + return thd->lex->current_select->add_gorder_to_list(thd, item, asc); +} + inline bool add_group_to_list(THD *thd, Item *item, bool asc) { return thd->lex->current_select->add_group_to_list(thd, item, asc); |