From d6fba5d1a731c0adab64e69e2ba9844ee853543b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2007 22:34:33 +0300 Subject: Fixes for tests after merge from 5.0 mysql-test/r/grant.result: Fixed a result. Editor added wrong characters. mysql-test/r/mysqlbinlog2.result: Fixed mysql-test/r/sp.result: Fixed a result, moved lines around. mysql-test/r/sp_trans.result: Fixed a result, moved lines around. mysql-test/t/mysqlbinlog2.test: Merged tests from 5.0 mysql-test/t/sp_trans.test: Merged test from 5.0 and fixed to be compatible with 5.1 sql/sql_class.cc: Merged from 5.0 sql/sql_error.cc: Fixed push_warning() --- sql/sql_error.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sql/sql_error.cc') diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 70882d8f4e8..f551a7ef4b2 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -147,15 +147,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, if (thd->warn_list.elements < thd->variables.max_error_count) { - /* - The following code is here to change the allocation to not - use the thd->mem_root, which is freed after each query - */ - MEM_ROOT *old_root= thd->mem_root; - thd->mem_root= &thd->warn_root; - if ((err= new MYSQL_ERROR(thd, code, level, msg))) + /* We have to use warn_root, as mem_root is freed after each query */ + if ((err= new (&thd->warn_root) MYSQL_ERROR(thd, code, level, msg))) thd->warn_list.push_back(err); - thd->mem_root= old_root; } thd->warn_count[(uint) level]++; thd->total_warn_count++; -- cgit v1.2.1