1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#17204 "second CALL to procedure crashes Server"

Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views"
This bug caused crashes or resulted in wrong data being returned
when one tried to obtain information from I_S tables about views
using stored functions.

It was caused by the fact that we were using LEX representing
statement which were doing select from I_S tables as active LEX
when contents of I_S table were built. So state of this LEX both
affected and was affected by open_tables() calls which happened
during this process. This resulted in wrong behavior and in
violations of some of invariants which caused crashes.

This fix tries to solve this problem by properly saving/resetting
and restoring part of LEX which affects and is affected by the
process of opening tables and views in get_all_tables() routine.
To simplify things we separated this part of LEX in a new class
and made LEX its descendant.
This commit is contained in:
gluh@eagle.intranet.mysql.r18.ru
2006-05-30 10:45:23 +05:00
parent 3cf1f85d35
commit ae72df07f2
6 changed files with 308 additions and 87 deletions

View File

@ -2240,6 +2240,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
tables can be left opening
*/
close_thread_tables(thd);
lex->reset_query_tables_list(FALSE);
if (protocol->write())
goto err;
continue;
@ -2487,6 +2488,7 @@ send_result_message:
}
}
close_thread_tables(thd);
lex->reset_query_tables_list(FALSE);
table->table=0; // For query cache
if (protocol->write())
goto err;