You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Richard N. Hillegas (Jira)" <ji...@apache.org> on 2022/05/25 15:28:00 UTC
[jira] [Updated] (DERBY-7139) Boolean expressions cannot be passed to COALESCE function
[ https://issues.apache.org/jira/browse/DERBY-7139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Richard N. Hillegas updated DERBY-7139:
---------------------------------------
Bug behavior facts: Deviation from standard
Issue & fix info: Repro attached,Workaround attached
Urgency: Normal
> Boolean expressions cannot be passed to COALESCE function
> ---------------------------------------------------------
>
> Key: DERBY-7139
> URL: https://issues.apache.org/jira/browse/DERBY-7139
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.15.2.0
> Reporter: Lukas Eder
> Priority: Major
>
> While this parses just fine:
> {code}
> values(
> nullif(
> 1 = 0,
> exists(values(1))
> )
> );
> {code}
> This doesn't work:
> {code}
> values(
> coalesce(
> 1 = 0,
> exists(values(1))
> )
> );
> {code}
> Resulting in:
> bq. SQL Error [30000] [42X01]: Syntax error: Encountered "=" at line 3, column 7.
> The workaround is to wrap both arguments in parentheses
> {code}
> values(
> coalesce(
> (1 = 0),
> (exists(values(1)))
> )
> );
> {code}
> I don't think there's a good reason for this limitation, so I'm guessing it's a parser bug?
--
This message was sent by Atlassian Jira
(v8.20.7#820007)