From e0b4db5ba3d1fb14a1ec9e4ab0b346c6a8eebfd6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 11 Oct 2022 12:56:01 +0200 Subject: MDEV-29750 triggers can modify history should be the same behavior as for virtual columns: * a warning on every inserted row * silently ignored in a trigger --- sql/item.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/item.cc') diff --git a/sql/item.cc b/sql/item.cc index 6681d5e375d..8b127cf2626 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -9804,6 +9804,8 @@ bool Item_trigger_field::set_value(THD *thd, sp_rcontext * /*ctx*/, Item **it) if (!item || fix_fields_if_needed(thd, NULL)) return true; + if (field->vers_sys_field()) + return false; // NOTE: field->table->copy_blobs should be false here, but let's // remember the value at runtime to avoid subtle bugs. -- cgit v1.2.1 From e00ea301efd9e02f89341dfec3a5e0e751213ed8 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Fri, 21 Oct 2022 13:47:17 +0200 Subject: MDEV-16549 Server crashes in Item_field::fix_fields on query with view and subquery, Assertion `context' failed, Assertion `field' failed Add one-table-resolve context for items created with an aim of switching to temporary table because then it can be cloned in push-down-condition. --- sql/item.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sql/item.cc') diff --git a/sql/item.cc b/sql/item.cc index 8b127cf2626..012dcebdaee 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -10753,6 +10753,20 @@ void view_error_processor(THD *thd, void *data) ((TABLE_LIST *)data)->hide_view_error(thd); } +/** + Name resolution context with resolution in only one table +*/ + +Name_resolution_context::Name_resolution_context(TABLE_LIST *table): + outer_context(0), table_list(0), select_lex(0), + error_processor_data(0), + security_ctx(0) +{ + resolve_in_select_list= FALSE; + error_processor= &dummy_error_processor; + // resolve only in this table + first_name_resolution_table= last_name_resolution_table= table; +} st_select_lex *Item_ident::get_depended_from() const { -- cgit v1.2.1