fixed bug, which lead to crash mysqld by running 'mysql some_db_with_tables'

This commit is contained in:
unknown 2003-07-02 14:45:35 +03:00
parent f974646ab0
commit a03cf34f7f

View file

@ -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++;
}