1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +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) 1995-2002 MySQL AB,
Copyright (C) 2008-2009 Sun Microsystems, Inc
/* Copyright (c) 1995, 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
@@ -334,7 +333,6 @@ Diagnostics_area::reset_diagnostics_area()
/** Don't take chances in production */
m_message[0]= '\0';
m_sql_errno= 0;
m_server_status= 0;
m_affected_rows= 0;
m_last_insert_id= 0;
m_statement_warn_count= 0;
@@ -365,7 +363,6 @@ Diagnostics_area::set_ok_status(THD *thd, ulonglong affected_rows_arg,
if (is_error() || is_disabled())
return;
m_server_status= thd->server_status;
m_statement_warn_count= thd->warning_info->statement_warn_count();
m_affected_rows= affected_rows_arg;
m_last_insert_id= last_insert_id_arg;
@@ -395,7 +392,6 @@ Diagnostics_area::set_eof_status(THD *thd)
if (is_error() || is_disabled())
return;
m_server_status= thd->server_status;
/*
If inside a stored procedure, do not return the total
number of warnings, since they are not available to the client
@@ -461,10 +457,11 @@ Diagnostics_area::disable_status()
m_status= DA_DISABLED;
}
Warning_info::Warning_info(ulonglong warn_id_arg)
Warning_info::Warning_info(ulonglong warn_id_arg, bool allow_unlimited_warnings)
:m_statement_warn_count(0),
m_current_row_for_warning(1),
m_warn_id(warn_id_arg),
m_allow_unlimited_warnings(allow_unlimited_warnings),
m_read_only(FALSE)
{
/* Initialize sub structures */
@@ -546,7 +543,8 @@ MYSQL_ERROR *Warning_info::push_warning(THD *thd,
if (! m_read_only)
{
if (m_warn_list.elements < thd->variables.max_error_count)
if (m_allow_unlimited_warnings ||
m_warn_list.elements < thd->variables.max_error_count)
{
cond= new (& m_warn_root) MYSQL_ERROR(& m_warn_root);
if (cond)
@@ -562,6 +560,20 @@ MYSQL_ERROR *Warning_info::push_warning(THD *thd,
return cond;
}
MYSQL_ERROR *Warning_info::push_warning(THD *thd, const MYSQL_ERROR *sql_condition)
{
MYSQL_ERROR *new_condition= push_warning(thd,
sql_condition->get_sql_errno(),
sql_condition->get_sqlstate(),
sql_condition->get_level(),
sql_condition->get_message_text());
if (new_condition)
new_condition->copy_opt_attributes(sql_condition);
return new_condition;
}
/*
Push the warning to error list if there is still room in the list