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

Bug#37460 Assertion failed: !table->file || table->file->inited == handler::NONE

enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free())
This commit is contained in:
Sergey Glukhov
2008-11-27 17:57:34 +04:00
parent 7b488c46a0
commit 2fb574214e
4 changed files with 92 additions and 0 deletions

View File

@ -1249,6 +1249,32 @@ multi_update::initialize_tables(JOIN *join)
}
}
/*
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free()).
*/
if (table_ref->check_option && !join->select_lex->uncacheable)
{
SELECT_LEX_UNIT *tmp_unit;
SELECT_LEX *sl;
for (tmp_unit= join->select_lex->first_inner_unit();
tmp_unit;
tmp_unit= tmp_unit->next_unit())
{
for (sl= tmp_unit->first_select(); sl; sl= sl->next_select())
{
if (sl->master_unit()->item)
{
join->select_lex->uncacheable|= UNCACHEABLE_CHECKOPTION;
goto loop_end;
}
}
}
}
loop_end:
if (table == first_table_for_update && table_ref->check_option)
{
table_map unupdated_tables= table_ref->check_option->used_tables() &