Commit 69df67fb authored by unknown's avatar unknown

fixed uninitialized pointer

parent e559d87b
...@@ -1821,7 +1821,12 @@ extern "C" int my_message_sql(uint error, const char *str, ...@@ -1821,7 +1821,12 @@ extern "C" int my_message_sql(uint error, const char *str,
DBUG_PRINT("error", ("Message: '%s'", str)); DBUG_PRINT("error", ("Message: '%s'", str));
if ((thd= current_thd)) if ((thd= current_thd))
{ {
if (thd->lex.current_select->no_error && !thd->is_fatal_error) /*
thd->lex.current_select equel to zero if lex structure is not inited
(not query command (COM_QUERY))
*/
if (thd->lex.current_select &&
thd->lex.current_select->no_error && !thd->is_fatal_error)
{ {
DBUG_PRINT("error", ("above error converted to warning")); DBUG_PRINT("error", ("above error converted to warning"));
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str); push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str);
......
...@@ -1057,6 +1057,11 @@ bool do_command(THD *thd) ...@@ -1057,6 +1057,11 @@ bool do_command(THD *thd)
net= &thd->net; net= &thd->net;
thd->current_tablenr=0; thd->current_tablenr=0;
/*
indicator of uninitialized lex => normal flow of errors handling
(see my_message_sql)
*/
thd->lex.current_select= 0;
packet=0; packet=0;
old_timeout=net->read_timeout; old_timeout=net->read_timeout;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment