Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sql/sql_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4420,10 +4420,9 @@ handle_table(THD *thd, Query_tables_list *prelocking_ctx,
{
if (table_list->table->triggers)
{
*need_prelocking= TRUE;

if (table_list->table->triggers->
add_tables_and_routines_for_triggers(thd, prelocking_ctx, table_list))
add_tables_and_routines_for_triggers(thd, prelocking_ctx, table_list,need_prelocking))
return TRUE;
}
if (table_list->table->file->referenced_by_foreign_key())
Expand Down
3 changes: 2 additions & 1 deletion sql/sql_trigger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ bool
Table_triggers_list::
add_tables_and_routines_for_triggers(THD *thd,
Query_tables_list *prelocking_ctx,
TABLE_LIST *table_list)
TABLE_LIST *table_list,bool *need_prelocking)
{
DBUG_ASSERT(static_cast<int>(table_list->lock_type) >=
static_cast<int>(TL_WRITE_ALLOW_WRITE));
Expand All @@ -2253,6 +2253,7 @@ add_tables_and_routines_for_triggers(THD *thd,

for ( ; triggers ; triggers= triggers->next)
{
*need_prelocking = TRUE;
sp_head *trigger= triggers->body;

if (!triggers->body) // Parse error
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class Table_triggers_list: public Sql_alloc

bool add_tables_and_routines_for_triggers(THD *thd,
Query_tables_list *prelocking_ctx,
TABLE_LIST *table_list);
TABLE_LIST *table_list,bool *need_prelocking);

Field **nullable_fields() { return record0_field; }
void reset_extra_null_bitmap()
Expand Down