summaryrefslogtreecommitdiff
path: root/sql/sql_error.cc
diff options
context:
space:
mode:
authorjani@ua141d10.elisa.omakaista.fi <>2007-04-05 22:34:33 +0300
committerjani@ua141d10.elisa.omakaista.fi <>2007-04-05 22:34:33 +0300
commit386ad0f1f73d07b62b0084ecc91b57937781e5ce (patch)
tree12f68ee51e11c2152bfc43d6c7613a7d392f82bc /sql/sql_error.cc
parente40d3631a3e22e73a7c96a1e51f9606c0747c00b (diff)
downloadmariadb-git-386ad0f1f73d07b62b0084ecc91b57937781e5ce.tar.gz
Fixes for tests after merge from 5.0
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r--sql/sql_error.cc10
1 files changed, 2 insertions, 8 deletions
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++;