Skip to content

opt: internal error because optbuilder addCasts adds a tuple[] cast that we don't support #70831

@rafiss

Description

@rafiss

This is spun off to track a failure causing #70663 #70669 #70667 #70666 and #70670

The error internal error: no volatility for cast tuple[]::tuple{bool, unknown}[] is returned when running this query.

SELECT * FROM (VALUES (ARRAY[(true, NULL)])) AS v1
  EXCEPT ALL SELECT * FROM (VALUES (ARRAY[]::RECORD[])) AS v2;

Using bisect I found that the bug was introduced in 4037bd8 which made it into v21.1.0 and was also backported to v20.2 (#61086). This commit seems to modify addCasts in optbuilder/union.go in a way that causes it to add casts that we don't actually support.

cc @mgartner and @yuzefovich who were tagged on the above issues.

Metadata

Metadata

Assignees

Labels

C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-queriesSQL Queries Teambranch-masterFailures and bugs on the master branch.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions