1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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.
This commit is contained in:
Sergey Petrunya
2012-01-08 14:43:14 +04:00
parent cd55894a52
commit 0b590282fc
5 changed files with 84 additions and 1 deletions

View File

@ -2152,4 +2152,21 @@ c c
set optimizer_prune_level= @opl_901399;
set optimizer_switch= @os_091399;
DROP TABLE t1,t2;
#
# BUG#912510: Crash in do_copy_not_null with semijoin=ON, firstmatch=ON, aggregate ...
#
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
);
a COUNT(*)
NULL 0
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect_sj_tmp;

View File

@ -2166,6 +2166,23 @@ c c
set optimizer_prune_level= @opl_901399;
set optimizer_switch= @os_091399;
DROP TABLE t1,t2;
#
# BUG#912510: Crash in do_copy_not_null with semijoin=ON, firstmatch=ON, aggregate ...
#
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
);
a COUNT(*)
NULL 0
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off

View File

@ -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;