~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_error.cc

  • Committer: Brian Aker
  • Date: 2009-11-18 22:58:22 UTC
  • mto: (1223.1.1 push) (1226.1.2 push)
  • mto: This revision was merged to the branch mainline in revision 1224.
  • Revision ID: brian@gaz-20091118225822-4ryr9rviir23o0kr
Second pass through bugs related to CREATE TABLE LIKE

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA */
15
15
 
16
16
/**********************************************************************
17
17
This file contains the implementation of error and warnings related
41
41
 
42
42
***********************************************************************/
43
43
 
44
 
#include "config.h"
45
 
 
46
 
#include <cstdio>
47
 
#include <stdarg.h>
48
 
 
 
44
#include <drizzled/server_includes.h>
49
45
#include <drizzled/session.h>
50
46
#include <drizzled/sql_base.h>
51
47
#include <drizzled/item/empty_string.h>
53
49
#include <drizzled/plugin/client.h>
54
50
 
55
51
using namespace std;
56
 
 
57
 
namespace drizzled
58
 
{
 
52
using namespace drizzled;
59
53
 
60
54
/*
61
55
  Store a new message in an error object
65
59
*/
66
60
void DRIZZLE_ERROR::set_msg(Session *session, const char *msg_arg)
67
61
{
68
 
  msg= session->warn_root.strdup_root(msg_arg);
 
62
  msg= strdup_root(&session->warn_root, msg_arg);
69
63
}
70
64
 
71
65
/*
84
78
 
85
79
void drizzle_reset_errors(Session *session, bool force)
86
80
{
87
 
  if (session->getQueryId() != session->getWarningQueryId() || force)
 
81
  if (session->query_id != session->warn_id || force)
88
82
  {
89
 
    session->setWarningQueryId(session->getQueryId());
90
 
    session->warn_root.free_root(MYF(0));
 
83
    session->warn_id= session->query_id;
 
84
    free_root(&session->warn_root,MYF(0));
91
85
    memset(session->warn_count, 0, sizeof(session->warn_count));
92
86
    if (force)
93
87
      session->total_warn_count= 0;
121
115
      !(session->options & OPTION_SQL_NOTES))
122
116
    return(0);
123
117
 
124
 
  if (session->getQueryId() != session->getWarningQueryId())
 
118
  if (session->query_id != session->warn_id)
125
119
    drizzle_reset_errors(session, 0);
126
120
  session->got_warning= 1;
127
121
 
134
128
 
135
129
    session->no_warnings_for_error= 1;
136
130
 
137
 
    session->setKilled(Session::KILL_BAD_DATA);
 
131
    session->killed= Session::KILL_BAD_DATA;
138
132
    my_message(code, msg, MYF(0));
139
133
 
140
134
    session->no_warnings_for_error= no_warnings_for_error;
244
238
  session->my_eof();
245
239
  return(false);
246
240
}
247
 
 
248
 
} /* namespace drizzled */