1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-community

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge
This commit is contained in:
cmiller@zippy.cornsilk.net
2007-11-09 14:55:32 -05:00
177 changed files with 9488 additions and 1721 deletions

View File

@ -402,7 +402,7 @@ THD::THD()
count_cuted_fields= CHECK_FIELD_IGNORE;
killed= NOT_KILLED;
col_access=0;
query_error= thread_specific_used= FALSE;
is_slave_error= thread_specific_used= FALSE;
hash_clear(&handler_tables_hash);
tmp_table=0;
used_tables=0;
@ -508,12 +508,12 @@ void THD::push_internal_handler(Internal_error_handler *handler)
}
bool THD::handle_error(uint sql_errno,
bool THD::handle_error(uint sql_errno, const char *message,
MYSQL_ERROR::enum_warning_level level)
{
if (m_internal_handler)
{
return m_internal_handler->handle_error(sql_errno, level, this);
return m_internal_handler->handle_error(sql_errno, message, level, this);
}
return FALSE; // 'FALSE', as per coding style
@ -1315,23 +1315,26 @@ bool select_send::send_fields(List<Item> &list, uint flags)
{
bool res;
if (!(res= thd->protocol->send_fields(&list, flags)))
status= 1;
is_result_set_started= 1;
return res;
}
void select_send::abort()
{
DBUG_ENTER("select_send::abort");
if (status && thd->spcont &&
if (is_result_set_started && thd->spcont &&
thd->spcont->find_handler(thd, thd->net.last_errno,
MYSQL_ERROR::WARN_LEVEL_ERROR))
{
/*
Executing stored procedure without a handler.
Here we should actually send an error to the client,
but as an error will break a multiple result set, the only thing we
can do for now is to nicely end the current data set and remembering
the error so that the calling routine will abort
We're executing a stored procedure, have an open result
set, an SQL exception conditiona and a handler for it.
In this situation we must abort the current statement,
silence the error and start executing the continue/exit
handler.
Before aborting the statement, let's end the open result set, as
otherwise the client will hang due to the violation of the
client/server protocol.
*/
thd->net.report_error= 0;
send_eof();
@ -1341,6 +1344,17 @@ void select_send::abort()
}
/**
Cleanup an instance of this class for re-use
at next execution of a prepared statement/
stored procedure statement.
*/
void select_send::cleanup()
{
is_result_set_started= FALSE;
}
/* Send data to client. Returns 0 if ok */
bool select_send::send_data(List<Item> &items)
@ -1378,7 +1392,7 @@ bool select_send::send_data(List<Item> &items)
thd->sent_row_count++;
if (!thd->vio_ok())
DBUG_RETURN(0);
if (!thd->net.report_error)
if (! thd->is_error())
DBUG_RETURN(protocol->write());
protocol->remove_last_row();
DBUG_RETURN(1);
@ -1399,10 +1413,10 @@ bool select_send::send_eof()
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}
if (!thd->net.report_error)
if (! thd->is_error())
{
::send_eof(thd);
status= 0;
is_result_set_started= 0;
return 0;
}
else
@ -2414,6 +2428,7 @@ void Security_context::init()
host= user= priv_user= ip= 0;
host_or_ip= "connecting host";
priv_host[0]= '\0';
master_access= 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
db_access= NO_ACCESS;
#endif