Fix for Bug #8897 Test ndb_autodiscover: Spurious warning in --ps-protocol on NDB
This commit is contained in:
parent
ca336ad1de
commit
e6d7c9fc5d
@ -817,7 +817,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint
|
||||
const char *msg);
|
||||
void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level,
|
||||
uint code, const char *format, ...);
|
||||
void mysql_reset_errors(THD *thd);
|
||||
void mysql_reset_errors(THD *thd, bool force= false);
|
||||
bool mysqld_show_warnings(THD *thd, ulong levels_to_show);
|
||||
|
||||
/* sql_handler.cc */
|
||||
|
@ -1606,7 +1606,8 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
|
||||
if (ha_create_table_from_engine(thd, db, name, TRUE) != 0)
|
||||
goto err;
|
||||
|
||||
thd->clear_error(); // Clear error message
|
||||
mysql_reset_errors(thd, true); // Clear warnings
|
||||
thd->clear_error(); // Clear error message
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,7 @@ void MYSQL_ERROR::set_msg(THD *thd, const char *msg_arg)
|
||||
SYNOPSIS
|
||||
mysql_reset_errors()
|
||||
thd Thread handle
|
||||
force Reset warnings even if it has been done before
|
||||
|
||||
IMPLEMENTATION
|
||||
Don't reset warnings if this has already been called for this query.
|
||||
@ -71,14 +72,15 @@ void MYSQL_ERROR::set_msg(THD *thd, const char *msg_arg)
|
||||
in which case push_warnings() has already called this function.
|
||||
*/
|
||||
|
||||
void mysql_reset_errors(THD *thd)
|
||||
void mysql_reset_errors(THD *thd, bool force)
|
||||
{
|
||||
DBUG_ENTER("mysql_reset_errors");
|
||||
if (thd->query_id != thd->warn_id)
|
||||
if (thd->query_id != thd->warn_id || force)
|
||||
{
|
||||
thd->warn_id= thd->query_id;
|
||||
free_root(&thd->warn_root,MYF(0));
|
||||
bzero((char*) thd->warn_count, sizeof(thd->warn_count));
|
||||
if (force) thd->total_warn_count= 0;
|
||||
thd->warn_list.empty();
|
||||
thd->row_count= 1; // by default point to row 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user