~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-06-29 12:57:43 UTC
  • mto: This revision was merged to the branch mainline in revision 2362.
  • Revision ID: olafvdspek@gmail.com-20110629125743-tdhc4i70kp4wuuph
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
    in which case push_warnings() has already called this function.
85
85
*/
86
86
 
87
 
void drizzle_reset_errors(Session *session, bool force)
 
87
void drizzle_reset_errors(Session& session, bool force)
88
88
{
89
 
  if (session->getQueryId() != session->getWarningQueryId() || force)
 
89
  if (session.getQueryId() != session.getWarningQueryId() || force)
90
90
  {
91
 
    session->setWarningQueryId(session->getQueryId());
92
 
    session->warn_root.free_root(MYF(0));
93
 
    memset(session->warn_count, 0, sizeof(session->warn_count));
 
91
    session.setWarningQueryId(session.getQueryId());
 
92
    session.warn_root.free_root(MYF(0));
 
93
    memset(session.warn_count, 0, sizeof(session.warn_count));
94
94
    if (force)
95
 
      session->total_warn_count= 0;
96
 
    session->main_da().m_warn_list.clear();
97
 
    session->row_count= 1; // by default point to row 1
 
95
      session.total_warn_count= 0;
 
96
    session.main_da().m_warn_list.clear();
 
97
    session.row_count= 1; // by default point to row 1
98
98
  }
99
99
}
100
100
 
122
122
  }
123
123
 
124
124
  if (session->getQueryId() != session->getWarningQueryId())
125
 
    drizzle_reset_errors(session, 0);
 
125
    drizzle_reset_errors(*session, false);
126
126
  session->got_warning= 1;
127
127
 
128
128
  /* Abort if we are using strict mode and we are not using IGNORE */