Lukas Eder created DERBY-7139:
---------------------------------

             Summary: 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


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)

Reply via email to