mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge polly.(none):/home/kaa/src/opt/bug30666/my50-bug29131
into polly.(none):/home/kaa/src/opt/mysql-5.0-opt sql/sql_select.cc: Auto merged mysql-test/r/select.result: Manual merge. mysql-test/t/select.test: Manual merge.
This commit is contained in:
@ -4248,4 +4248,43 @@ str_to_date('1000-01-01','%Y-%m-%d') between NULL and '2000-00-00'
|
||||
select str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL;
|
||||
str_to_date('1000-01-01','%Y-%m-%d') between NULL and NULL
|
||||
0
|
||||
CREATE TABLE t1 (c11 INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY);
|
||||
CREATE TABLE t2 (c21 INT UNSIGNED NOT NULL,
|
||||
c22 INT DEFAULT NULL,
|
||||
KEY(c21, c22));
|
||||
CREATE TABLE t3 (c31 INT UNSIGNED NOT NULL DEFAULT 0,
|
||||
c32 INT DEFAULT NULL,
|
||||
c33 INT NOT NULL,
|
||||
c34 INT UNSIGNED DEFAULT 0,
|
||||
KEY (c33, c34, c32));
|
||||
INSERT INTO t1 values (),(),(),(),();
|
||||
INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
|
||||
INSERT INTO t3 VALUES (1, 1, 1, 0),
|
||||
(2, 2, 0, 0),
|
||||
(3, 3, 1, 0),
|
||||
(4, 4, 0, 0),
|
||||
(5, 5, 1, 0);
|
||||
SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND
|
||||
t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND
|
||||
t3.c33 = 1 AND t2.c22 in (1, 3)
|
||||
ORDER BY c32;
|
||||
c32
|
||||
1
|
||||
1
|
||||
3
|
||||
3
|
||||
5
|
||||
5
|
||||
SELECT c32 FROM t1, t2, t3 WHERE t1.c11 IN (1, 3, 5) AND
|
||||
t3.c31 = t1.c11 AND t2.c21 = t1.c11 AND
|
||||
t3.c33 = 1 AND t2.c22 in (1, 3)
|
||||
ORDER BY c32 DESC;
|
||||
c32
|
||||
5
|
||||
5
|
||||
3
|
||||
3
|
||||
1
|
||||
1
|
||||
DROP TABLE t1, t2, t3;
|
||||
End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user