From feb425a9f21f10068116c0c59670fc953e0c459e Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Wed, 2 Jul 2003 14:45:35 +0300 Subject: [PATCH] fixed bug, which lead to crash mysqld by running 'mysql some_db_with_tables' --- sql/item.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sql/item.cc b/sql/item.cc index 3ea537a19de..9b3e367ccff 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -50,7 +50,13 @@ Item::Item(): next= thd->free_list; // Put in free list thd->free_list= this; loop_id= 0; - if (thd->lex.current_select->parsing_place == SELECT_LEX_NODE::SELECT_LIST) + /* + Item constractor can be called during execution other tnec SQL_COM + command => we should check thd->lex.current_select on zero (thd->lex + can be uninitialized) + */ + if (thd->lex.current_select && + thd->lex.current_select->parsing_place == SELECT_LEX_NODE::SELECT_LIST) thd->lex.current_select->select_items++; }