summaryrefslogtreecommitdiff
path: root/mysql-test/suite/vcol
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-07-19 22:41:24 -0700
committerIgor Babaev <igor@askmonty.org>2010-07-19 22:41:24 -0700
commit763e4c4dc00e6091a2ea4dffdfeccdbb254f3ecd (patch)
tree7992c400810d5884e5b87d1773d375aa5d4621e7 /mysql-test/suite/vcol
parent1ee37b4053679143b3ff9c8c2420349a4615af85 (diff)
downloadmariadb-git-763e4c4dc00e6091a2ea4dffdfeccdbb254f3ecd.tar.gz
Fixed bug #607566.
For queries with order by clauses that employed filesort usage of virtual column references in select lists could trigger assertion failures. It happened because a wrong vcol_set bitmap was used for filesort. It turned out that filesort required its own vcol_set bitmap. Made management of the vcol_set bitmaps similar to the management of the read_set and write_set bitmaps.
Diffstat (limited to 'mysql-test/suite/vcol')
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result10
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test15
2 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 8ee9f5a9f67..a0a036f1900 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -87,3 +87,13 @@ a v
2002-02-15 00:00:00 0
2000-10-15 00:00:00 1
DROP TABLE t1, t2;
+CREATE TABLE t1 (
+a char(255), b char(255), c char(255), d char(255),
+v char(255) AS (CONCAT(c,d) ) VIRTUAL
+);
+INSERT INTO t1(a,b,c,d) VALUES ('w','x','y','z'), ('W','X','Y','Z');
+SELECT v FROM t1 ORDER BY CONCAT(a,b);
+v
+yz
+YZ
+DROP TABLE t1;
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 87a870181b0..214b3dce612 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -87,3 +87,18 @@ INSERT INTO t2(a) VALUES ('2000-10-15');
SELECT * FROM t2;
DROP TABLE t1, t2;
+
+#
+# Bug#607566: Virtual column in the select list of SELECT with ORDER BY
+#
+
+CREATE TABLE t1 (
+ a char(255), b char(255), c char(255), d char(255),
+ v char(255) AS (CONCAT(c,d) ) VIRTUAL
+);
+
+INSERT INTO t1(a,b,c,d) VALUES ('w','x','y','z'), ('W','X','Y','Z');
+
+SELECT v FROM t1 ORDER BY CONCAT(a,b);
+
+DROP TABLE t1;