1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-16429: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' fails upon attempt to update virtual column on partitioned versioned table

When using buffered sort in `UPDATE`, keyread is used. In this case,
`TABLE::update_virtual_field` should be aborted, but it actually isn't,
because it is called not with a top-level handler, but with the one that
is actually going to access the disk. Here the problemm is issued with
partitioning, so the solution is to recursively mark for keyread all the
underlying partition handlers.

* ha_partition: update keyread state for child partitions

Closes #800
This commit is contained in:
Nikita Malyavin
2018-06-21 16:46:11 +10:00
committed by Sergei Golubchik
parent 8893d199ef
commit c16a54c02e
5 changed files with 106 additions and 42 deletions

View File

@ -2074,3 +2074,21 @@ SELECT PARTITION_NAME, SUBPARTITION_NAME, PARTITION_COMMENT FROM INFORMATION_SCH
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
DROP TABLE t1;
#
# MDEV-16429
# Assertion `!table || (!table->read_set
# || bitmap_is_set(table->read_set, field_index))'
# fails upon attempt to update virtual column on partitioned versioned table
#
CREATE OR REPLACE TABLE t1 (
pk INT PRIMARY KEY,
c CHAR(3) NOT NULL,
v CHAR(4) AS (c) VIRTUAL
) WITH SYSTEM VERSIONING PARTITION BY HASH(pk);
INSERT INTO t1 (pk,c) VALUES (1,'foo'),(2,'bar');
-- error ER_WARNING_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN
UPDATE t1 SET v = 'qux' WHERE pk = 2;
DROP TABLE t1;