From: | Chris Pascoe <chris(at)mansol(dot)net(dot)au> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Queries with multiple USINGs crash backend |
Date: | 2000-06-27 13:22:59 |
Message-ID: | Pine.LNX.4.21.0006272321340.14802-100000@celab21.pc.elec.uq.edu.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hello,
The following SQL demonstrates a crash in the backend. It occurs in both
the current Debian Linux 7.0.2 package, and in a separately compiled
version of the same.
--8<--
CREATE TABLE A
(
A INT4,
B INT4,
C INT4
);
CREATE TABLE B
(
A INT4,
B INT4,
C INT4
);
CREATE TABLE C
(
A INT4,
B INT4,
C INT4
);
/* The inserts are optional, but demonstrate that the first two queries
* produce correct results. */
INSERT INTO A VALUES (1,2,3);
INSERT INTO A VALUES (1,2,5);
INSERT INTO B VALUES (1,2,3);
INSERT INTO B VALUES (1,2,5);
INSERT INTO B VALUES (1,2,6);
INSERT INTO C VALUES (1,2,4);
/* This runs OK */
SELECT * FROM A,B,C WHERE A.A = B.A AND A.B = B.B AND A.C = B.C
AND B.A = C.A AND B.B = C.B;
/* As does this */
SELECT * FROM A JOIN B ON (A.A = B.A AND A.B = B.B AND A.C = B.C)
JOIN C ON (B.A = C.A AND B.B = C.B);
/*
* This makes the backend close the channel unexpectedly (die),
* but should be equivalent to the example using ON.
*/
SELECT * FROM A JOIN B USING (A,B,C) JOIN C USING (A,B);
--8<--
Regards,
Chris
From | Date | Subject | |
---|---|---|---|
Next Message | Alexei A.Romanenko | 2000-06-28 05:39:19 | |
Previous Message | Stephen van Egmond | 2000-06-26 16:21:46 | Bug report: selects rope in tables they shouldn't |