Skip to content

Cannot parse CASE statements #961

@naumaan123

Description

@naumaan123

Jsqlparser failing when a sql CASE statement is involved

I have posted similar bugs for otehr keywords
To Reproduce
Steps to reproduce the behavior:
SELECT OrderID, Quantity,
CASE
WHEN Quantity > 30 THEN
WHEN Quantity = 30 THEN
ELSE
END AS QuantityText
FROM OrderDetails;

Exception:

net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "CASE" "CASE"
at line 7, column 67.

Was expecting one of:

"!"
"("
"NOT"

Expected behavior
CASE should be parsed correctly

System

  • Mysql 5.7
  • Java 8
  • JSqlParser version 3.2-SNAPSHOT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions