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:
build()
SELECT CASE 'case' ELSE a.kol AS `END` END FROM foo AS `a`
The errors array contains these errors:
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.
Thank you for reporting this bug
Still confirmed today on 5.2.2-dev
Can confirm that this bug is still happening in 6.0.0.
I made a pull request with my attempt to fix it
Activity
williamdes commentedon Dec 21, 2024
Thank you for reporting this bug
Still confirmed today on 5.2.2-dev
SharpDerek commentedon Apr 22, 2026
Can confirm that this bug is still happening in 6.0.0.
I made a pull request with my attempt to fix it