Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 12.3.3
Description
SELECT
|
HEX(CAST(ABS(b'101010') AS BINARY)) AS direct, |
(
|
SELECT x |
FROM ( |
SELECT HEX(CAST(ABS(b'101010') AS BINARY)) AS x |
) q
|
) AS derived; |
 |
+--------+---------+ |
| direct | derived |
|
+--------+---------+ |
| 3432 | 34 |
|
+--------+---------+ |
1 row in set (0.001 sec) |
The same deterministic expression returns different results depending on whether it is evaluated directly or through a derived table.
HEX(CAST(ABS(b'101010') AS BINARY)) evaluates to 3432 directly, but the same expression is truncated to 34 when passed through a derived table.
This appears to be a wrong-result issue caused by incorrect expression length/type metadata propagation in the derived-table path.