Skip to content

Data type unknown error with CASE expression [CORE1821] #2251

Open
@firebird-automations

Description

@firebird-automations

Submitted by: Timo Partanen (partim)

Attachments:
callstack.txt

Preparing this query raises an error in Firebird 2.1 RC1:

UPDATE UserGroup SET
ACL = CASE WHEN ID IN ( 1, 2 ) THEN ? ELSE ? END

Prepare SQL statement failed.
SQL error code = -804
Data type unknown (0x80040E14)

Both of the parameters are BLOBs.

I will attach the call stack of the code place in Firebird where the exception is raised.

Comments by Adriano dos Santos Fernandes:

"No. And the problem has nothing to do with blobs.

This is a problem in the way data type of parameters are resolved. It
can't determine the parameters inside the case based on the ACL field.

The workaround is: SET ACL = CASE WHEN ID IN ( 1, 2 ) THEN CAST(? AS
BLOB) ELSE ? END.

Please register this on the tracker."

According to him, the problem appears with FB 2.1 RC2, too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions