~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_error.cc

  • Committer: Olaf van der Spek
  • Date: 2011-03-22 09:36:03 UTC
  • mto: (2245.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2246.
  • Revision ID: olafvdspek@gmail.com-20110322093603-hs0dmf20kbd8ckmb
Move warn_list from Session to diagnostics_area

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include <drizzled/plugin/client.h>
54
54
#include <drizzled/sql_lex.h>
55
55
#include <drizzled/system_variables.h>
 
56
#include <drizzled/diagnostics_area.h>
56
57
 
57
58
using namespace std;
58
59
 
92
93
    memset(session->warn_count, 0, sizeof(session->warn_count));
93
94
    if (force)
94
95
      session->total_warn_count= 0;
95
 
    session->warn_list.clear();
 
96
    session->main_da().m_warn_list.clear();
96
97
    session->row_count= 1; // by default point to row 1
97
98
  }
98
99
}
145
146
    return NULL;
146
147
 
147
148
  DRIZZLE_ERROR *err= NULL;
148
 
  if (session->warn_list.size() < session->variables.max_error_count)
 
149
  if (session->main_da().m_warn_list.size() < session->variables.max_error_count)
149
150
  {
150
151
    /* We have to use warn_root, as mem_root is freed after each query */
151
152
    err= new (&session->warn_root) DRIZZLE_ERROR(session, code, level, msg);
152
 
    session->warn_list.push_back(err, &session->warn_root);
 
153
    session->main_da().m_warn_list.push_back(err, &session->warn_root);
153
154
  }
154
155
  session->warn_count[(uint32_t) level]++;
155
156
  session->total_warn_count++;
223
224
 
224
225
  unit->set_limit(sel);
225
226
 
226
 
  List<DRIZZLE_ERROR>::iterator it(session->warn_list.begin());
 
227
  List<DRIZZLE_ERROR>::iterator it(session->main_da().m_warn_list.begin());
227
228
  while (DRIZZLE_ERROR* err= it++)
228
229
  {
229
230
    /* Skip levels that the user is not interested in */