mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
fixed bugs in view code with prepared statemnts
This commit is contained in:
@ -679,18 +679,6 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
|
||||
if (lex->spfuns.array.buffer)
|
||||
hash_free(&lex->spfuns);
|
||||
|
||||
/*
|
||||
mark to avoid temporary table using and put view reference and find
|
||||
last view table
|
||||
*/
|
||||
for (tbl= view_tables;
|
||||
tbl;
|
||||
tbl= (view_tables_tail= tbl)->next_global)
|
||||
{
|
||||
tbl->skip_temporary= 1;
|
||||
tbl->belong_to_view= top_view;
|
||||
}
|
||||
|
||||
/*
|
||||
check rights to run commands (EXPLAIN SELECT & SHOW CREATE) which show
|
||||
underlying tables
|
||||
@ -710,6 +698,18 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
mark to avoid temporary table using and put view reference and find
|
||||
last view table
|
||||
*/
|
||||
for (tbl= view_tables;
|
||||
tbl;
|
||||
tbl= (view_tables_tail= tbl)->next_global)
|
||||
{
|
||||
tbl->skip_temporary= 1;
|
||||
tbl->belong_to_view= top_view;
|
||||
}
|
||||
|
||||
/* move SQL_NO_CACHE & Co to whole query */
|
||||
old_lex->safe_to_cache_query= (old_lex->safe_to_cache_query &&
|
||||
lex->safe_to_cache_query);
|
||||
|
Reference in New Issue
Block a user