Skip to content

COALESCE: returns int|null even if one argument is not nullable #460

@glaubinix

Description

@glaubinix

I am not quite sure if or how this is fixable but if COALESCE is called with multiple arguments and one of them is not nullable then the value should also not be nullable.

Example:

Table:

CREATE TABLE ak (
    akid int NOT NULL DEFAULT 0,
    eladaid int DEFAULT NULL,
    eadavk decimal(12,2) NOT NULL
);

Query:

SELECT COALESCE(eladaid, akid) as id FROM ak

I would expect that the value for id is always int

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions