summaryrefslogtreecommitdiff
path: root/mysql-test/suite/vcol
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-14 19:31:04 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-18 10:12:23 +0200
commit16b1cb650283593f565c53226f7481cacde17a30 (patch)
treecf31f36461ac15b5cf8fb8f34893cff04b3b743d /mysql-test/suite/vcol
parent4c6c352138d8370784f87118dc172c54a2a7a6ca (diff)
downloadmariadb-git-16b1cb650283593f565c53226f7481cacde17a30.tar.gz
MDEV-13623 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in virtual longlong Field_long::val_int
multi-update first runs a select to find affected rows, then performs a separate update step. On the second step WITH CHECK OPTION rows are read with rnd_read, but the first step might've been done with keyread. keyread over indexed virtual columns only reads the column's value, not dependent base columns. This is reflected in the read_set too. But on the rnd_read step base columns must be read - thus we need to update the read_set before doing updates.
Diffstat (limited to 'mysql-test/suite/vcol')
-rw-r--r--mysql-test/suite/vcol/r/update.result10
-rw-r--r--mysql-test/suite/vcol/t/update.test14
2 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/update.result b/mysql-test/suite/vcol/r/update.result
index 95b0093ed71..5c7905cf547 100644
--- a/mysql-test/suite/vcol/r/update.result
+++ b/mysql-test/suite/vcol/r/update.result
@@ -155,3 +155,13 @@ select * from t;
a b c d e
11 11 11 11 11
drop table t, t1, t2;
+create table t (f1 int, f2 int, f3 int as (f1*2) virtual, key(f3,f2));
+insert into t (f1,f2) values (1,1),(2,2);
+create view v as
+select a2.f1, a2.f2, a1.f3
+from t a1, t a2
+where a2.f3 <> 0
+with local check option;
+update v set f3 = 52;
+drop view v;
+drop table t;
diff --git a/mysql-test/suite/vcol/t/update.test b/mysql-test/suite/vcol/t/update.test
index 062d9736ed8..1797bdd501e 100644
--- a/mysql-test/suite/vcol/t/update.test
+++ b/mysql-test/suite/vcol/t/update.test
@@ -111,3 +111,17 @@ check table t; select * from t;
update t, t tt set t.b=11, tt.d=11 where t.a=tt.a;
check table t; select * from t;
drop table t, t1, t2;
+
+#
+# MDEV-13623 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in virtual longlong Field_long::val_int
+#
+create table t (f1 int, f2 int, f3 int as (f1*2) virtual, key(f3,f2));
+insert into t (f1,f2) values (1,1),(2,2);
+create view v as
+ select a2.f1, a2.f2, a1.f3
+ from t a1, t a2
+ where a2.f3 <> 0
+ with local check option;
+update v set f3 = 52;
+drop view v;
+drop table t;