Warning - Encountered illegal value '' when converting to DECIMAL
Thank you for mariadb.
A colleague noticed mariadb warning in a case where MySQL did not. I am wondering if the behaviour is expected, and because the reproducer test case required a table with over a certain number of rows I am wondering if it is a bug.
Tested with revision 3533 of mariadb 5.3.8 from today from:
http://
from:
http://
and mariadb 5.3.6, both issue the warning while MySQL 5.1.48 and 5.1.63 do not.
The same result table is produced, it is just the warning that is the difference. Thanks.
# MTR test case:
--disable_query_log
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 ( f1 int(10) unsigned NOT NULL, f2 decimal(20,6) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--enable_warnings
# 11000 yes
# 10999 no
let $i= 11000;
while ($i)
{
eval INSERT INTO t1 values($i,$i);
dec $i;
}
INSERT INTO t1 values(11001,NULL);
INSERT INTO t1 values(11001,NULL);
--enable_query_log
CREATE TABLE t2 SELECT MIN(f2), ROUND(AVG(f2),6), SUM(f2) FROM t1 GROUP BY f1;
SELECT @@warning_count;
SHOW WARNINGS;
# Causes warning: "Error 1918 Encountered illegal value '' when converting to DECIMAL"
--disable_query_log
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings
exit;
# End of MTR test case
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- MariaDB Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Peter (Stig) Edwards for more information if necessary.