mirror of
https://github.com/MariaDB/server.git
synced 2025-11-05 01:43:31 +03:00
MDEV-37302 Assertion failure in Table_triggers_list::add_tables_and_routines_for_triggers upon attempt to insert DEFAULT into non-insertable view
Only do trigger prelocking for tables that are doing to be modified (with a write lock). A table can cause prelocking if its DEFAULT value is used (because DEFAULT can be NEXTVAL), even if the table itself is only used for reads. Don't process triggers for such a table
This commit is contained in:
@@ -303,4 +303,14 @@ execute stmt using default;
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
drop sequence s1;
|
||||
#
|
||||
# MDEV-37302 Assertion failure in Table_triggers_list::add_tables_and_routines_for_triggers upon attempt to insert DEFAULT into non-insertable view
|
||||
#
|
||||
create table t1 (f int);
|
||||
create algorithm=temptable view v1 as select * from t1;
|
||||
create trigger tr before update on t1 for each row set @a=1;
|
||||
insert v1 values (default);
|
||||
ERROR HY000: The target table v1 of the INSERT is not insertable-into
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
# End of 10.6 tests
|
||||
|
||||
@@ -229,4 +229,15 @@ deallocate prepare stmt;
|
||||
drop table t1;
|
||||
drop sequence s1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-37302 Assertion failure in Table_triggers_list::add_tables_and_routines_for_triggers upon attempt to insert DEFAULT into non-insertable view
|
||||
--echo #
|
||||
create table t1 (f int);
|
||||
create algorithm=temptable view v1 as select * from t1;
|
||||
create trigger tr before update on t1 for each row set @a=1;
|
||||
--error ER_NON_INSERTABLE_TABLE
|
||||
insert v1 values (default);
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
Reference in New Issue
Block a user