summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2018-06-21 16:46:11 +1000
committerSergei Golubchik <serg@mariadb.org>2018-09-21 15:05:54 +0200
commitc16a54c02e1882a07f48e58e788674e9ed3be129 (patch)
tree4a8f6591189403299ffd24a7bbdee7e3c038fad9 /mysql-test/main
parent8893d199efae16c8072cdbbe35c808a12d0583e5 (diff)
downloadmariadb-git-c16a54c02e1882a07f48e58e788674e9ed3be129.tar.gz
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
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/partition_error.result9
-rw-r--r--mysql-test/main/partition_error.test18
2 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/main/partition_error.result b/mysql-test/main/partition_error.result
index 349e9771367..868eb3b0924 100644
--- a/mysql-test/main/partition_error.result
+++ b/mysql-test/main/partition_error.result
@@ -1866,3 +1866,12 @@ pUpTo10 p-10sp1 This is a long comment (2050 ascii characters) 50 pUpTo10 part
pMax pMaxsp0 This is a long comment (2050 ascii characters) 50 pMax partition comment .80-!
pMax pMaxsp1 This is a long comment (2050 ascii characters) 50 pMax partition comment .80-!
DROP TABLE t1;
+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');
+UPDATE t1 SET v = 'qux' WHERE pk = 2;
+ERROR HY000: The value specified for generated column 'v' in table 't1' ignored
+DROP TABLE t1;
diff --git a/mysql-test/main/partition_error.test b/mysql-test/main/partition_error.test
index 3ee54605c36..8739c93fe92 100644
--- a/mysql-test/main/partition_error.test
+++ b/mysql-test/main/partition_error.test
@@ -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;