~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to sql/sql_error.cc

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
 
148
148
  if (thd->warn_list.elements < thd->variables.max_error_count)
149
149
  {
150
 
    /*
151
 
      The following code is here to change the allocation to not
152
 
      use the thd->mem_root, which is freed after each query
153
 
    */
154
 
    MEM_ROOT *old_root= thd->mem_root;
155
 
    thd->mem_root= &thd->warn_root;
156
 
    if ((err= new MYSQL_ERROR(thd, code, level, msg)))
157
 
      thd->warn_list.push_back(err);
158
 
    thd->mem_root= old_root;
 
150
    /* We have to use warn_root, as mem_root is freed after each query */
 
151
    if ((err= new (&thd->warn_root) MYSQL_ERROR(thd, code, level, msg)))
 
152
      thd->warn_list.push_back(err, &thd->warn_root);
159
153
  }
160
154
  thd->warn_count[(uint) level]++;
161
155
  thd->total_warn_count++;