Details
-
Type:
Bug
-
Status: In Review
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 10.0.17
-
Fix Version/s: 10.1
-
Component/s: Dynamic Columns
-
Environment:Linux
-
Sprint:10.1.8-3, 10.1.8-4
Description
SET @aaa = COLUMN_CREATE('price', '');
SELECT COLUMN_GET(@aaa, 'price' AS DECIMAL) aaa;
aaa -------- 0
SELECT COLUMN_GET(@aaa, 'price' AS DECIMAL) + 1 aaa
aaa -------- 1
DELIMITER $$
CREATE FUNCTION `test`(
par_aaa DECIMAL(10,2)
)
RETURNS DECIMAL(10,2)
DETERMINISTIC
BEGIN
RETURN 0;
END$$
DELIMITER ;
SELECT test(COLUMN_GET(@aaa, 'price' AS DECIMAL)) bbb
Error CODE: 1918 Encountered illegal VALUE '' WHEN converting TO DECIMAL
SELECT test('') bbb
Error CODE: 1366 Incorrect DECIMAL VALUE: '' FOR COLUMN 'par_aaa' AT ROW 441
SELECT test(CAST('' AS DECIMAL(10,2))) bbb
Error CODE: 1292 Truncated incorrect DECIMAL VALUE: ''
SELECT test(''+0) bbb
bbb -------- 0.00
More expected that result '' + 0 and CAST('' AS DECIMAL(10,2)) would be same.
But we saw error when do CAST, and automatic convertion '' as 0 when try select or make math operation.
SELECT @@sql_mode
NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Gliffy Diagrams
Attachments
Issue Links
- is blocked by
-
MDEV-8300 CAST('' AS DECIMAL) is too strict on INSERT in strict mode
-
- Closed
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
I am prefer that COLUMN_GET(@aaa, 'price' AS DECIMAL) considered all illegal decimal as 0