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:27:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17542091#comment-17542091 ]
Richard N. Hillegas commented on DERBY-7139:
--------------------------------------------
I am able to reproduce your results. I agree that this looks like a parser bug.
> 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)