mirror of
https://github.com/MariaDB/server.git
synced 2025-11-06 13:10:12 +03:00
Merge 11.4 into 11.8
This commit is contained in:
@@ -313,4 +313,37 @@ insert v1 values (default);
|
||||
ERROR HY000: The target table v1 of the INSERT is not insertable-into
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-37172 Server crashes in Item_func_nextval::update_table after
|
||||
# INSERT to the table, that uses expression with nextval() as default
|
||||
#
|
||||
create sequence s1;
|
||||
create sequence s2;
|
||||
create table t1 (id int default(nextval(s1)));
|
||||
create table t2 (id int default(nextval(s1)+nextval(s1)));
|
||||
create table t3 (id1 int default(nextval(s1)+nextval(s1)),
|
||||
id2 int default(nextval(s2)));
|
||||
insert t1 values ();
|
||||
select lastval(s1);
|
||||
lastval(s1)
|
||||
1
|
||||
select * from t1;
|
||||
id
|
||||
1
|
||||
insert t2 values ();
|
||||
select lastval(s1);
|
||||
lastval(s1)
|
||||
3
|
||||
select * from t2;
|
||||
id
|
||||
5
|
||||
insert t3 values ();
|
||||
select lastval(s1), lastval(s2);
|
||||
lastval(s1) lastval(s2)
|
||||
5 1
|
||||
select * from t3;
|
||||
id1 id2
|
||||
9 1
|
||||
drop table t1,t2,t3;
|
||||
drop sequence s1,s2;
|
||||
# End of 10.6 tests
|
||||
|
||||
@@ -240,4 +240,27 @@ insert v1 values (default);
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-37172 Server crashes in Item_func_nextval::update_table after
|
||||
--echo # INSERT to the table, that uses expression with nextval() as default
|
||||
--echo #
|
||||
|
||||
create sequence s1;
|
||||
create sequence s2;
|
||||
create table t1 (id int default(nextval(s1)));
|
||||
create table t2 (id int default(nextval(s1)+nextval(s1)));
|
||||
create table t3 (id1 int default(nextval(s1)+nextval(s1)),
|
||||
id2 int default(nextval(s2)));
|
||||
insert t1 values ();
|
||||
select lastval(s1);
|
||||
select * from t1;
|
||||
insert t2 values ();
|
||||
select lastval(s1);
|
||||
select * from t2;
|
||||
insert t3 values ();
|
||||
select lastval(s1), lastval(s2);
|
||||
select * from t3;
|
||||
drop table t1,t2,t3;
|
||||
drop sequence s1,s2;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
||||
Reference in New Issue
Block a user