current_date function does not work with parentheses

Bug #1020325 reported by Padraig O'Sullivan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Akiban SQL Parser
Fix Released
Medium
Vy Nguyen

Bug Description

server revision: 1824

employees=> select current_date;
 _SQL_COL_1
------------
 2012-07-02
(1 row)

employees=> select current_date();
ERROR: Encountered " "(" "( "" at line 1, column 20.
Was expecting one of:
    <EOF>
    "and" ...
    "collate" ...
    "except" ...
    "fetch" ...
    "for" ...
    "from" ...
    "group" ...
    "having" ...
    "intersect" ...
    "is" ...
    "or" ...
    "order" ...
    "union" ...
    "where" ...
    "window" ...
    "with" ...
    "offset" ...
    "limit" ...
    "," ...
    ";" ...

LINE 1: select current_date();
                           ^
employees=>

Tags: compat mysql
Revision history for this message
Timothy Wegner (timmwegner) wrote :

Proserv does not believe this is an urgent requirement so have marked as moderate.

Changed in akiban-server:
importance: Undecided → Medium
milestone: none → 1.3.0
milestone: 1.3.0 → future
assignee: nobody → Vy Nguyen (oontvoo)
Revision history for this message
Vy Nguyen (oontvoo) wrote :

This is in the parser. Probably just adding '<RIGHT_PAREN><LEFT_PAREN>' after the node would fix this.

affects: akiban-server → akiban-sql-parser
Changed in akiban-sql-parser:
milestone: future → none
Revision history for this message
Mike McMahon (mmcm) wrote :

This is a MySQL compatibility issue. CURRENT_DATE is a special "column" in standard SQL.

Revision history for this message
Vy Nguyen (oontvoo) wrote :

Mike, so should I fix it? Maybe doing a LOOKAHEAD(mysqlParensFollow()) .... ?

Vy Nguyen (oontvoo)
tags: added: compat mysql
Vy Nguyen (oontvoo)
Changed in akiban-sql-parser:
status: New → Fix Committed
Revision history for this message
Vy Nguyen (oontvoo) wrote :

Note: The feature is disabled by default. To turn it on, use:
SET columnAsFunc TO 'true'

Changed in akiban-sql-parser:
status: Fix Committed → Fix Released
Changed in akiban-sql-parser:
milestone: none → 1.0.3
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.