1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed sequences based on comments from Peter Gulutzan and Andrii Nikitin

- Changed names of SEQUENCE table columns to be more close to ANSI
- Fixed error message for SHOW SEQUENCE non_existing_sequence
- Allow syntax CACHE +1
- Fixed ALTER TABLE for TEMPORARY sequences.
This commit is contained in:
Monty
2017-06-03 16:08:23 +03:00
parent 3356e42d01
commit 36ae8846ca
25 changed files with 763 additions and 696 deletions

View File

@ -8,35 +8,35 @@ drop table if exists t1;
--echo #
CREATE SEQUENCE t1 cache 10 engine=myisam;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
do setval(t1,10);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
do setval(t1,12,1);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
do setval(t1,15,0);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select setval(t1,16,0);
select next value for t1;
do setval(t1,1000,0);
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
do setval(t1,2000,0);
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
# Set smaller value
select setval(t1,1000,0);
select next value for t1;
select setval(t1,1000,TRUE);
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select setval(t1,2002,0);
select next value for t1;
select setval(t1,2010,0);
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
drop sequence t1;
--echo #
@ -44,24 +44,24 @@ drop sequence t1;
--echo #
CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select setval(t1,100,0);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select setval(t1,100,0);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select setval(t1,100,0,1);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select setval(t1,100,1,2);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select setval(t1,100,0,3);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
drop sequence t1;
@ -70,26 +70,26 @@ drop sequence t1;
--echo #
CREATE SEQUENCE t1 cache=10 maxvalue=100 engine=innodb;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select setval(t1,200);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
--error ER_SEQUENCE_RUN_OUT
select next value for t1;
drop sequence t1;
CREATE SEQUENCE t1 cache=10 maxvalue=100 cycle engine=innodb;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select setval(t1,200);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
drop sequence t1;
CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10;
select setval(t1,-10);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select setval(t1,-15);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
select setval(t1,-500,FALSE);
select next value for t1;
@ -101,7 +101,7 @@ drop sequence t1;
CREATE SEQUENCE t1 cache=10 maxvalue=0 increment=-10;
select setval(t1,-10,0);
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
select next value for t1;
drop sequence t1;
@ -112,7 +112,7 @@ drop sequence t1;
CREATE SEQUENCE t1;
select setval(t1,10,0),setval(t1,15,1),setval(t1,5,1);
select next value for t1;
select next_value,round from t1;
select next_not_cached_value,cycle_count from t1;
explain extended select setval(t1,100),setval(t1,100,TRUE),setval(t1,100,FALSE,50);
drop sequence t1;