mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Don't allow illegal create options for SEQUENCE
MDEV-19977 Assertion `(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X' failed in lock_rec_lock
This commit is contained in:
@ -270,6 +270,48 @@ CREATE OR REPLACE TABLE t1 (
|
||||
key key1 (next_not_cached_value)
|
||||
) sequence=1;
|
||||
|
||||
# Check constraint
|
||||
|
||||
--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
|
||||
CREATE TABLE t1 (
|
||||
`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_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) NOT NULL,
|
||||
CHECK (start_value < minimum_value)
|
||||
) sequence=1;
|
||||
|
||||
--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
|
||||
CREATE TABLE t1 (
|
||||
`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 CHECK (start_value < minimum_value),
|
||||
`increment` 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;
|
||||
|
||||
|
||||
# Virtual field
|
||||
|
||||
--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
|
||||
CREATE TABLE t1 (
|
||||
`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_size` bigint(21) unsigned NOT NULL,
|
||||
`cycle_option` tinyint(1) unsigned NOT NULL,
|
||||
`cycle_count` bigint(21) generated always as (1) virtual
|
||||
) sequence=1;
|
||||
|
||||
drop sequence if exists t1;
|
||||
|
||||
#
|
||||
|
Reference in New Issue
Block a user