General Bug Report: missing commas in IN( ) ignored; bracketing entries ignored - Mailing list pgsql-bugs

From Unprivileged user
Subject General Bug Report: missing commas in IN( ) ignored; bracketing entries ignored
Date
Msg-id 199904261434.KAA24872@hub.org
Whole thread Raw
List pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               : Diab Jerius
Your email address      : djerius@cfa.harvard.edu

Category                : runtime: front-end
Severity                : non-critical

Summary: missing commas in IN( ) ignored; bracketing entries ignored

System Configuration
--------------------
  Operating System   : Solaris 2.6

  PostgreSQL version : 6.4.2

  Compiler used      : Sunpro cc

Hardware:
---------


Versions of other tools:
------------------------
gmake 3.71
flex 2.5.4

--------------------------------------------------------------------------

Problem Description:
--------------------
In psql, if a list of entries in an IN ( ) statement is
split across several lines, missing commas are not flagged as errors,
but the entries immediately before and after the missing comma
are ignored

--------------------------------------------------------------------------

Test Case:
----------
The following sql shows the problem.  Note the missing comma between
the 'c' and 'd' lines in the IN( ) clause.  The query
should return no rows.

drop table test;

create table test ( s text );

insert into test values ( 'a' );
insert into test values ( 'b' );
insert into test values ( 'c' );
insert into test values ( 'd' );
insert into test values ( 'e' );



select
    s
from
    test
where
    s not in (
    'a',
    'b',
    'c'
    'd',
    'e'
    )
order by s
;


--------------------------------------------------------------------------

Solution:
---------


--------------------------------------------------------------------------


pgsql-bugs by date:

Previous
From: Unprivileged user
Date:
Subject: General Bug Report: Functions in SQL statements that use aggregations (i.e. group by) causes an abort in psql
Next
From: Unprivileged user
Date:
Subject: General Bug Report: obscure error when misusing table name as an attribute