summaryrefslogtreecommitdiff
path: root/mysql-test/suite/versioning/r/update.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/versioning/r/update.result')
-rw-r--r--mysql-test/suite/versioning/r/update.result49
1 files changed, 49 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index cd26c341113..fbb9f541b06 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -241,6 +241,26 @@ B2 salary
1 2500
drop table t1;
drop table t2;
+# Ensure FTS retains correct history
+create table t1 (
+x int, y text, fulltext (y),
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end))
+with system versioning engine innodb;
+insert into t1 values (1, repeat('LONG', 2048));
+update t1 set x= x + 1;
+select x, left(y, 4), length(y), check_row(row_start, row_end) from t1 for system_time all order by x, y;
+x left(y, 4) length(y) check_row(row_start, row_end)
+1 LONG 8192 HISTORICAL ROW
+2 LONG 8192 CURRENT ROW
+update t1 set y= 'SHORT';
+select x, left(y, 4), length(y), check_row(row_start, row_end) from t1 for system_time all order by x, y;
+x left(y, 4) length(y) check_row(row_start, row_end)
+1 LONG 8192 HISTORICAL ROW
+2 LONG 8192 HISTORICAL ROW
+2 SHOR 5 CURRENT ROW
+drop tables t1;
### Issue tempesta-tech/mariadb#365, bug 7 (duplicate of historical row)
create or replace table t1 (a int primary key, b int)
with system versioning engine myisam;
@@ -350,3 +370,32 @@ insert into t1 (a) values (1), (2);
update ignore t1 set a= 3;
delete history from t1;
drop table t1;
+#
+# MDEV-23446 UPDATE does not insert history row if the row is not changed
+#
+create table t1 (
+a int,
+row_start SYS_DATATYPE as row start invisible,
+row_end SYS_DATATYPE as row end invisible,
+period for system_time (row_start, row_end)) with system versioning;
+insert into t1 values (1);
+update t1 set a= 1;
+select *, check_row(row_start, row_end) from t1 for system_time all order by row_end;
+a check_row(row_start, row_end)
+1 HISTORICAL ROW
+1 CURRENT ROW
+# multi-update
+create or replace table t2 like t1;
+create or replace table t3 like t1;
+insert into t2 values (1);
+insert into t3 values (1);
+update t2, t3 set t2.a= 1, t3.a= 1 where t2.a = t3.a;
+select *, check_row(row_start, row_end) from t2 for system_time all order by row_end;
+a check_row(row_start, row_end)
+1 HISTORICAL ROW
+1 CURRENT ROW
+select *, check_row(row_start, row_end) from t2 for system_time all order by row_end;
+a check_row(row_start, row_end)
+1 HISTORICAL ROW
+1 CURRENT ROW
+drop tables t1, t2, t3;