summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_sj.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-01-08 14:43:14 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-01-08 14:43:14 +0400
commit0b590282fc116a1911eabe4cf1c7804a66f9bb48 (patch)
treed16ebbfaa4bad9cb8412cfbd4220f5a685126253 /mysql-test/t/subselect_sj.test
parentcd55894a52b5b2bf4a740eb0f39d91d7a82f673c (diff)
downloadmariadb-git-0b590282fc116a1911eabe4cf1c7804a66f9bb48.tar.gz
BUG#912510: Crash in do_copy_not_null with semijoin=ON, firstmatch=ON, aggregate ...
- Create/use do_copy_nullable_row_to_notnull() function for ref access, which is used when copying from not-NULL field in table that can be NULL-complemented to not-NULL field.
Diffstat (limited to 'mysql-test/t/subselect_sj.test')
-rw-r--r--mysql-test/t/subselect_sj.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test
index aee61e9bca3..f34cf5ba338 100644
--- a/mysql-test/t/subselect_sj.test
+++ b/mysql-test/t/subselect_sj.test
@@ -1997,6 +1997,25 @@ set optimizer_switch= @os_091399;
DROP TABLE t1,t2;
+--echo #
+--echo # BUG#912510: Crash in do_copy_not_null with semijoin=ON, firstmatch=ON, aggregate ...
+--echo #
+CREATE TABLE t1 ( a VARCHAR(1) NOT NULL );
+INSERT INTO t1 VALUES ('k'),('l');
+
+CREATE TABLE t2 ( b VARCHAR(1) NOT NULL, KEY(b) );
+INSERT INTO t2 VALUES ('k'),('l');
+
+CREATE TABLE t3 ( c VARCHAR(1) NOT NULL, KEY(c) );
+INSERT INTO t3 VALUES ('m'),('n');
+
+SELECT a, COUNT(*) FROM t1
+ WHERE a IN (
+ SELECT b FROM t2 force index(b), t3 force index(c)
+ WHERE c = b AND b = a
+ );
+
+DROP TABLE t1, t2, t3;
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;