Skip to content

opt: internal error: inconsistent Case return types #138896

Open
@yuzefovich

Description

@yuzefovich

We have several reproductions for this internal error:

#125115
CREATE FUNCTION a() RETURNS RECORD LANGUAGE SQL AS $$ SELECT ('\x00'::BYTES,) $$;
CREATE FUNCTION b() RETURNS RECORD LANGUAGE SQL AS $$ SELECT B'00', 1 $$;
SELECT CASE WHEN false THEN a() ELSE b() END;
#130813
CREATE TABLE v00 (v01 STRING);
UPSERT INTO v00 ( v01 ) ( SELECT 'random_str' ) RETURNING CASE WHEN NULL THEN IFERROR ( NULL, 0 ) END;
#138890
CREATE TABLE t0 (c0 BOOL);
WITH temp_table(c0)  AS ((VALUES (NULL))) SELECT t0.c0 FROM t0 FULL OUTER MERGE JOIN temp_table ON false WHERE NULLIF((temp_table.c0) IN (true), (true));

Jira issue: CRDB-46409

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sql-optimizerSQL logical planning and optimizations.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.P-3Issues/test failures with no fix SLAT-sql-queriesSQL Queries Teambranch-release-23.1Used to mark GA and release blockers, technical advisories, and bugs for 23.1branch-release-23.2Used to mark GA and release blockers, technical advisories, and bugs for 23.2branch-release-24.1Used to mark GA and release blockers, technical advisories, and bugs for 24.1branch-release-24.2Used to mark GA and release blockers, technical advisories, and bugs for 24.2branch-release-24.3Used to mark GA and release blockers, technical advisories, and bugs for 24.3

    Type

    No type

    Projects

    Status

    Bugs to Fix

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions