1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

5.5-merge

This commit is contained in:
Sergei Golubchik
2011-07-02 22:08:51 +02:00
3220 changed files with 94894 additions and 422456 deletions

View File

@ -1,5 +1,4 @@
/* Copyright (C) 2000-2003 MySQL AB,
Copyright (C) 2008-2009 Sun Microsystems, Inc
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -12,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef SQL_ERROR_H
#define SQL_ERROR_H
@ -79,12 +78,6 @@ public:
const char* get_sqlstate() const
{ DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; }
uint server_status() const
{
DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF);
return m_server_status;
}
ulonglong affected_rows() const
{ DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; }
@ -117,15 +110,6 @@ private:
char m_sqlstate[SQLSTATE_LENGTH+1];
/**
Copied from thd->server_status when the diagnostics area is assigned.
We need this member as some places in the code use the following pattern:
thd->server_status|= ...
my_eof(thd);
thd->server_status&= ~...
Assigned by OK, EOF or ERROR.
*/
uint m_server_status;
/**
The number of rows affected by the last statement. This is
semantically close to thd->row_count_func, but has a different
@ -345,10 +329,13 @@ class Warning_info
{
/** A memory root to allocate warnings and errors */
MEM_ROOT m_warn_root;
/** List of warnings of all severities (levels). */
List <MYSQL_ERROR> m_warn_list;
/** A break down of the number of warnings per severity (level). */
uint m_warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
/**
The number of warnings of the current statement. Warning_info
life cycle differs from statement life cycle -- it may span
@ -356,20 +343,25 @@ class Warning_info
m_statement_warn_count 0, whereas m_warn_list is not empty.
*/
uint m_statement_warn_count;
/*
Row counter, to print in errors and warnings. Not increased in
create_sort_index(); may differ from examined_row_count.
*/
ulong m_current_row_for_warning;
/** Used to optionally clear warnings only once per statement. */
/** Used to optionally clear warnings only once per statement. */
ulonglong m_warn_id;
/** Indicates if push_warning() allows unlimited number of warnings. */
bool m_allow_unlimited_warnings;
private:
Warning_info(const Warning_info &rhs); /* Not implemented */
Warning_info& operator=(const Warning_info &rhs); /* Not implemented */
public:
Warning_info(ulonglong warn_id_arg);
Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings);
~Warning_info();
/**
@ -406,19 +398,13 @@ public:
void append_warnings(THD *thd, List<MYSQL_ERROR> *src)
{
MYSQL_ERROR *err;
MYSQL_ERROR *copy;
List_iterator_fast<MYSQL_ERROR> it(*src);
/*
Don't use ::push_warning() to avoid invocation of condition
handlers or escalation of warnings to errors.
*/
while ((err= it++))
{
copy= Warning_info::push_warning(thd, err->get_sql_errno(), err->get_sqlstate(),
err->get_level(), err->get_message_text());
if (copy)
copy->copy_opt_attributes(err);
}
Warning_info::push_warning(thd, err);
}
/**
@ -484,6 +470,9 @@ public:
MYSQL_ERROR::enum_warning_level level,
const char* msg);
/** Add a new condition to the current list. */
MYSQL_ERROR *push_warning(THD *thd, const MYSQL_ERROR *sql_condition);
/**
Set the read only status for this statement area.
This is a privileged operation, reserved for the implementation of