mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix problems with joining UNION ALL sub-queries against other sub-queries that contain LEFT JOIN.
FossilOrigin-Name: d554f710a5abbe64022f47a14ef67227c861a8f0991d85d240434e9a709cf8b8
This commit is contained in:
@ -275,4 +275,12 @@ do_execsql_test 4.3 {
|
||||
123 t1_a 456 t3_a 123 123 123 123 123 123 123 123 123
|
||||
}
|
||||
|
||||
do_execsql_test 4.3 {
|
||||
SELECT * FROM (SELECT * FROM t1, t3) AS o, (
|
||||
SELECT * FROM t1 LEFT JOIN t3 ON a=k
|
||||
);
|
||||
} {
|
||||
123 t1_a 456 t3_a 123 t1_a {} {}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
39
test/unionall2.test
Normal file
39
test/unionall2.test
Normal file
@ -0,0 +1,39 @@
|
||||
# 2020-12-22
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is flattening UNION ALL sub-queries.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix unionall2
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TABLE t2(c, d);
|
||||
|
||||
CREATE VIEW v1 AS SELECT * FROM t1, t2;
|
||||
CREATE VIEW v2 AS SELECT * FROM t1, t2;
|
||||
|
||||
CREATE VIEW vA AS
|
||||
SELECT * FROM v1, (
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON (a=c)
|
||||
)
|
||||
UNION ALL
|
||||
SELECT * FROM v1, v2
|
||||
}
|
||||
|
||||
do_execsql_test 1.1 {
|
||||
SELECT 1 FROM vA, vA, vA, vA, vA, vA, vA, vA, vA, vA
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
Reference in New Issue
Block a user