Commit a450d58a authored by Sergei Golubchik's avatar Sergei Golubchik

fix a copy-paste error

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

and misc cleanups
parent e4d7886c
This diff is collapsed.
--source include/have_innodb.inc
--source include/have_partition.inc
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp;
--enable_warnings
--enable_prepare_warnings
--echo #
--echo # Bug#11894100: EXCHANGE PARTITION CAN'T BE EXECUTED IF
--echo # ROW_FORMAT WAS SET EXPLICITLY
......@@ -14,7 +9,7 @@ DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp;
--echo # 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
......@@ -46,7 +41,7 @@ DROP TABLE t2;
--echo # 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;
......@@ -63,7 +58,7 @@ ORDER BY TABLE_NAME;
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
......@@ -71,7 +66,7 @@ PARTITION BY HASH (id)
PARTITIONS 2;
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;
......@@ -88,7 +83,7 @@ ORDER BY TABLE_NAME;
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
......@@ -96,7 +91,7 @@ PARTITION BY HASH (id)
PARTITIONS 2;
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;
......@@ -113,7 +108,7 @@ ORDER BY TABLE_NAME;
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
......@@ -121,7 +116,7 @@ PARTITION BY HASH (id)
PARTITIONS 2;
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;
......@@ -138,7 +133,7 @@ ORDER BY TABLE_NAME;
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
......@@ -146,7 +141,7 @@ PARTITION BY HASH (id)
PARTITIONS 2;
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;
......@@ -164,7 +159,7 @@ ORDER BY TABLE_NAME;
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
......@@ -172,7 +167,7 @@ PARTITION BY HASH (id)
PARTITIONS 2;
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;
......@@ -537,4 +532,6 @@ ALTER TABLE t2 REMOVE PARTITIONING;
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
DROP TABLE t1, t2;
--disable_prepare_warnings
--echo #
--echo # End of 10.3 tests
--echo #
......@@ -7019,10 +7019,8 @@ static void update_altered_table(const Alter_inplace_info &ha_alter_info,
@retval false success
*/
bool mysql_compare_tables(TABLE *table,
Alter_info *alter_info,
HA_CREATE_INFO *create_info,
bool *metadata_equal)
bool mysql_compare_tables(TABLE *table, Alter_info *alter_info,
HA_CREATE_INFO *create_info, bool *metadata_equal)
{
DBUG_ENTER("mysql_compare_tables");
......@@ -7047,15 +7045,14 @@ bool mysql_compare_tables(TABLE *table,
Alter_info tmp_alter_info(*alter_info, thd->mem_root);
uint db_options= 0; /* not used */
KEY *key_info_buffer= NULL;
LEX_CSTRING db= { table->s->db.str, table->s->db.length };
LEX_CSTRING table_name= { table->s->db.str, table->s->table_name.length };
/* Create the prepared information. */
int create_table_mode= table->s->tmp_table == NO_TMP_TABLE ?
C_ORDINARY_CREATE : C_ALTER_TABLE;
if (mysql_prepare_create_table(thd, create_info, &tmp_alter_info,
&db_options, table->file, &key_info_buffer,
&key_count, create_table_mode, db, table_name))
&key_count, create_table_mode,
table->s->db, table->s->table_name))
DBUG_RETURN(1);
/* Some very basic checks. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment