Skip to content

Commit

Permalink
Rebaseline type related tests
Browse files Browse the repository at this point in the history
Summary:
Rebaseline type relate tests:

1. SHOW INDEX format changes
2. No more LSM_TREE in Index_type as the corresponding
3. More rows in EXPLAIN and rows column is now in column #10 (instead of #9) and there is another filtered column that needs to be masked
4. Using utf8 results warnings but I decided to keep the warning as a reminder in the future. TODO: we need to decide what to do with binary unpacking with regarding to utf8/utf8mb3/utf8mb4.
5. YEAR(2) is deprecated
6. GROUP BY now needs ORDER BY for ordered output
7. MySQL 8 no longer allows specifying NULL for PK so I'm adding a extra_pk_col_opts to the col_opt_*.tests to only specify supported flags for PK
8. Binary output are now hex instead of character (for example, 0 => 0x30)

Reviewed By: lloyd

Differential Revision: D17503619
  • Loading branch information
yizhang82 authored and inikep committed Jun 13, 2023
1 parent 127be2a commit f193d7d
Show file tree
Hide file tree
Showing 49 changed files with 681 additions and 639 deletions.
167 changes: 68 additions & 99 deletions mysql-test/suite/rocksdb/r/col_opt_not_null.result
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ c BINARY NOT NULL DEFAULT 0
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
c binary(1) NO 0
c binary(1) NO 0x30
ALTER TABLE t1 ADD COLUMN err BINARY NOT NULL DEFAULT NULL;
ERROR 42000: Invalid default value for 'err'
INSERT INTO t1 (c) VALUES (NULL);
Expand Down Expand Up @@ -209,7 +209,7 @@ c VARBINARY(64) NOT NULL DEFAULT 'test'
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
c varbinary(64) NO test
c varbinary(64) NO 0x74657374
ALTER TABLE t1 ADD COLUMN err VARBINARY(64) NOT NULL DEFAULT NULL;
ERROR 42000: Invalid default value for 'err'
INSERT INTO t1 (c) VALUES (NULL);
Expand Down Expand Up @@ -239,7 +239,7 @@ b bit(20) NO NULL
c bit(64) NO PRI NULL
d bit(1) NO NULL
ALTER TABLE t1 DROP COLUMN d;
ALTER TABLE t1 ADD COLUMN d BIT(0) NOT NULL;
ALTER TABLE t1 ADD COLUMN d BIT(1) NOT NULL;
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
a bit(1) NO NULL
Expand Down Expand Up @@ -399,7 +399,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c BLOB NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -439,7 +439,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c TINYBLOB NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -479,7 +479,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c MEDIUMBLOB NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -519,7 +519,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c LONGBLOB NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -768,7 +768,7 @@ v65000 varchar(65000) NO NULL
CREATE TABLE t2 (v VARCHAR(65532), PRIMARY KEY (v(255))) ENGINE=rocksdb;
SHOW COLUMNS IN t2;
Field Type Null Key Default Extra
v varchar(65532) NO PRI
v varchar(65532) NO PRI NULL
INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.

Expand Down Expand Up @@ -928,11 +928,8 @@ ts TIMESTAMP NOT NULL,
t TIME NOT NULL,
y YEAR NOT NULL,
y4 YEAR(4) NOT NULL,
y2 YEAR(2) NOT NULL,
pk DATETIME PRIMARY KEY
) ENGINE=rocksdb;
Warnings:
Warning 1818 YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
d date NO NULL
Expand All @@ -941,37 +938,35 @@ ts timestamp NO NULL
t time NO NULL
y year(4) NO NULL
y4 year(4) NO NULL
y2 year(4) NO NULL
pk datetime NO PRI NULL
SET @tm = '2012-04-09 05:27:00';
INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '00','2012-12-12 12:12:12'),
('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '99','2012-12-12 12:12:13'),
('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '0','2012-12-12 12:12:14'),
(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),YEAR(@tm),'2012-12-12 12:12:15');
SELECT d,dt,ts,t,y,y4,y2 FROM t1;
d dt ts t y y4 y2
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 2000
1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 2000
2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 2012
9999-12-31 9999-12-31 23:59:59 2038-01-19 06:14:07 838:59:59 2155 2155 1999
INSERT INTO t1 (d,dt,ts,t,y,y4,y2,pk) VALUES
('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '-1','2012-12-12 12:12:16');
INSERT INTO t1 (d,dt,ts,t,y,y4,pk) VALUES
('1000-01-01', '1000-01-01 00:00:00', FROM_UNIXTIME(1), '-838:59:59', '1901', '1901', '2012-12-12 12:12:12'),
('9999-12-31', '9999-12-31 23:59:59', FROM_UNIXTIME(2147483647), '838:59:59', '2155', '2155', '2012-12-12 12:12:13'),
('0000-00-00', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', '0', '0', '2012-12-12 12:12:14'),
(DATE(@tm),@tm,TIMESTAMP(@tm),TIME(@tm),YEAR(@tm),YEAR(@tm),'2012-12-12 12:12:15');
SELECT d,dt,ts,t,y,y4 FROM t1;
d dt ts t y y4
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000
1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901
2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012
9999-12-31 9999-12-31 23:59:59 2038-01-19 06:14:07 838:59:59 2155 2155
INSERT INTO t1 (d,dt,ts,t,y,y4,pk) VALUES
('999-13-32', '999-11-31 00:00:00', '0', '-839:00:00', '1900', '1900', '2012-12-12 12:12:16');
Warnings:
Warning 1265 Data truncated for column 'd' at row 1
Warning 1264 Out of range value for column 'dt' at row 1
Warning 1264 Out of range value for column 'ts' at row 1
Warning 1264 Out of range value for column 't' at row 1
Warning 1264 Out of range value for column 'y' at row 1
Warning 1264 Out of range value for column 'y4' at row 1
Warning 1264 Out of range value for column 'y2' at row 1
SELECT d,dt,ts,t,y,y4,y2 FROM t1;
d dt ts t y y4 y2
1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901 2000
9999-12-31 9999-12-31 23:59:59 2038-01-19 06:14:07 838:59:59 2155 2155 1999
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000 2000
2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012 2012
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000 0000
SELECT d,dt,ts,t,y,y4 FROM t1;
d dt ts t y y4
1000-01-01 1000-01-01 00:00:00 1970-01-01 03:00:01 -838:59:59 1901 1901
9999-12-31 9999-12-31 23:59:59 2038-01-19 06:14:07 838:59:59 2155 2155
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 00:00:00 2000 2000
2012-04-09 2012-04-09 05:27:00 2012-04-09 05:27:00 05:27:00 2012 2012
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 -838:59:59 0000 0000
DROP TABLE t1;
SET TIMESTAMP=UNIX_TIMESTAMP('2013-12-12 12:12:12');
DROP TABLE IF EXISTS t1;
Expand Down Expand Up @@ -1164,48 +1159,6 @@ pk HEX(c)
1 7DC
2 7DC
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
#----------------------------------
# YEAR(2) NOT NULL columns without a default
#----------------------------------
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, c YEAR(2) NOT NULL) ENGINE=rocksdb;
Warnings:
Warning 1818 YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
c year(4) NO NULL
INSERT INTO t1 (c) VALUES (NULL);
ERROR 23000: Column 'c' cannot be null
INSERT INTO t1 (c) VALUES ('12');
SELECT HEX(c) FROM t1;
HEX(c)
7DC
DROP TABLE t1;
#----------------------------------
# YEAR(2) NOT NULL columns with a default
#----------------------------------
CREATE TABLE t1 (
pk INT AUTO_INCREMENT PRIMARY KEY,
c YEAR(2) NOT NULL DEFAULT '12'
) ENGINE=rocksdb;
Warnings:
Warning 1818 YEAR(2) column type is deprecated. Creating YEAR(4) column instead.
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
c year(4) NO 2012
ALTER TABLE t1 ADD COLUMN err YEAR(2) NOT NULL DEFAULT NULL;
ERROR 42000: Invalid default value for 'err'
INSERT INTO t1 (c) VALUES (NULL);
ERROR 23000: Column 'c' cannot be null
INSERT INTO t1 (c) VALUES ('12');
INSERT INTO t1 () VALUES ();
SELECT pk, HEX(c) FROM t1 ORDER BY pk;
pk HEX(c)
1 7DC
2 7DC
DROP TABLE t1;
########################
# ENUM columns
########################
Expand Down Expand Up @@ -1422,9 +1375,9 @@ d d0 d1_1 d10_2 d60_10 n n0_0 n1 n20_4 n65_4
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
9999999999 9999999999 0.9 99999999.99 99999999999999999999999999999999999999999999999999.9999999999 9999999999 9999999999 9 9999999999999999.9999 9999999999999999999999999999999999999999999999999999999999999.9999
ALTER TABLE t1 ADD COLUMN n66 NUMERIC(66) NOT NULL;
ERROR 42000: Too big precision 66 specified for column 'n66'. Maximum is 65.
ERROR 42000: Too-big precision 66 specified for 'n66'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(66,6) NOT NULL;
ERROR 42000: Too big precision 66 specified for column 'n66_6'. Maximum is 65.
ERROR 42000: Too-big precision 66 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(66,66) NOT NULL;
ERROR 42000: Too big scale 66 specified for column 'n66_66'. Maximum is 30.
DROP TABLE t1;
Expand Down Expand Up @@ -1751,7 +1704,7 @@ INSERT INTO t1 (f,f0,r1_1,f23_0,f20_3,d,d1_0,d10_10,d53,d53_10,pk) VALUES (
6
);
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1292 Truncated incorrect DECIMAL value: '999999999999999999999999999999999999999999999999999999999999999999999999999999999'
Warning 1264 Out of range value for column 'f' at row 1
Warning 1264 Out of range value for column 'f0' at row 1
Warning 1264 Out of range value for column 'r1_1' at row 1
Expand Down Expand Up @@ -1825,7 +1778,7 @@ r1_1 0.9
ALTER TABLE t1 ADD COLUMN d0_0 DOUBLE(0,0) NOT NULL;
ERROR 42000: Display width out of range for column 'd0_0' (max = 255)
ALTER TABLE t1 ADD COLUMN n66_6 DECIMAL(256,1) NOT NULL;
ERROR 42000: Too big precision 256 specified for column 'n66_6'. Maximum is 65.
ERROR 42000: Too-big precision 256 specified for 'n66_6'. Maximum is 65.
ALTER TABLE t1 ADD COLUMN n66_66 DECIMAL(40,35) NOT NULL;
ERROR 42000: Too big scale 35 specified for column 'n66_66'. Maximum is 30.
DROP TABLE t1;
Expand Down Expand Up @@ -2039,6 +1992,38 @@ Warning 1264 Out of range value for column 'b1' at row 1
Warning 1264 Out of range value for column 'b20' at row 1
INSERT INTO t1 (i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20) SELECT b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b FROM t1 WHERE b IN (-9223372036854775808,9223372036854775807,18446744073709551615);
Warnings:
Warning 1264 Out of range value for column 'i' at row 6
Warning 1264 Out of range value for column 'i0' at row 6
Warning 1264 Out of range value for column 'i1' at row 6
Warning 1264 Out of range value for column 'i20' at row 6
Warning 1264 Out of range value for column 't' at row 6
Warning 1264 Out of range value for column 't0' at row 6
Warning 1264 Out of range value for column 't1' at row 6
Warning 1264 Out of range value for column 't20' at row 6
Warning 1264 Out of range value for column 's' at row 6
Warning 1264 Out of range value for column 's0' at row 6
Warning 1264 Out of range value for column 's1' at row 6
Warning 1264 Out of range value for column 's20' at row 6
Warning 1264 Out of range value for column 'm' at row 6
Warning 1264 Out of range value for column 'm0' at row 6
Warning 1264 Out of range value for column 'm1' at row 6
Warning 1264 Out of range value for column 'm20' at row 6
Warning 1264 Out of range value for column 'i' at row 7
Warning 1264 Out of range value for column 'i0' at row 7
Warning 1264 Out of range value for column 'i1' at row 7
Warning 1264 Out of range value for column 'i20' at row 7
Warning 1264 Out of range value for column 't' at row 7
Warning 1264 Out of range value for column 't0' at row 7
Warning 1264 Out of range value for column 't1' at row 7
Warning 1264 Out of range value for column 't20' at row 7
Warning 1264 Out of range value for column 's' at row 7
Warning 1264 Out of range value for column 's0' at row 7
Warning 1264 Out of range value for column 's1' at row 7
Warning 1264 Out of range value for column 's20' at row 7
Warning 1264 Out of range value for column 'm' at row 7
Warning 1264 Out of range value for column 'm0' at row 7
Warning 1264 Out of range value for column 'm1' at row 7
Warning 1264 Out of range value for column 'm20' at row 7
Warning 1264 Out of range value for column 'i' at row 8
Warning 1264 Out of range value for column 'i0' at row 8
Warning 1264 Out of range value for column 'i1' at row 8
Expand Down Expand Up @@ -2087,22 +2072,6 @@ Warning 1264 Out of range value for column 'm' at row 10
Warning 1264 Out of range value for column 'm0' at row 10
Warning 1264 Out of range value for column 'm1' at row 10
Warning 1264 Out of range value for column 'm20' at row 10
Warning 1264 Out of range value for column 'i' at row 11
Warning 1264 Out of range value for column 'i0' at row 11
Warning 1264 Out of range value for column 'i1' at row 11
Warning 1264 Out of range value for column 'i20' at row 11
Warning 1264 Out of range value for column 't' at row 11
Warning 1264 Out of range value for column 't0' at row 11
Warning 1264 Out of range value for column 't1' at row 11
Warning 1264 Out of range value for column 't20' at row 11
Warning 1264 Out of range value for column 's' at row 11
Warning 1264 Out of range value for column 's0' at row 11
Warning 1264 Out of range value for column 's1' at row 11
Warning 1264 Out of range value for column 's20' at row 11
Warning 1264 Out of range value for column 'm' at row 11
Warning 1264 Out of range value for column 'm0' at row 11
Warning 1264 Out of range value for column 'm1' at row 11
Warning 1264 Out of range value for column 'm20' at row 11
SELECT i,i0,i1,i20,t,t0,t1,t20,s,s0,s1,s20,m,m0,m1,m20,b,b0,b1,b20 FROM t1;
i i0 i1 i20 t t0 t1 t20 s s0 s1 s20 m m0 m1 m20 b b0 b1 b20
-2147483648 -2147483648 -2147483648 -2147483648 -128 -128 -128 -128 -32768 -32768 -32768 -32768 -8388608 -8388608 -8388608 -8388608 -9223372036854775808 -9223372036854775808 -9223372036854775808 -9223372036854775808
Expand Down Expand Up @@ -2484,7 +2453,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c TEXT NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -2524,7 +2493,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c TINYTEXT NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -2564,7 +2533,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c MEDIUMTEXT NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down Expand Up @@ -2604,7 +2573,7 @@ pk INT AUTO_INCREMENT PRIMARY KEY,
c LONGTEXT NOT NULL DEFAULT ''
) ENGINE=rocksdb;
Warnings:
Warning 1101 BLOB/TEXT column 'c' can't have a default value
Warning 1101 BLOB, TEXT, GEOMETRY or JSON column 'c' can't have a default value
SHOW COLUMNS IN t1;
Field Type Null Key Default Extra
pk int(11) NO PRI NULL auto_increment
Expand Down
Loading

0 comments on commit f193d7d

Please sign in to comment.