DDC-2268: Lexer error using string functions inside CASE WHEN #2851

Closed
opened 2026-01-22 14:05:45 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 2, 2013).

Jira issue originally created by user vecchia:

When using the CASE WHEN expression in DQL a Lexer error is thrown if the THEN condition uses a FunctionsReturningStrings function. For example, the following query is valid in SQL:

sqlSELECT t.*, CASE WHEN LENGTH(t.myfield) <> 0 THEN CONCAT(t.myfield, t.myfield2) ELSE t.myfield2 END as mycasefield FROM mytable AS t

However, if the CONCAT function is used in DQL the exception is raised.

Originally created by @doctrinebot on GitHub (Feb 2, 2013). Jira issue originally created by user vecchia: When using the CASE WHEN expression in DQL a Lexer error is thrown if the THEN condition uses a FunctionsReturningStrings function. For example, the following query is valid in SQL: `sqlSELECT t.*, CASE WHEN LENGTH(t.myfield) <> 0 THEN CONCAT(t.myfield, t.myfield2) ELSE t.myfield2 END as mycasefield FROM mytable AS t` However, if the CONCAT function is used in DQL the exception is raised.
admin added the Bug label 2026-01-22 14:05:45 +01:00
admin closed this issue 2026-01-22 14:05:46 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 2, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Feb 2, 2013): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Feb 2, 2013):

Comment created by @FabioBatSilva:

1627fc9596

@doctrinebot commented on GitHub (Feb 2, 2013): Comment created by @FabioBatSilva: https://github.com/doctrine/doctrine2/commit/1627fc95965a3e2e3894fcf7e524eb0eaa9d0ddd
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2851