Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited5d55d

Browse files
committed
Fix a bug in the original implementation of redundant-join-clause removal:
clauses in which one side or the other references both sides of the joincannot be removed as redundant, because that expression won't have beenconstrained below the join. Per report from Sergey Burladyan.CVS HEAD does not contain this bug due to EquivalenceClass rewrite, but itseems wise to include the regression test for it anyway.
1 parentbc421c3 commited5d55d

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

‎src/test/regress/expected/join.out

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,3 +2250,19 @@ WHERE d.f1 IS NULL;
22502250
9999
22512251
(3 rows)
22522252

2253+
--
2254+
-- regression test for problems of the sort depicted in bug #3494
2255+
--
2256+
create temp table tt5(f1 int, f2 int);
2257+
create temp table tt6(f1 int, f2 int);
2258+
insert into tt5 values(1, 10);
2259+
insert into tt5 values(1, 11);
2260+
insert into tt6 values(1, 9);
2261+
insert into tt6 values(1, 2);
2262+
insert into tt6 values(2, 9);
2263+
select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
2264+
f1 | f2 | f1 | f2
2265+
----+----+----+----
2266+
1 | 10 | 1 | 9
2267+
(1 row)
2268+

‎src/test/regress/expected/join_1.out

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,3 +2250,19 @@ WHERE d.f1 IS NULL;
22502250
9999
22512251
(3 rows)
22522252

2253+
--
2254+
-- regression test for problems of the sort depicted in bug #3494
2255+
--
2256+
create temp table tt5(f1 int, f2 int);
2257+
create temp table tt6(f1 int, f2 int);
2258+
insert into tt5 values(1, 10);
2259+
insert into tt5 values(1, 11);
2260+
insert into tt6 values(1, 9);
2261+
insert into tt6 values(1, 2);
2262+
insert into tt6 values(2, 9);
2263+
select * from tt5,tt6 where tt5.f1 = tt6.f1 and tt5.f1 = tt5.f2 - tt6.f2;
2264+
f1 | f2 | f1 | f2
2265+
----+----+----+----
2266+
1 | 10 | 1 | 9
2267+
(1 row)
2268+

‎src/test/regress/sql/join.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,19 @@ LEFT JOIN (
424424
WHEREc.f1 ISNULL
425425
)AS dON (a.f1=d.f1)
426426
WHEREd.f1 ISNULL;
427+
428+
--
429+
-- regression test for problems of the sort depicted in bug #3494
430+
--
431+
432+
create temp table tt5(f1int, f2int);
433+
create temp table tt6(f1int, f2int);
434+
435+
insert into tt5values(1,10);
436+
insert into tt5values(1,11);
437+
438+
insert into tt6values(1,9);
439+
insert into tt6values(1,2);
440+
insert into tt6values(2,9);
441+
442+
select*from tt5,tt6wherett5.f1=tt6.f1andtt5.f1=tt5.f2-tt6.f2;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp