sql: improve type checking error messages with AnnotateTypeExpr of NULL #78335
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
T-sql-queries
SQL Queries Team
Projects
The expression
NULL:::T
(aNULL
value annotated as typeT
) can lead to confusing error messages. This is because when the expression is type-checked, atree.DNull
value is returned, which includes no information about the annotated type T - the resolved type oftree.DNull
is alwaystypes.Unknown
. An expression that contains an annotatedNULL
and fails type checking often has a confusing error message as a result.For example, notice that the error message below states "found type unknown", when "found type int" would make more sense:
Epic CRDB-2474
Jira issue: CRDB-14073
The text was updated successfully, but these errors were encountered: