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:
@ -8,17 +8,17 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`next_value` bigint(21) NOT NULL COMMENT 'next not cached value',
|
||||
`min_value` bigint(21) NOT NULL COMMENT 'min value',
|
||||
`max_value` bigint(21) NOT NULL COMMENT 'max value',
|
||||
`start` bigint(21) NOT NULL COMMENT 'start value',
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
|
||||
`increment` bigint(21) NOT NULL COMMENT 'increment value',
|
||||
`cache` bigint(21) NOT NULL COMMENT 'cache size',
|
||||
`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state',
|
||||
`round` bigint(21) NOT NULL COMMENT 'How many cycles has been done'
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||
`cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
|
||||
) ENGINE=MyISAM SEQUENCE=1
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
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
|
||||
create or replace sequence t1 engine=innodb;
|
||||
show create sequence t1;
|
||||
@ -27,17 +27,17 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`next_value` bigint(21) NOT NULL COMMENT 'next not cached value',
|
||||
`min_value` bigint(21) NOT NULL COMMENT 'min value',
|
||||
`max_value` bigint(21) NOT NULL COMMENT 'max value',
|
||||
`start` bigint(21) NOT NULL COMMENT 'start value',
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
|
||||
`increment` bigint(21) NOT NULL COMMENT 'increment value',
|
||||
`cache` bigint(21) NOT NULL COMMENT 'cache size',
|
||||
`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state',
|
||||
`round` bigint(21) NOT NULL COMMENT 'How many cycles has been done'
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||
`cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
|
||||
) ENGINE=InnoDB SEQUENCE=1
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
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
|
||||
create or replace sequence t1 engine=maria;
|
||||
show create sequence t1;
|
||||
@ -46,17 +46,17 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`next_value` bigint(21) NOT NULL COMMENT 'next not cached value',
|
||||
`min_value` bigint(21) NOT NULL COMMENT 'min value',
|
||||
`max_value` bigint(21) NOT NULL COMMENT 'max value',
|
||||
`start` bigint(21) NOT NULL COMMENT 'start value',
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
|
||||
`increment` bigint(21) NOT NULL COMMENT 'increment value',
|
||||
`cache` bigint(21) NOT NULL COMMENT 'cache size',
|
||||
`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state',
|
||||
`round` bigint(21) NOT NULL COMMENT 'How many cycles has been done'
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||
`cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
|
||||
) ENGINE=Aria SEQUENCE=1
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
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
|
||||
create or replace sequence t1 engine=archive;
|
||||
ERROR HY000: Table storage engine 'ARCHIVE' does not support the create option 'SEQUENCE'
|
||||
@ -67,42 +67,42 @@ show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 10 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
10 1 9223372036854775806 10 1 1000 0 0
|
||||
create or replace sequence t1 minvalue=11;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 11 minvalue 11 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
11 11 9223372036854775806 11 1 1000 0 0
|
||||
create or replace sequence t1 maxvalue=13 increment by -1;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 13 minvalue -9223372036854775807 maxvalue 13 increment by -1 cache 1000 nocycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
13 -9223372036854775807 13 13 -1 1000 0 0
|
||||
create or replace sequence t1 increment by -1 cache 100;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with -1 minvalue -9223372036854775807 maxvalue -1 increment by -1 cache 100 nocycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
-1 -9223372036854775807 -1 -1 -1 100 0 0
|
||||
create or replace sequence t1 cycle;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
1 1 9223372036854775806 1 1 1000 1 0
|
||||
create or replace sequence t1 nocycle;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
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
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
@ -112,7 +112,7 @@ show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 14 minvalue 14 maxvalue 9223372036854775806 increment by 1 cache 1000 cycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
14 14 9223372036854775806 14 1 1000 1 0
|
||||
create or replace sequence t1 cycle increment by -1;
|
||||
show create sequence t1;
|
||||
@ -124,7 +124,7 @@ create sequence if not exists t1 start with 10;
|
||||
Warnings:
|
||||
Note 1050 Table 't1' already exists
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
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
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
@ -134,14 +134,14 @@ show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 10 minvalue 10 maxvalue 11 increment by 1 nocache cycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
10 10 11 10 1 0 1 0
|
||||
create or replace sequence t1 start with 10 minvalue=-10 maxvalue=11 cache=10 cycle increment by 10;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 10 minvalue -10 maxvalue 11 increment by 10 cache 10 cycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
10 -10 11 10 10 10 1 0
|
||||
create or replace sequence t1 start with 10 NO MAXVALUE NO MINVALUE;
|
||||
create or replace sequence t1 start with 10 maxvalue 10;
|
||||
@ -155,12 +155,12 @@ show create sequence t1;
|
||||
Table Create Table
|
||||
t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 0 cache 1000 nocycle ENGINE=MyISAM
|
||||
select * from t1;
|
||||
next_value min_value max_value start increment cache cycle round
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
1 1 9223372036854775806 1 0 1000 0 0
|
||||
drop sequence t1;
|
||||
create table t1 (a int);
|
||||
show create sequence t1;
|
||||
ERROR HY000: 'test.t1' is not of type 'SEQUENCE'
|
||||
ERROR 42S02: 'test.t1' is not a SEQUENCE
|
||||
drop sequence t1;
|
||||
ERROR 42S02: 'test.t1' is not a SEQUENCE
|
||||
drop sequence if exists t1;
|
||||
@ -193,46 +193,46 @@ drop sequence t1;
|
||||
create sequence t1;
|
||||
show fields from t1;
|
||||
Field Type Null Key Default Extra
|
||||
next_value bigint(21) NO NULL
|
||||
min_value bigint(21) NO NULL
|
||||
max_value bigint(21) NO NULL
|
||||
start bigint(21) NO NULL
|
||||
next_not_cached_value bigint(21) NO NULL
|
||||
minimum_value bigint(21) NO NULL
|
||||
maximum_value bigint(21) NO NULL
|
||||
start_value bigint(21) NO NULL
|
||||
increment bigint(21) NO NULL
|
||||
cache bigint(21) NO NULL
|
||||
cycle tinyint(1) unsigned NO NULL
|
||||
round bigint(21) NO NULL
|
||||
cache_size bigint(21) unsigned NO NULL
|
||||
cycle_option tinyint(1) unsigned NO NULL
|
||||
cycle_count bigint(21) NO NULL
|
||||
flush tables;
|
||||
show fields from t1;
|
||||
Field Type Null Key Default Extra
|
||||
next_value bigint(21) NO NULL
|
||||
min_value bigint(21) NO NULL
|
||||
max_value bigint(21) NO NULL
|
||||
start bigint(21) NO NULL
|
||||
next_not_cached_value bigint(21) NO NULL
|
||||
minimum_value bigint(21) NO NULL
|
||||
maximum_value bigint(21) NO NULL
|
||||
start_value bigint(21) NO NULL
|
||||
increment bigint(21) NO NULL
|
||||
cache bigint(21) NO NULL
|
||||
cycle tinyint(1) unsigned NO NULL
|
||||
round bigint(21) NO NULL
|
||||
cache_size bigint(21) unsigned NO NULL
|
||||
cycle_option tinyint(1) unsigned NO NULL
|
||||
cycle_count bigint(21) NO NULL
|
||||
create or replace sequence t1 engine=aria;
|
||||
show fields from t1;
|
||||
Field Type Null Key Default Extra
|
||||
next_value bigint(21) NO NULL
|
||||
min_value bigint(21) NO NULL
|
||||
max_value bigint(21) NO NULL
|
||||
start bigint(21) NO NULL
|
||||
next_not_cached_value bigint(21) NO NULL
|
||||
minimum_value bigint(21) NO NULL
|
||||
maximum_value bigint(21) NO NULL
|
||||
start_value bigint(21) NO NULL
|
||||
increment bigint(21) NO NULL
|
||||
cache bigint(21) NO NULL
|
||||
cycle tinyint(1) unsigned NO NULL
|
||||
round bigint(21) NO NULL
|
||||
cache_size bigint(21) unsigned NO NULL
|
||||
cycle_option tinyint(1) unsigned NO NULL
|
||||
cycle_count bigint(21) NO NULL
|
||||
show fields from t1;
|
||||
Field Type Null Key Default Extra
|
||||
next_value bigint(21) NO NULL
|
||||
min_value bigint(21) NO NULL
|
||||
max_value bigint(21) NO NULL
|
||||
start bigint(21) NO NULL
|
||||
next_not_cached_value bigint(21) NO NULL
|
||||
minimum_value bigint(21) NO NULL
|
||||
maximum_value bigint(21) NO NULL
|
||||
start_value bigint(21) NO NULL
|
||||
increment bigint(21) NO NULL
|
||||
cache bigint(21) NO NULL
|
||||
cycle tinyint(1) unsigned NO NULL
|
||||
round bigint(21) NO NULL
|
||||
cache_size bigint(21) unsigned NO NULL
|
||||
cycle_option tinyint(1) unsigned NO NULL
|
||||
cycle_count bigint(21) NO NULL
|
||||
flush tables;
|
||||
create or replace sequence t1 comment= "test 1";
|
||||
show create sequence t1;
|
||||
@ -241,14 +241,14 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`next_value` bigint(21) NOT NULL COMMENT 'next not cached value',
|
||||
`min_value` bigint(21) NOT NULL COMMENT 'min value',
|
||||
`max_value` bigint(21) NOT NULL COMMENT 'max value',
|
||||
`start` bigint(21) NOT NULL COMMENT 'start value',
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
|
||||
`increment` bigint(21) NOT NULL COMMENT 'increment value',
|
||||
`cache` bigint(21) NOT NULL COMMENT 'cache size',
|
||||
`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state',
|
||||
`round` bigint(21) NOT NULL COMMENT 'How many cycles has been done'
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||
`cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
|
||||
) ENGINE=MyISAM SEQUENCE=1 COMMENT='test 1'
|
||||
create or replace sequence t1 comment= "test 2" min_rows=1 max_rows=2;
|
||||
show create sequence t1;
|
||||
@ -257,27 +257,28 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`next_value` bigint(21) NOT NULL COMMENT 'next not cached value',
|
||||
`min_value` bigint(21) NOT NULL COMMENT 'min value',
|
||||
`max_value` bigint(21) NOT NULL COMMENT 'max value',
|
||||
`start` bigint(21) NOT NULL COMMENT 'start value',
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used',
|
||||
`increment` bigint(21) NOT NULL COMMENT 'increment value',
|
||||
`cache` bigint(21) NOT NULL COMMENT 'cache size',
|
||||
`cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state',
|
||||
`round` bigint(21) NOT NULL COMMENT 'How many cycles has been done'
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||
`cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done'
|
||||
) ENGINE=MyISAM MIN_ROWS=1 MAX_ROWS=2 SEQUENCE=1 COMMENT='test 2'
|
||||
create or replace sequence t1 start=1 increment= 2;
|
||||
create or replace sequence t1 start 1 increment 2;
|
||||
create or replace sequence t1 cache +1;
|
||||
drop sequence t1;
|
||||
CREATE TABLE t1 (
|
||||
`next_value` bigint(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL
|
||||
) sequence=1;
|
||||
show create sequence t1;
|
||||
Table Create Table
|
||||
@ -285,93 +286,93 @@ t1 CREATE SEQUENCE `t1` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`next_value` bigint(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL
|
||||
) ENGINE=MyISAM SEQUENCE=1
|
||||
drop sequence t1;
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`next_val` bigint(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count_not_exists` bigint(21) NOT NULL
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (next_val)
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle_count_not_exists)
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`next_value` int(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` int(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (next_value)
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (next_not_cached_value)
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`next_val` bigint(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle` bigint(21) unsigned NOT NULL, /* error */
|
||||
`round` bigint(21) NOT NULL
|
||||
`cycle_count` bigint(21) NOT NULL
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (next_val)
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (cycle)
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`next_value` bigint(21),
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21), /* error */
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (next_value)
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (next_not_cached_value)
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`next_value` bigint(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL,
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL,
|
||||
extra_field bigint(21)
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (Wrong number of columns)
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`next_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (min_value)
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (minimum_value)
|
||||
CREATE OR REPLACE TABLE t1 (
|
||||
`next_value` bigint(21) NOT NULL,
|
||||
`min_value` bigint(21) NOT NULL,
|
||||
`max_value` bigint(21) NOT NULL,
|
||||
`start` bigint(21) NOT NULL,
|
||||
`next_not_cached_value` bigint(21) NOT NULL,
|
||||
`minimum_value` bigint(21) NOT NULL,
|
||||
`maximum_value` bigint(21) NOT NULL,
|
||||
`start_value` bigint(21) NOT NULL,
|
||||
`increment` bigint(21) NOT NULL,
|
||||
`cache` bigint(21) NOT NULL,
|
||||
`cycle` tinyint(1) unsigned NOT NULL,
|
||||
`round` bigint(21) NOT NULL,
|
||||
key key1 (next_value)
|
||||
`cache_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL,
|
||||
key key1 (next_not_cached_value)
|
||||
) sequence=1;
|
||||
ERROR HY000: Sequence 'test.t1' table structure is invalid (Sequence tables cannot have any keys)
|
||||
drop sequence if exists t1;
|
||||
|
Reference in New Issue
Block a user