1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2022-04-06 10:06:39 +03:00
66 changed files with 680 additions and 556 deletions

View File

@ -29,7 +29,7 @@ select * from t1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
3 -100 9223372036854775806 50 1 0 0 0
alter sequence t1 minvalue=100 start=100;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100;
show create sequence t1;
Table Create Table
@ -200,21 +200,20 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=100;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=25 maxvalue=20;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1;
create table t1 (a int);
alter sequence t1 minvalue=100;
ERROR 42S02: 'test.t1' is not a SEQUENCE
drop table t1;
alter sequence if exists t1 minvalue=100;
Warnings:
Note 4091 Unknown SEQUENCE: 'test.t1'
ERROR 42S02: Unknown SEQUENCE: 't1'
alter sequence t1 minvalue=100;
ERROR 42S02: Table 'test.t1' doesn't exist
ERROR 42S02: Unknown SEQUENCE: 't1'
create sequence t1;
alter sequence t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1

View File

@ -119,8 +119,9 @@ create table t1 (a int);
alter sequence t1 minvalue=100;
drop table t1;
--error ER_UNKNOWN_SEQUENCES
alter sequence if exists t1 minvalue=100;
--error ER_NO_SUCH_TABLE
--error ER_UNKNOWN_SEQUENCES
alter sequence t1 minvalue=100;
create sequence t1;

View File

@ -53,7 +53,7 @@ next value for s1
drop sequence s1;
CREATE SEQUENCE t1;
alter sequence t1 minvalue=100;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100;
rename table t1 to t2;
select next value for t2;

View File

@ -167,11 +167,11 @@ drop sequence if exists t1;
Warnings:
Note 4090 'test.t1' is not a SEQUENCE
create sequence t1 start with 10 maxvalue=9;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 minvalue= 100 maxvalue=10;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 start with 9 minvalue=10;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
create or replace sequence t1 maxvalue=13, increment by -1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' increment by -1' at line 1
create or replace sequence t1 start with= 10 maxvalue=13;
@ -183,7 +183,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NO MINVALUE' at line 1
create sequence t1 start with 10 maxvalue=9223372036854775807;
ERROR HY000: Sequence 'test.t1' values are conflicting
ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 start with 10 minvalue=-9223372036854775808;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '9223372036854775808' at line 1
create sequence t1 RESTART WITH 10;
@ -477,7 +477,7 @@ next value for t1
1
drop temporary table t1;
select previous value for t1;
ERROR 42S02: Table 'test.t1' doesn't exist
ERROR 42S02: Unknown SEQUENCE: 't1'
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10;
select next value for t1;
next value for t1
@ -506,7 +506,7 @@ next value for t1
1
drop temporary table t1;
select previous value for t1;
ERROR 42S02: Table 'test.t1' doesn't exist
ERROR 42S02: Unknown SEQUENCE: 't1'
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb;
select next value for t1;
next value for t1
@ -686,3 +686,33 @@ set global innodb_force_primary_key=default;
ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
ERROR HY000: Sequence 'test.s1' table structure is invalid (Sequence tables cannot have any keys)
DROP SEQUENCE s1;
#
# Beginning of 10.4 Test
#
# MDEV-13005: Fixing bugs in SEQUENCE, part 3
#
# Task 1:
SET @x = PREVIOUS VALUE FOR x;
ERROR 42S02: Unknown SEQUENCE: 'x'
# Task 2:
CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
ERROR HY000: Sequence 'test.x' has out of range value for options
# Task 3:
CREATE SEQUENCE seq1 START WITH 1 cache -1;
ERROR HY000: Sequence 'test.seq1' has out of range value for options
# Task 4:
CREATE TEMPORARY TABLE s1 (s1 INT);
DROP TEMPORARY SEQUENCE s1;
ERROR 42S02: 'test.s1' is not a SEQUENCE
DROP TEMPORARY TABLE s1;
# Task 5:
CREATE TEMPORARY TABLE s1 (s1 INT);
CREATE TEMPORARY SEQUENCE s1 (s1 INT);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(s1 INT)' at line 1
DROP TEMPORARY TABLE s1;
# Task 6:
CREATE SEQUENCE seq1 START WITH 2;
CREATE TRIGGER s1 BEFORE UPDATE ON seq1 FOR EACH ROW SET @a= 5;
ERROR HY000: Trigger's 'seq1' is view, temporary table or sequence
DROP SEQUENCE seq1;
# End of 10.4 test

View File

@ -382,7 +382,7 @@ drop view v1;
CREATE TEMPORARY SEQUENCE t1;
select next value for t1;
drop temporary table t1;
--error ER_NO_SUCH_TABLE
--error ER_UNKNOWN_SEQUENCES
select previous value for t1;
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10;
select next value for t1;
@ -398,7 +398,7 @@ drop sequence t1;
CREATE TEMPORARY SEQUENCE t1 engine=innodb;
select next value for t1;
drop temporary table t1;
--error ER_NO_SUCH_TABLE
--error ER_UNKNOWN_SEQUENCES
select previous value for t1;
CREATE SEQUENCE t1 start with 1 minvalue 1 maxvalue 10 increment by 1 cache 10 engine=innodb;
select next value for t1;
@ -515,3 +515,41 @@ set global innodb_force_primary_key=default;
--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
ALTER TABLE s1 ADD PRIMARY KEY (next_not_cached_value);
DROP SEQUENCE s1;
--echo #
--echo # Beginning of 10.4 Test
--echo #
--echo # MDEV-13005: Fixing bugs in SEQUENCE, part 3
--echo #
--echo # Task 1:
--error ER_UNKNOWN_SEQUENCES
SET @x = PREVIOUS VALUE FOR x;
--echo # Task 2:
--error ER_SEQUENCE_INVALID_DATA
CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
--echo # Task 3:
--error ER_SEQUENCE_INVALID_DATA
CREATE SEQUENCE seq1 START WITH 1 cache -1;
--echo # Task 4:
CREATE TEMPORARY TABLE s1 (s1 INT);
--error ER_NOT_SEQUENCE2
DROP TEMPORARY SEQUENCE s1;
DROP TEMPORARY TABLE s1;
--echo # Task 5:
CREATE TEMPORARY TABLE s1 (s1 INT);
--error ER_PARSE_ERROR
CREATE TEMPORARY SEQUENCE s1 (s1 INT);
DROP TEMPORARY TABLE s1;
--echo # Task 6:
CREATE SEQUENCE seq1 START WITH 2;
--error ER_TRG_ON_VIEW_OR_TEMP_TABLE
CREATE TRIGGER s1 BEFORE UPDATE ON seq1 FOR EACH ROW SET @a= 5;
DROP SEQUENCE seq1;
--echo # End of 10.4 test

View File

@ -109,28 +109,28 @@ maxvalue 100000
increment by 1
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 5
increment by 1
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 1
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 0
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
###########################################
global read lock prevent query sequence
###########################################
@ -314,7 +314,7 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11;
ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11;
ERROR HY000: Sequence 's_db.s_t' values are conflicting
ERROR HY000: Sequence 's_db.s_t' has out of range value for options
commit;
create table t_1(id int);
insert into t_1 value(1111);

View File

@ -387,7 +387,7 @@ previous value for t1
1
drop sequence t1;
select previous value for t1;
ERROR 42S02: Table 'test.t1' doesn't exist
ERROR 42S02: Unknown SEQUENCE: 't1'
CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
select previous value for t1;
previous value for t1

View File

@ -166,7 +166,7 @@ select previous value for t1;
flush tables;
select previous value for t1;
drop sequence t1;
--error ER_NO_SUCH_TABLE
--error ER_UNKNOWN_SEQUENCES
select previous value for t1;
CREATE SEQUENCE t1 start with 5 minvalue 1 maxvalue 10 increment by 1 cache 5 cycle;
select previous value for t1;

View File

@ -50,9 +50,9 @@ ERROR HY000: Field 'maximum_value' doesn't have a default value
insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0);
ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data
insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0);
ERROR HY000: Sequence 'test.s1' values are conflicting
ERROR HY000: Sequence 'test.s1' has out of range value for options
insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
ERROR HY000: Sequence 'test.s1' values are conflicting
ERROR HY000: Sequence 'test.s1' has out of range value for options
select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0
@ -67,7 +67,7 @@ select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
2000 1 9223372036854775806 1 1 1000 0 0
insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
ERROR HY000: Sequence 'test.s2' values are conflicting
ERROR HY000: Sequence 'test.s2' has out of range value for options
select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
2000 1 9223372036854775806 1 1 1000 0 0

View File

@ -227,28 +227,28 @@ maxvalue 100000
increment by 1
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 5
increment by 1
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 1
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 0
nocache
nocycle;
ERROR HY000: Sequence 's_db.s2' values are conflicting
ERROR HY000: Sequence 's_db.s2' has out of range value for options
###########################################
global read lock prevent query sequence
###########################################
@ -412,12 +412,12 @@ select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0
alter sequence s_t minvalue=11 maxvalue=9;
ERROR HY000: Sequence 's_db.s_t' values are conflicting
ERROR HY000: Sequence 's_db.s_t' has out of range value for options
select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0
alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20;
ERROR HY000: Sequence 's_db.s_t' values are conflicting
ERROR HY000: Sequence 's_db.s_t' has out of range value for options
select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0