mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-24387: Wrong number of decimal digits in certain UNION/Subqery
constellation Analysis: The decimals is set to NOT_FIXED_DEC for Field_str even if it is NULL. Unsigned has decimals=0. So Type_std_attributes::decimals is set to 39 (maximum between 0 and 39). This results in incorrect number of decimals when we have union of unsigned and NULL type. Fix: Check if the field is created from NULL value. If yes, set decimals to 0 otherwise set it to NOT_FIXED_DEC.
This commit is contained in:
@ -1855,6 +1855,24 @@ select * from t1 where a > 4;
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24387: Wrong number of decimal digits in certain UNION/Subqery
|
||||
--echo # constellation
|
||||
--echo #
|
||||
|
||||
--disable_ps_protocol
|
||||
--enable_metadata
|
||||
|
||||
SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT * from (SELECT NULL) t;
|
||||
SELECT CAST(1 AS SIGNED) UNION ALL SELECT * from (SELECT NULL) t;
|
||||
SELECT CAST(1 AS SIGNED) UNION ALL SELECT * from (SELECT CAST(1 AS UNSIGNED)) t;
|
||||
|
||||
SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT NULL;
|
||||
SELECT CAST(1 AS UNSIGNED) UNION ALL SELECT CAST(1 AS SIGNED);
|
||||
|
||||
--disable_metadata
|
||||
--enable_ps_protocol
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user