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

Reply via email to