Commit 5d428217 authored by unknown's avatar unknown

In prepare_view_securety_context() the sql_command came in wrong.

If the first part was SHOW and second part SELECT, it would have
thought that the command was SELECT, although the first part of
it was SHOW. It would then fail later.

Thus we need to set thd->lex to old_lex (first part) here before going
in to prepare_security().
parent 03b9502d
...@@ -1191,9 +1191,11 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table) ...@@ -1191,9 +1191,11 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
ok2: ok2:
if (!old_lex->time_zone_tables_used && thd->lex->time_zone_tables_used) if (!old_lex->time_zone_tables_used && thd->lex->time_zone_tables_used)
old_lex->time_zone_tables_used= thd->lex->time_zone_tables_used; old_lex->time_zone_tables_used= thd->lex->time_zone_tables_used;
DBUG_ASSERT(lex == thd->lex);
thd->lex= old_lex; // Needed for prepare_security
result= !table->prelocking_placeholder && table->prepare_security(thd); result= !table->prelocking_placeholder && table->prepare_security(thd);
lex_end(thd->lex); lex_end(lex);
end: end:
if (arena) if (arena)
thd->restore_active_arena(arena, &backup); thd->restore_active_arena(arena, &backup);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment