Commit edbf1245 authored by Monty's avatar Monty

Ensure that auto_increment fields are marked properly on update

MDEV-19622 Assertion failures in
ha_partition::set_auto_increment_if_higher upon UPDATE on Aria
table
parent 6bc4444d
...@@ -861,6 +861,17 @@ SELECT * FROM t1; ...@@ -861,6 +861,17 @@ SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
} }
if (!$skip_update)
{
--echo #
--echo # MDEV-19622 Assertion failures in
--echo # ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
--echo #
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
}
--echo ############################################################################## --echo ##############################################################################
} }
...@@ -1101,4 +1101,12 @@ SELECT * FROM t1; ...@@ -1101,4 +1101,12 @@ SELECT * FROM t1;
a a
0 0
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
############################################################################## ##############################################################################
...@@ -1148,4 +1148,12 @@ SELECT * FROM t1; ...@@ -1148,4 +1148,12 @@ SELECT * FROM t1;
a a
0 0
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
############################################################################## ##############################################################################
...@@ -1129,4 +1129,12 @@ SELECT * FROM t1; ...@@ -1129,4 +1129,12 @@ SELECT * FROM t1;
a a
0 0
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
############################################################################## ##############################################################################
...@@ -1148,4 +1148,12 @@ SELECT * FROM t1; ...@@ -1148,4 +1148,12 @@ SELECT * FROM t1;
a a
0 0
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
############################################################################## ##############################################################################
...@@ -6470,6 +6470,12 @@ void TABLE::mark_columns_needed_for_update() ...@@ -6470,6 +6470,12 @@ void TABLE::mark_columns_needed_for_update()
} }
need_signal= true; need_signal= true;
} }
else
{
if (found_next_number_field)
mark_auto_increment_column();
}
if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE)
{ {
/* /*
......
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