summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-01-26 14:41:23 +0300
committerAleksey Midenkov <midenok@gmail.com>2021-01-26 14:41:23 +0300
commit1398160a719394cff3e7e4ee214f51375e8825a1 (patch)
tree11d28abdeeac8c0d29ae21cdf49181b9624b1045 /mysql-test/suite
parente626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (diff)
downloadmariadb-git-1398160a719394cff3e7e4ee214f51375e8825a1.tar.gz
MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
Cause: no table->update_handler cloned at the moment of vers_insert_history_row(). update_handler is needed because there can't be several inited indexes at once in the same handler. First index is inited by QUICK_RANGE_SELECT::reset(). Then when history row is inserted check_duplicate_long_entry_key() is done and it requires another index.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/versioning/r/update.result16
-rw-r--r--mysql-test/suite/versioning/t/update.test24
2 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index fbb9f541b06..da893432749 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -399,3 +399,19 @@ a check_row(row_start, row_end)
1 HISTORICAL ROW
1 CURRENT ROW
drop tables t1, t2, t3;
+#
+# MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
+
+create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
+insert into t1 values (1, 1, 'foo'), (2, 11, 'bar');
+update t1 set a = 3 where b <= 9;
+update t1 set a = 3 where b <= 10;
+drop table t1;
+create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
+create table t2 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
+insert into t1 values (1, 1, 'foo'), (2, 11, 'bar');
+insert into t2 values (1, 1, 'foo'), (2, 11, 'bar');
+update t1 set a = 3 where b <= 9;
+update t2 set a = 3 where b <= 9;
+update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b;
+drop tables t1, t2;
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index 7f99e307942..47a56a71bd3 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -326,4 +326,28 @@ select *, check_row(row_start, row_end) from t2 for system_time all order by row
# cleanup
drop tables t1, t2, t3;
+--echo #
+--echo # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
+--echo
+create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
+insert into t1 values (1, 1, 'foo'), (2, 11, 'bar');
+
+update t1 set a = 3 where b <= 9;
+update t1 set a = 3 where b <= 10;
+
+# cleanup
+drop table t1;
+
+create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
+create table t2 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
+insert into t1 values (1, 1, 'foo'), (2, 11, 'bar');
+insert into t2 values (1, 1, 'foo'), (2, 11, 'bar');
+
+update t1 set a = 3 where b <= 9;
+update t2 set a = 3 where b <= 9;
+update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b;
+
+# cleanup
+drop tables t1, t2;
+
source suite/versioning/common_finish.inc;