1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

fix a copy-paste error

LEX_CSTRING table_name= { table->s->db.str, table->s->table_name.length };

and misc cleanups
This commit is contained in:
Sergei Golubchik
2022-02-03 12:34:34 +01:00
parent e4d7886cc5
commit a450d58ad0
3 changed files with 50 additions and 124 deletions

View File

@ -1,4 +1,3 @@
DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp;
#
# Bug#11894100: EXCHANGE PARTITION CAN'T BE EXECUTED IF
# ROW_FORMAT WAS SET EXPLICITLY
@ -6,25 +5,19 @@ DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp;
# Same definition (both have ROW_FORMAT set)
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT=COMPACT
PARTITION BY HASH (id)
PARTITIONS 2;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 LIKE t1;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t2 REMOVE PARTITIONING;
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -34,7 +27,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -53,15 +46,11 @@ ENGINE InnoDB
ROW_FORMAT Compact
CREATE_OPTIONS row_format=COMPACT
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -71,7 +60,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -93,24 +82,16 @@ DROP TABLE t2;
# Only the partitioned table have ROW_FORMAT set.
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -120,7 +101,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -142,36 +123,24 @@ CREATE_OPTIONS
DROP TABLE t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB
PARTITION BY HASH (id)
PARTITIONS 2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT = COMPACT;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -181,7 +150,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -203,36 +172,24 @@ CREATE_OPTIONS row_format=COMPACT
DROP TABLE t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB
PARTITION BY HASH (id)
PARTITIONS 2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -242,7 +199,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -264,36 +221,24 @@ CREATE_OPTIONS
DROP TABLE t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT = REDUNDANT
PARTITION BY HASH (id)
PARTITIONS 2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT = REDUNDANT;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
@ -303,7 +248,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
@ -325,33 +270,25 @@ CREATE_OPTIONS row_format=REDUNDANT
DROP TABLE t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB
PARTITION BY HASH (id)
PARTITIONS 2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT = REDUNDANT;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
ERROR HY000: Non matching attribute 'ROW_FORMAT' between partition and table
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
@ -361,7 +298,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
@ -383,33 +320,25 @@ CREATE_OPTIONS row_format=REDUNDANT
DROP TABLE t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT = COMPACT
PARTITION BY HASH (id)
PARTITIONS 2;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
year year(2) DEFAULT NULL,
year year DEFAULT NULL,
modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (id)
) ENGINE=InnoDB ROW_FORMAT = REDUNDANT;
Warnings:
Level Note
Code 1287
Message 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2;
ERROR HY000: Non matching attribute 'ROW_FORMAT' between partition and table
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
@ -419,7 +348,7 @@ SHOW CREATE TABLE t2;
Table t2
Create Table CREATE TABLE `t2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`year` year(2) DEFAULT NULL,
`year` year(4) DEFAULT NULL,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
@ -1307,3 +1236,6 @@ CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
DROP TABLE t1, t2;
#
# End of 10.3 tests
#