Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CASE with alias is not properly parsed #588

Open
Labels
@ghost

Description

Feeding this SQL to the Parser:

SELECT
 CASE 
 WHEN a.kol = 1 THEN 'one'
 ELSE a.kol
 END as 'case'
FROM foo a;

will result in errors, and calling build() on the statement will result in this SQL:

SELECT CASE 'case' ELSE a.kol AS `END` END FROM foo AS `a`

The errors array contains these errors:

  • An alias was previously found.
  • An alias was expected.
  • Unexpected keyword.
  • Unexpected end of CASE expression

I encountered this problem since I upgraded from 5.8.2 to 5.9.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /