Commit cca95478 authored by Monty's avatar Monty

Post fix for MDEV-32449

parent 1c554459
......@@ -3118,6 +3118,12 @@ t2 CREATE TABLE `t2` (
KEY `altcol1` (`altcol1`(2300))
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 ROW_FORMAT=PAGE
drop table t1,t2;
# Another test for MDEV-32449
CREATE TABLE t1 (a POINT, b POINT, KEY(a)) ENGINE=Aria;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t (b);
CREATE TEMPORARY TABLE t2 LIKE t1;
DROP TEMPORARY TABLE t2;
DROP TABLE t1;
#
# End of 10.6 tests
#
......@@ -2397,6 +2397,14 @@ show create table t1;
show create table t2;
drop table t1,t2;
--echo # Another test for MDEV-32449
CREATE TABLE t1 (a POINT, b POINT, KEY(a)) ENGINE=Aria;
ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t (b);
CREATE TEMPORARY TABLE t2 LIKE t1;
DROP TEMPORARY TABLE t2;
DROP TABLE t1;
--echo #
--echo # End of 10.6 tests
--echo #
......@@ -2898,10 +2898,11 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
key_iterator.rewind();
while ((key=key_iterator++))
{
if (key->type == Key::IGNORE_KEY && !create_info->tmp_table())
if (key->type == Key::IGNORE_KEY)
{
/* The key was replaced by another key */
if (alter_info->add_stat_drop_index(thd, &key->name))
if (!create_info->tmp_table() &&
alter_info->add_stat_drop_index(thd, &key->name))
DBUG_RETURN(true);
continue;
}
......
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