mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge tag '11.4' into 11.6
MariaDB 11.4.4 release
This commit is contained in:
@ -302,16 +302,91 @@ drop sequence s;
|
||||
# End of 10.4 tests
|
||||
#
|
||||
#
|
||||
# MDEV-32350 Can't selectively restore sequences using innodb tables from
|
||||
# backup
|
||||
#
|
||||
create sequence s2 engine=innodb;
|
||||
alter table s2 discard tablespace;
|
||||
SELECT NEXTVAL(s2);
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
create sequence s1 engine=innodb;
|
||||
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
|
||||
flush tables s1 for export;
|
||||
unlock tables;
|
||||
select * from s2;
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
SELECT NEXTVAL(s2);
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
alter sequence s2 restart;
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
alter table s2 import tablespace;
|
||||
select * from s2;
|
||||
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
|
||||
SELECT NEXTVAL(s2);
|
||||
NEXTVAL(s2)
|
||||
1
|
||||
select NEXTVAL(s1);
|
||||
NEXTVAL(s1)
|
||||
1
|
||||
flush table s1,s2;
|
||||
select * from s1;
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
1001 1 9223372036854775806 1 1 1000 0 0
|
||||
select * from s2;
|
||||
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
|
||||
1001 1 9223372036854775806 1 1 1000 0 0
|
||||
drop sequence s1,s2;
|
||||
#
|
||||
# MDEV-35144 CREATE TABLE ... LIKE uses current innodb_compression_default instead of the create value
|
||||
#
|
||||
set @@innodb_compression_default= off;
|
||||
create or replace sequence s engine=innodb;
|
||||
set @@innodb_compression_default= on;
|
||||
create or replace table s_import like s;
|
||||
show create table s;
|
||||
Table Create Table
|
||||
s CREATE TABLE `s` (
|
||||
`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_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
|
||||
show create table s_import;
|
||||
Table Create Table
|
||||
s_import CREATE TABLE `s_import` (
|
||||
`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_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
|
||||
alter table s_import discard tablespace;
|
||||
flush table s for export;
|
||||
UNLOCK TABLES;
|
||||
alter table s_import import tablespace;
|
||||
drop table s,s_import;
|
||||
# End of 10.5 tests
|
||||
#
|
||||
# MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
|
||||
#
|
||||
CREATE SEQUENCE s1 ENGINE=InnoDB;
|
||||
CREATE SEQUENCE s2 ENGINE=InnoDB;
|
||||
SHOW CREATE SEQUENCE s1;
|
||||
Table Create Table
|
||||
s1 CREATE SEQUENCE `s1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB
|
||||
s1 CREATE SEQUENCE `s1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB `PAGE_COMPRESSED`='ON'
|
||||
SHOW CREATE SEQUENCE s2;
|
||||
Table Create Table
|
||||
s2 CREATE SEQUENCE `s2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB
|
||||
s2 CREATE SEQUENCE `s2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB `PAGE_COMPRESSED`='ON'
|
||||
DROP SEQUENCE s2;
|
||||
RENAME TABLE s1 TO s2;
|
||||
DROP SEQUENCE s2;
|
||||
|
@ -202,6 +202,63 @@ drop sequence s;
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-32350 Can't selectively restore sequences using innodb tables from
|
||||
--echo # backup
|
||||
--echo #
|
||||
|
||||
--disable_ps_protocol
|
||||
|
||||
create sequence s2 engine=innodb;
|
||||
alter table s2 discard tablespace;
|
||||
--error ER_GET_ERRNO
|
||||
SELECT NEXTVAL(s2);
|
||||
create sequence s1 engine=innodb;
|
||||
select * from s1;
|
||||
flush tables s1 for export;
|
||||
--let $MYSQLD_DATADIR= `select @@datadir`
|
||||
--move_file $MYSQLD_DATADIR/test/s1.cfg $MYSQLD_DATADIR/test/s2.cfg
|
||||
--copy_file $MYSQLD_DATADIR/test/s1.ibd $MYSQLD_DATADIR/test/s2.ibd
|
||||
unlock tables;
|
||||
--error ER_GET_ERRNO
|
||||
select * from s2;
|
||||
--error ER_GET_ERRNO
|
||||
SELECT NEXTVAL(s2);
|
||||
--error ER_GET_ERRNO
|
||||
alter sequence s2 restart;
|
||||
alter table s2 import tablespace;
|
||||
select * from s2;
|
||||
SELECT NEXTVAL(s2);
|
||||
select NEXTVAL(s1);
|
||||
flush table s1,s2;
|
||||
select * from s1;
|
||||
select * from s2;
|
||||
drop sequence s1,s2;
|
||||
|
||||
--enable_ps_protocol
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35144 CREATE TABLE ... LIKE uses current innodb_compression_default instead of the create value
|
||||
--echo #
|
||||
|
||||
set @@innodb_compression_default= off;
|
||||
create or replace sequence s engine=innodb;
|
||||
set @@innodb_compression_default= on;
|
||||
create or replace table s_import like s;
|
||||
|
||||
show create table s;
|
||||
show create table s_import;
|
||||
|
||||
alter table s_import discard tablespace;
|
||||
flush table s for export;
|
||||
--copy_file $MYSQLD_DATADIR/test/s.ibd $MYSQLD_DATADIR/test/s_import.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/s.cfg $MYSQLD_DATADIR/test/s_import.cfg
|
||||
UNLOCK TABLES;
|
||||
alter table s_import import tablespace;
|
||||
drop table s,s_import;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
|
||||
--echo #
|
||||
|
@ -722,6 +722,37 @@ ERROR HY000: Sequence 'test.s' table structure is invalid (Wrong number of colum
|
||||
#
|
||||
# End of 10.4 test
|
||||
#
|
||||
#
|
||||
# Ensure that SHOW CREATE TABLE shows used table options
|
||||
#
|
||||
SET @@innodb_compression_default=ON;
|
||||
CREATE TABLE seq (
|
||||
`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
|
||||
) engine=innodb,sequence=1;
|
||||
show create sequence seq;
|
||||
Table Create Table
|
||||
seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB `PAGE_COMPRESSED`='ON'
|
||||
show create table seq;
|
||||
Table Create Table
|
||||
seq CREATE TABLE `seq` (
|
||||
`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
|
||||
) ENGINE=InnoDB SEQUENCE=1 `PAGE_COMPRESSED`='ON'
|
||||
drop sequence seq;
|
||||
SET @@innodb_compression_default=DEFAULT;
|
||||
######
|
||||
# MDEV-28152 Features for sequence
|
||||
######
|
||||
@ -1341,6 +1372,4 @@ def test s7 int 32 2 0 1 1 2147483646 1 0
|
||||
def test s8 bigint 64 2 0 1 1 9223372036854775806 1 0
|
||||
def test s9 tinyint unsigned 8 2 0 1 1 254 1 0
|
||||
drop sequence s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
||||
#
|
||||
# End of 11.5 tests
|
||||
#
|
||||
|
@ -563,6 +563,26 @@ create table s sequence=1 as select 1;
|
||||
--echo # End of 10.4 test
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Ensure that SHOW CREATE TABLE shows used table options
|
||||
--echo #
|
||||
|
||||
SET @@innodb_compression_default=ON;
|
||||
CREATE TABLE seq (
|
||||
`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
|
||||
) engine=innodb,sequence=1;
|
||||
show create sequence seq;
|
||||
show create table seq;
|
||||
drop sequence seq;
|
||||
SET @@innodb_compression_default=DEFAULT;
|
||||
|
||||
--echo ######
|
||||
--echo # MDEV-28152 Features for sequence
|
||||
--echo ######
|
||||
@ -766,6 +786,4 @@ create sequence s13 as bigint unsigned;
|
||||
select * from information_schema.sequences order by sequence_name;
|
||||
drop sequence s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
|
||||
|
||||
--echo #
|
||||
--echo # End of 11.5 tests
|
||||
--echo #
|
||||
|
@ -497,7 +497,7 @@ select next value for t1;
|
||||
next value for t1
|
||||
1
|
||||
select next value for t1, minimum_value;
|
||||
ERROR 42S22: Unknown column 'minimum_value' in 'field list'
|
||||
ERROR 42S22: Unknown column 'minimum_value' in 'SELECT'
|
||||
drop sequence t1;
|
||||
#
|
||||
# MDEV-12854 Synchronize CREATE..SELECT data type and result set metadata data type for INT functions
|
||||
|
Reference in New Issue
Block a user