diff options
author | unknown <bell@sanja.is.com.ua> | 2003-07-01 19:05:08 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-07-01 19:05:08 +0300 |
commit | 69df67fbcfef13a7bee18527776495f32e99b043 (patch) | |
tree | 8d4180b6e14ba643c978e9c42d4b64353d37fa59 | |
parent | e559d87b8665c10163cfcb6dadf97cb421098b90 (diff) | |
download | mariadb-git-69df67fbcfef13a7bee18527776495f32e99b043.tar.gz |
fixed uninitialized pointer
-rw-r--r-- | sql/mysqld.cc | 7 | ||||
-rw-r--r-- | sql/sql_parse.cc | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 27fc8ea70ac..0ea6b0778d5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1821,7 +1821,12 @@ extern "C" int my_message_sql(uint error, const char *str, DBUG_PRINT("error", ("Message: '%s'", str)); 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")); push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 5070466007e..6ebb338f872 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1057,6 +1057,11 @@ bool do_command(THD *thd) net= &thd->net; thd->current_tablenr=0; + /* + indicator of uninitialized lex => normal flow of errors handling + (see my_message_sql) + */ + thd->lex.current_select= 0; packet=0; old_timeout=net->read_timeout; |