summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/My/Options.pm22
-rw-r--r--mysql-test/lib/mtr_cases.pm6
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff110
-rw-r--r--mysql-test/suite/innodb/r/table_flags,32k.rdiff (renamed from mysql-test/suite/innodb/r/table_flags,32k,release.rdiff)8
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff110
-rw-r--r--mysql-test/suite/innodb/r/table_flags,64k.rdiff (renamed from mysql-test/suite/innodb/r/table_flags,64k,release.rdiff)8
-rw-r--r--mysql-test/suite/innodb/r/table_flags,debug.rdiff98
-rw-r--r--mysql-test/suite/sql_sequence/default.result10
-rw-r--r--mysql-test/suite/sql_sequence/default.test12
9 files changed, 41 insertions, 343 deletions
diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm
index 6e0efe862e7..5827e0666a6 100644
--- a/mysql-test/lib/My/Options.pm
+++ b/mysql-test/lib/My/Options.pm
@@ -140,24 +140,16 @@ sub diff {
}
-sub is_set {
- my ($opts, $set_opts)= @_;
+sub is_subset {
+ my ($set, $subset)= @_;
+ my %cache = map { _split_option($_) } @$set;
- foreach my $opt (@$opts){
-
- my ($opt_name1, $value1)= _split_option($opt);
-
- foreach my $set_opt (@$set_opts){
- my ($opt_name2, $value2)= _split_option($set_opt);
-
- if ($opt_name1 eq $opt_name2 and $value1 eq $value2){
- # Option already set
- return 1;
- }
- }
+ for (@$subset){
+ my ($name, $value)= _split_option($_);
+ return 0 unless exists $cache{$name} and $cache{$name} eq $value;
}
- return 0;
+ return 1;
}
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index dd003dea31d..adc911ba937 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -626,8 +626,10 @@ sub make_combinations($$@)
{
# Skip all other combinations if the values they change
# are already fixed in master_opt or slave_opt
- if (My::Options::is_set($test->{master_opt}, $comb->{comb_opt}) &&
- My::Options::is_set($test->{slave_opt}, $comb->{comb_opt}) ){
+ # (empty combinations are not considered a subset of anything)
+ if (@{$comb->{comb_opt}} &&
+ My::Options::is_subset($test->{master_opt}, $comb->{comb_opt}) &&
+ My::Options::is_subset($test->{slave_opt}, $comb->{comb_opt}) ){
$test_combs->{$comb->{name}} = 2;
diff --git a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
deleted file mode 100644
index babcd88bd91..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff
+++ /dev/null
@@ -1,110 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,32k,debug.reject
-@@ -6,6 +6,8 @@
- SET innodb_strict_mode=OFF;
- CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
- KEY_BLOCK_SIZE=1;
-+Warnings:
-+Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=DYNAMIC.
- SET innodb_strict_mode=ON;
- CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-@@ -11,71 +11,71 @@
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
- SYS_TABLES clustered index root page (8):
- N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001
--header=0x01000003008d (NAME=0x696e66696d756d00)
--header=0x0000101500d5 (NAME='SYS_FOREIGN',
-+header=0x0100000300de (NAME=0x696e66696d756d00)
-+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000b,
-+ ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
-+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000c,
-+ ID=0x000000000000000d,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0000201501ae (NAME='SYS_VIRTUAL',
-+header=0x0000281501bb (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000d,
-+ ID=0x000000000000000e,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0400301501f2 (NAME='test/tc',
-+header=0x0400301501ff (NAME='test/tc',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000f,
-+ ID=0x0000000000000010,
- N_COLS=0x80000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000002)
--header=0x00003815027a (NAME='test/td',
-+header=0x000038150287 (NAME='test/td',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000010,
-+ ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000003)
--header=0x00004815016a (NAME='test/tp',
-+header=0x00004815008d (NAME='test/tp',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000012,
-+ ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000005)
--header=0x000028150236 (NAME='test/tr',
-+header=0x000010150243 (NAME='test/tr',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000e,
-+ ID=0x000000000000000f,
- N_COLS=0x00000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
-@@ -85,9 +85,9 @@
- header=0x000040150074 (NAME='test/tz',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000011,
-+ ID=0x0000000000000012,
- N_COLS=0x80000001,
-- TYPE=0x00000023,
-+ TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff b/mysql-test/suite/innodb/r/table_flags,32k.rdiff
index ce1ff623d50..8079d58bc43 100644
--- a/mysql-test/suite/innodb/r/table_flags,32k,release.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,32k.rdiff
@@ -1,6 +1,6 @@
--- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,32k.reject
-@@ -5,6 +5,8 @@
++++ suite/innodb/r/table_flags.reject
+@@ -6,6 +6,8 @@
SET innodb_strict_mode=OFF;
CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=1;
@@ -9,9 +9,9 @@
SET innodb_strict_mode=ON;
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-@@ -103,7 +105,7 @@
+@@ -87,7 +89,7 @@
DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000013,
+ ID=0x0000000000000011,
N_COLS=0x80000001,
- TYPE=0x00000023,
+ TYPE=0x00000021,
diff --git a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
deleted file mode 100644
index c8763b4c093..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff
+++ /dev/null
@@ -1,110 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,64k,debug.reject
-@@ -6,6 +6,8 @@
- SET innodb_strict_mode=OFF;
- CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
- KEY_BLOCK_SIZE=1;
-+Warnings:
-+Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. Assuming ROW_FORMAT=DYNAMIC.
- SET innodb_strict_mode=ON;
- CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-@@ -11,71 +11,71 @@
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
- SYS_TABLES clustered index root page (8):
- N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001
--header=0x01000003008d (NAME=0x696e66696d756d00)
--header=0x0000101500d5 (NAME='SYS_FOREIGN',
-+header=0x0100000300de (NAME=0x696e66696d756d00)
-+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000b,
-+ ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
-+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000c,
-+ ID=0x000000000000000d,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0000201501ae (NAME='SYS_VIRTUAL',
-+header=0x0000281501bb (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000d,
-+ ID=0x000000000000000e,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0400301501f2 (NAME='test/tc',
-+header=0x0400301501ff (NAME='test/tc',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000f,
-+ ID=0x0000000000000010,
- N_COLS=0x80000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000002)
--header=0x00003815027a (NAME='test/td',
-+header=0x000038150287 (NAME='test/td',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000010,
-+ ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000003)
--header=0x00004815016a (NAME='test/tp',
-+header=0x00004815008d (NAME='test/tp',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000012,
-+ ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000005)
--header=0x000028150236 (NAME='test/tr',
-+header=0x000010150243 (NAME='test/tr',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000e,
-+ ID=0x000000000000000f,
- N_COLS=0x00000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
-@@ -85,9 +85,9 @@
- header=0x000040150074 (NAME='test/tz',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000011,
-+ ID=0x0000000000000012,
- N_COLS=0x80000001,
-- TYPE=0x00000023,
-+ TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
diff --git a/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff b/mysql-test/suite/innodb/r/table_flags,64k.rdiff
index f2ba1280be3..8079d58bc43 100644
--- a/mysql-test/suite/innodb/r/table_flags,64k,release.rdiff
+++ b/mysql-test/suite/innodb/r/table_flags,64k.rdiff
@@ -1,6 +1,6 @@
--- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,64k.reject
-@@ -5,6 +5,8 @@
++++ suite/innodb/r/table_flags.reject
+@@ -6,6 +6,8 @@
SET innodb_strict_mode=OFF;
CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED
KEY_BLOCK_SIZE=1;
@@ -9,9 +9,9 @@
SET innodb_strict_mode=ON;
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
-@@ -103,7 +105,7 @@
+@@ -87,7 +89,7 @@
DB_ROLL_PTR=0x80000000000000,
- ID=0x0000000000000013,
+ ID=0x0000000000000011,
N_COLS=0x80000001,
- TYPE=0x00000023,
+ TYPE=0x00000021,
diff --git a/mysql-test/suite/innodb/r/table_flags,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,debug.rdiff
deleted file mode 100644
index 50592d95ac4..00000000000
--- a/mysql-test/suite/innodb/r/table_flags,debug.rdiff
+++ /dev/null
@@ -1,98 +0,0 @@
---- suite/innodb/r/table_flags.result
-+++ suite/innodb/r/table_flags,debug.reject
-@@ -11,71 +11,71 @@
- PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
- SYS_TABLES clustered index root page (8):
- N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001
--header=0x01000003008d (NAME=0x696e66696d756d00)
--header=0x0000101500d5 (NAME='SYS_FOREIGN',
-+header=0x0100000300de (NAME=0x696e66696d756d00)
-+header=0x000018150126 (NAME='SYS_FOREIGN',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000b,
-+ ID=0x000000000000000c,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
-+header=0x000020150173 (NAME='SYS_FOREIGN_COLS',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000c,
-+ ID=0x000000000000000d,
- N_COLS=0x00000004,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0000201501ae (NAME='SYS_VIRTUAL',
-+header=0x0000281501bb (NAME='SYS_VIRTUAL',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000d,
-+ ID=0x000000000000000e,
- N_COLS=0x00000003,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000040,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000000)
--header=0x0400301501f2 (NAME='test/tc',
-+header=0x0400301501ff (NAME='test/tc',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000f,
-+ ID=0x0000000000000010,
- N_COLS=0x80000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000002)
--header=0x00003815027a (NAME='test/td',
-+header=0x000038150287 (NAME='test/td',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000010,
-+ ID=0x0000000000000011,
- N_COLS=0x80000001,
- TYPE=0x00000021,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000003)
--header=0x00004815016a (NAME='test/tp',
-+header=0x00004815008d (NAME='test/tp',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000012,
-+ ID=0x0000000000000013,
- N_COLS=0x80000001,
- TYPE=0x000009a1,
- MIX_ID=0x0000000000000000,
- MIX_LEN=0x00000050,
- CLUSTER_NAME=NULL(0 bytes),
- SPACE=0x00000005)
--header=0x000028150236 (NAME='test/tr',
-+header=0x000010150243 (NAME='test/tr',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x000000000000000e,
-+ ID=0x000000000000000f,
- N_COLS=0x00000001,
- TYPE=0x00000001,
- MIX_ID=0x0000000000000000,
-@@ -85,7 +85,7 @@
- header=0x000040150074 (NAME='test/tz',
- DB_TRX_ID=0x000000000000,
- DB_ROLL_PTR=0x80000000000000,
-- ID=0x0000000000000011,
-+ ID=0x0000000000000012,
- N_COLS=0x80000001,
- TYPE=0x00000023,
- MIX_ID=0x0000000000000000,
diff --git a/mysql-test/suite/sql_sequence/default.result b/mysql-test/suite/sql_sequence/default.result
index 14abc656423..4969e832652 100644
--- a/mysql-test/suite/sql_sequence/default.result
+++ b/mysql-test/suite/sql_sequence/default.result
@@ -183,3 +183,13 @@ ALTER TABLE t1 add column d int default next value for s_not_exits;
ERROR 42S02: Table 'test.s_not_exits' doesn't exist
drop table t1;
drop sequence s1;
+#
+# MDEV 22785 Crash with prepared statements and NEXTVAL()
+#
+CREATE SEQUENCE s;
+CREATE TABLE t1 (id int NOT NULL DEFAULT NEXTVAL(s), PRIMARY KEY (id));
+PREPARE stmt FROM " INSERT INTO t1 () values ()";
+INSERT INTO t1 () values ();
+EXECUTE stmt;
+DROP TABLE t1;
+DROP SEQUENCE s;
diff --git a/mysql-test/suite/sql_sequence/default.test b/mysql-test/suite/sql_sequence/default.test
index 017165c1a80..e7c13211013 100644
--- a/mysql-test/suite/sql_sequence/default.test
+++ b/mysql-test/suite/sql_sequence/default.test
@@ -123,3 +123,15 @@ ALTER TABLE t1 add column c int;
ALTER TABLE t1 add column d int default next value for s_not_exits;
drop table t1;
drop sequence s1;
+
+--echo #
+--echo # MDEV 22785 Crash with prepared statements and NEXTVAL()
+--echo #
+CREATE SEQUENCE s;
+CREATE TABLE t1 (id int NOT NULL DEFAULT NEXTVAL(s), PRIMARY KEY (id));
+PREPARE stmt FROM " INSERT INTO t1 () values ()";
+INSERT INTO t1 () values ();
+EXECUTE stmt;
+# Cleanup
+DROP TABLE t1;
+DROP SEQUENCE s;