OR not recognized in SELECT clause via Postgres

Bug #891364 reported by Tim Blackman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Akiban SQL Parser
Fix Released
High
Mike McMahon

Bug Description

Using the Postgres server to perform a SELECT that using the OR operator
in the select expression fails.

SQL:

  CREATE TABLE t (bigint_field bigint)
  SELECT bigint_field > 1 OR bigint_field < -1 FROM t

Result:

  org.postgresql.util.PSQLException: ERROR: [] com.akiban.sql.parser.ParseException: Encountered " "or" "OR "" at line 1, column 25.
Was expecting one of:
    "and" ...
    "from" ...
    "is" ...
    "*" ...
    "+" ...
    "," ...
    "-" ...
    "/" ...
    "||" ...
    : SELECT bigint_field > 1 OR bigint_field < -1 FROM t
 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:366)
 at com.akiban.sql.pg.YamlTester$StatementCommand.execute(YamlTester.java:436)

To reproduce:

  mvn test -Dtest=PostgresServerMiscYamlIT -Dcom.akiban.sql.pg.PostgresServerMiscYamlIT.CASE_NAME_REGEXP=bug-select-or

Reproduced in trunk revision 1244

Revision history for this message
Mike McMahon (mmcm) wrote :

The Derby parser implements a 90's vintage grammar that distinguishes conditions and expressions and does not have boolean as a full fledged type.

Ariel Weil (aweil)
affects: akiban-server → akiban-sql-parser
Changed in akiban-sql-parser:
status: New → Triaged
assignee: nobody → Mike McMahon (mmcm)
milestone: none → samba
Mike McMahon (mmcm)
Changed in akiban-sql-parser:
status: Triaged → Fix Released
information type: Private → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.