commit d19f380d62c3145258c229d102b829c2f1c77223
Author: Alexander Barkov <bar@mariadb.com>
Date:   Tue Aug 18 13:19:21 2020 +0400

    MDEV-21445 Strange/inconsistent behavior of IN condition when mixing numbers and strings
    
    Comparison is now performed as DECIMAL for pairs (int,string) and (string,int).
    
    Before the patch the comparison was performed in DOUBLE format,
    so precision loss happened on huge values, e.g.:
    
      '97716021308405775' was converted to
       97716021308405770 (notice, the last digit was lost)

diff --git a/mysql-test/main/compare.result b/mysql-test/main/compare.result
index c4650014326..b8883784d21 100644
--- a/mysql-test/main/compare.result
+++ b/mysql-test/main/compare.result
@@ -47,11 +47,11 @@ insert into t1 values (0x01,0x01);
 select * from t1 where a=b;
 a	b
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '\x01'
+Warning	1292	Truncated incorrect DECIMAL value: '\x01'
 select * from t1 where a=b and b=0x01;
 a	b
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '\x01'
+Warning	1292	Truncated incorrect DECIMAL value: '\x01'
 drop table if exists t1;
 CREATE TABLE  t1 (b int(2) zerofill, c int(2) zerofill);
 INSERT INTO t1 (b,c) VALUES (1,2), (1,1), (2,2);
diff --git a/mysql-test/main/func_debug.result b/mysql-test/main/func_debug.result
index e2bf0ca8df3..bd2e1e5e85a 100644
--- a/mysql-test/main/func_debug.result
+++ b/mysql-test/main/func_debug.result
@@ -999,25 +999,25 @@ SELECT a IN (1,'1') FROM t1;
 a IN (1,'1')
 Warnings:
 Note	1105	DBUG: [0] arg=1 handler=0 (bigint)
-Note	1105	DBUG: [1] arg=2 handler=1 (double)
+Note	1105	DBUG: [1] arg=2 handler=1 (decimal)
 Note	1105	DBUG: types_compatible=no bisect=no
 SELECT a IN (1,'1',NULL) FROM t1;
 a IN (1,'1',NULL)
 Warnings:
 Note	1105	DBUG: [0] arg=1 handler=0 (bigint)
-Note	1105	DBUG: [1] arg=2 handler=1 (double)
+Note	1105	DBUG: [1] arg=2 handler=1 (decimal)
 Note	1105	DBUG: types_compatible=no bisect=no
 SELECT a NOT IN (1,'1') FROM t1;
 a NOT IN (1,'1')
 Warnings:
 Note	1105	DBUG: [0] arg=1 handler=0 (bigint)
-Note	1105	DBUG: [1] arg=2 handler=1 (double)
+Note	1105	DBUG: [1] arg=2 handler=1 (decimal)
 Note	1105	DBUG: types_compatible=no bisect=no
 SELECT a NOT IN (1,'1',NULL) FROM t1;
 a NOT IN (1,'1',NULL)
 Warnings:
 Note	1105	DBUG: [0] arg=1 handler=0 (bigint)
-Note	1105	DBUG: [1] arg=2 handler=1 (double)
+Note	1105	DBUG: [1] arg=2 handler=1 (decimal)
 Note	1105	DBUG: types_compatible=no bisect=no
 SELECT a IN (1,TIME'10:20:30') FROM t1;
 a IN (1,TIME'10:20:30')
diff --git a/mysql-test/main/func_if.result b/mysql-test/main/func_if.result
index 09eb85d9fb6..6a8e578767e 100644
--- a/mysql-test/main/func_if.result
+++ b/mysql-test/main/func_if.result
@@ -63,7 +63,7 @@ select nullif(1,'test');
 nullif(1,'test')
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'test'
+Warning	1292	Truncated incorrect DECIMAL value: 'test'
 select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
 NULLIF(NULL,NULL)	NULLIF(NULL,1)	NULLIF(NULL,1.0)	NULLIF(NULL,"test")
 NULL	NULL	NULL	NULL
diff --git a/mysql-test/main/func_in.result b/mysql-test/main/func_in.result
index 65313148bf8..cbf91456cee 100644
--- a/mysql-test/main/func_in.result
+++ b/mysql-test/main/func_in.result
@@ -539,9 +539,9 @@ f2
 0
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'a'
-Warning	1292	Truncated incorrect DOUBLE value: 'a'
-Warning	1292	Truncated incorrect DOUBLE value: 'a'
+Warning	1292	Truncated incorrect DECIMAL value: 'a'
+Warning	1292	Truncated incorrect DECIMAL value: 'a'
+Warning	1292	Truncated incorrect DECIMAL value: 'a'
 explain select f2 from t2 where f2 in ('a',2);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	index	t2f2	t2f2	5	NULL	3	Using where; Using index
@@ -549,21 +549,21 @@ select f2 from t2 where f2 in ('a','b');
 f2
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'a'
-Warning	1292	Truncated incorrect DOUBLE value: 'b'
+Warning	1292	Truncated incorrect DECIMAL value: 'a'
+Warning	1292	Truncated incorrect DECIMAL value: 'b'
 explain select f2 from t2 where f2 in ('a','b');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	index	t2f2	t2f2	5	NULL	3	Using where; Using index
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'a'
-Warning	1292	Truncated incorrect DOUBLE value: 'b'
+Warning	1292	Truncated incorrect DECIMAL value: 'a'
+Warning	1292	Truncated incorrect DECIMAL value: 'b'
 select f2 from t2 where f2 in (1,'b');
 f2
 0
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'b'
-Warning	1292	Truncated incorrect DOUBLE value: 'b'
+Warning	1292	Truncated incorrect DECIMAL value: 'b'
+Warning	1292	Truncated incorrect DECIMAL value: 'b'
 explain select f2 from t2 where f2 in (1,'b');
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	index	t2f2	t2f2	5	NULL	3	Using where; Using index
diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result
index bf8e25b4ee1..bda83c6ce9a 100644
--- a/mysql-test/main/func_math.result
+++ b/mysql-test/main/func_math.result
@@ -426,9 +426,7 @@ SELECT b DIV 900 y FROM t1 GROUP BY y;
 y
 0
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'str1'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'str2'
 SELECT c DIV 900 y FROM t1 GROUP BY y;
 y
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result
index 9e63f6e4580..5f9e366a25e 100644
--- a/mysql-test/main/func_str.result
+++ b/mysql-test/main/func_str.result
@@ -1184,12 +1184,12 @@ SELECT * FROM t1, t2 WHERE num=str;
 str	num
 notnumber	0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'notnumber'
+Warning	1292	Truncated incorrect DECIMAL value: 'notnumber'
 SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
 str	num
 notnumber	0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'notnum'
+Warning	1292	Truncated incorrect DECIMAL value: 'notnum'
 DROP TABLE t1,t2;
 CREATE TABLE t1(
 id int(11) NOT NULL auto_increment,
diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result
index b8b14e61b46..1f8154d377e 100644
--- a/mysql-test/main/func_time.result
+++ b/mysql-test/main/func_time.result
@@ -1718,7 +1718,7 @@ min(timestampadd(month, 1>'', from_days('%Z')))
 NULL
 Warnings:
 Warning	1292	Truncated incorrect INTEGER value: '%Z'
-Warning	1292	Truncated incorrect DOUBLE value: ''
+Warning	1292	Truncated incorrect DECIMAL value: ''
 Warning	1292	Incorrect datetime value: '0000-00-00'
 SET timestamp=UNIX_TIMESTAMP('2001-01-01 00:00:00');
 create table t1(a time);
diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result
index 2e5f545a67b..dd9817160cf 100644
--- a/mysql-test/main/group_by.result
+++ b/mysql-test/main/group_by.result
@@ -2324,17 +2324,17 @@ field1	field2
 2004-10-11 18:13:00	1
 2009-02-19 02:05:00	5
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'g'
-Warning	1292	Truncated incorrect DOUBLE value: 'o'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'g'
+Warning	1292	Truncated incorrect DECIMAL value: 'o'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
 SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ;
 field1	field2
 2004-10-11 18:13:00	1
 2009-02-19 02:05:00	5
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'g'
-Warning	1292	Truncated incorrect DOUBLE value: 'o'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'g'
+Warning	1292	Truncated incorrect DECIMAL value: 'o'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
 SET SESSION SQL_MODE=default;
 drop table t1;
 #
diff --git a/mysql-test/main/insert.result b/mysql-test/main/insert.result
index 4aea81262d2..351222eb459 100644
--- a/mysql-test/main/insert.result
+++ b/mysql-test/main/insert.result
@@ -726,7 +726,7 @@ SET sql_mode= 'STRICT_ALL_TABLES';
 CREATE TABLE t1 (f1 INT DEFAULT 0, f2 INT);
 CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
 REPLACE INTO v1 SET f2 = 1;
-ERROR 22007: Truncated incorrect DOUBLE value: 'x'
+ERROR 22007: Truncated incorrect DECIMAL value: 'x'
 SELECT * from t1;
 f1	f2
 drop view v1;
@@ -739,7 +739,7 @@ drop view v1;
 SELECT 0,0 INTO OUTFILE 't1.txt';
 CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = 'x' WITH CHECK OPTION;
 LOAD DATA INFILE 't1.txt' INTO TABLE v1;
-ERROR 22007: Truncated incorrect DOUBLE value: 'x'
+ERROR 22007: Truncated incorrect DECIMAL value: 'x'
 SELECT * from t1;
 f1	f2
 drop view v1;
@@ -748,6 +748,6 @@ SET @@sql_mode= @save_mode;
 CREATE TABLE t1 (f INT);
 CREATE VIEW v1 AS SELECT * FROM t1 WHERE f <=> 'foo' WITH CHECK OPTION;
 REPLACE INTO v1 SET f = NULL;
-ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
+ERROR 22007: Truncated incorrect DECIMAL value: 'foo'
 DROP VIEW v1;
 DROP TABLE t1;
diff --git a/mysql-test/main/null.result b/mysql-test/main/null.result
index 2fa89a2d001..3eb7e143347 100644
--- a/mysql-test/main/null.result
+++ b/mysql-test/main/null.result
@@ -442,7 +442,7 @@ NULLIF(1,1e0),
 NULLIF(1,'2001-01-01'),
 NULLIF(1,TIME'00:00:00');
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '2001-01-01'
+Warning	1292	Truncated incorrect DECIMAL value: '2001-01-01'
 SHOW CREATE TABLE t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result
index 70bfa4840ee..412dea6070b 100644
--- a/mysql-test/main/partition_innodb.result
+++ b/mysql-test/main/partition_innodb.result
@@ -913,7 +913,7 @@ Warnings:
 Warning	1366	Incorrect integer value: 'three' for column `test`.`t2`.`b` at row 2
 UPDATE v SET a = NULL;
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'foo'
+Warning	1292	Truncated incorrect DECIMAL value: 'foo'
 DROP view v;
 DROP TABLE t1, t2;
 SET @save_isp=@@innodb_stats_persistent;
diff --git a/mysql-test/main/profiling.result b/mysql-test/main/profiling.result
index 6590d89bc89..d9324cd2f11 100644
--- a/mysql-test/main/profiling.result
+++ b/mysql-test/main/profiling.result
@@ -297,12 +297,12 @@ id
 2
 3
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'hello'
-Warning	1292	Truncated incorrect DOUBLE value: 'hello'
-Warning	1292	Truncated incorrect DOUBLE value: 'hello'
-Warning	1292	Truncated incorrect DOUBLE value: 'hello'
-Warning	1292	Truncated incorrect DOUBLE value: 'hello'
-Warning	1292	Truncated incorrect DOUBLE value: 'hello'
+Warning	1292	Truncated incorrect DECIMAL value: 'hello'
+Warning	1292	Truncated incorrect DECIMAL value: 'hello'
+Warning	1292	Truncated incorrect DECIMAL value: 'hello'
+Warning	1292	Truncated incorrect DECIMAL value: 'hello'
+Warning	1292	Truncated incorrect DECIMAL value: 'hello'
+Warning	1292	Truncated incorrect DECIMAL value: 'hello'
 select @@profiling;
 @@profiling
 1
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index 696a8d23d94..3748e97294a 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -4381,15 +4381,15 @@ set sql_mode='STRICT_ALL_TABLES';
 CREATE TABLE t1 (id int, count int);
 insert into t1 values (1,1),(0,2);
 update t1 set count = count + 1 where id = '1bad';
-ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
 prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
 execute stmt;
-ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
 deallocate prepare stmt;
 prepare stmt from 'update t1 set count = count + 1 where id = ?';
 set @a = '1bad';
 execute stmt using @a;
-ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
 deallocate prepare stmt;
 drop table t1;
 CREATE TABLE t1 (id decimal(10,5), count int);
diff --git a/mysql-test/main/ps_innodb.result b/mysql-test/main/ps_innodb.result
index a4fa62e3f39..f77ae50d6de 100644
--- a/mysql-test/main/ps_innodb.result
+++ b/mysql-test/main/ps_innodb.result
@@ -7,15 +7,15 @@ set sql_mode='STRICT_TRANS_TABLES';
 CREATE TABLE t1 (id int, count int) engine=innodb;
 insert into t1 values (1,1),(0,2);
 update t1 set count = count + 1 where id = '1bad';
-ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
 prepare stmt from "update t1 set count = count + 1 where id = '1bad'";
 execute stmt;
-ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
 deallocate prepare stmt;
 prepare stmt from 'update t1 set count = count + 1 where id = ?';
 set @a = '1bad';
 execute stmt using @a;
-ERROR 22007: Truncated incorrect DOUBLE value: '1bad'
+ERROR 22007: Truncated incorrect DECIMAL value: '1bad'
 deallocate prepare stmt;
 drop table t1;
 CREATE TABLE t1 (id decimal(10,5), count int) engine=innodb;
diff --git a/mysql-test/main/type_int.result b/mysql-test/main/type_int.result
index 45060611f8e..8119e72c6ff 100644
--- a/mysql-test/main/type_int.result
+++ b/mysql-test/main/type_int.result
@@ -286,5 +286,87 @@ a
 127
 DROP TABLE t1, t2;
 #
+# MDEV-21445 Strange/inconsistent behavior of IN condition when mixing numbers and strings
+#
+CREATE TABLE t1 (
+id bigint(20) unsigned NOT NULL,
+PRIMARY KEY (id)
+);
+INSERT INTO t1 VALUES(1234),(97716021308405775),(97716021308405770),(97716021308405780);
+SELECT * FROM t1 WHERE id IN(97716021308405775);
+id
+97716021308405775
+SELECT * FROM t1 WHERE id IN('97716021308405775');
+id
+97716021308405775
+SELECT * FROM t1 WHERE id IN('1234',97716021308405775);
+id
+1234
+97716021308405775
+SELECT * FROM t1 WHERE id IN('1234','97716021308405775');
+id
+1234
+97716021308405775
+SELECT * FROM t1 WHERE id = 1234 OR id = '97716021308405775';
+id
+1234
+97716021308405775
+SELECT * FROM t1 WHERE id IN(1234,'97716021308405775');
+id
+1234
+97716021308405775
+SELECT * FROM t1 WHERE id IN('97716021308405775',1234);
+id
+1234
+97716021308405775
+DROP TABLE t1;
+CREATE TABLE t1 (id bigint(20) unsigned NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES(1234),(97716021308405775),(97716021308405770),(97716021308405780);
+SELECT
+id,
+CASE id
+WHEN '97716021308405770' THEN '70'
+    WHEN '97716021308405775' THEN '75'
+    WHEN '97716021308405780' THEN '80'
+  END AS c1
+FROM t1;
+id	c1
+1234	NULL
+97716021308405770	70
+97716021308405775	75
+97716021308405780	80
+SELECT
+id,
+CASE
+WHEN id='97716021308405770' THEN '70'
+    WHEN id='97716021308405775' THEN '75'
+    WHEN id='97716021308405780' THEN '80'
+  END AS c1
+FROM t1;
+id	c1
+1234	NULL
+97716021308405770	70
+97716021308405775	75
+97716021308405780	80
+SELECT id, id BETWEEN '97716021308405775' AND '97716021308405775' AS c1 FROM t1;
+id	c1
+1234	0
+97716021308405770	0
+97716021308405775	1
+97716021308405780	0
+SELECT id, id BETWEEN '97716021308405775' AND 97716021308405775 AS c1 FROM t1;
+id	c1
+1234	0
+97716021308405770	0
+97716021308405775	1
+97716021308405780	0
+SELECT id, id BETWEEN 97716021308405775 AND '97716021308405775' AS c1 FROM t1;
+id	c1
+1234	0
+97716021308405770	0
+97716021308405775	1
+97716021308405780	0
+DROP TABLE t1;
+#
 # End of 10.3 tests
 #
diff --git a/mysql-test/main/type_int.test b/mysql-test/main/type_int.test
index 38bd1a0037a..3ad2997d868 100644
--- a/mysql-test/main/type_int.test
+++ b/mysql-test/main/type_int.test
@@ -220,6 +220,57 @@ INSERT IGNORE INTO t2 SELECT a FROM t1;
 SELECT * FROM t2;
 DROP TABLE t1, t2;
 
+--echo #
+--echo # MDEV-21445 Strange/inconsistent behavior of IN condition when mixing numbers and strings
+--echo #
+
+CREATE TABLE t1 (
+  id bigint(20) unsigned NOT NULL,
+  PRIMARY KEY (id)
+);
+INSERT INTO t1 VALUES(1234),(97716021308405775),(97716021308405770),(97716021308405780);
+
+# OK
+SELECT * FROM t1 WHERE id IN(97716021308405775);
+SELECT * FROM t1 WHERE id IN('97716021308405775');
+SELECT * FROM t1 WHERE id IN('1234',97716021308405775);
+SELECT * FROM t1 WHERE id IN('1234','97716021308405775');
+SELECT * FROM t1 WHERE id = 1234 OR id = '97716021308405775';
+
+# The following was not OK
+SELECT * FROM t1 WHERE id IN(1234,'97716021308405775');
+SELECT * FROM t1 WHERE id IN('97716021308405775',1234);
+
+DROP TABLE t1;
+
+
+CREATE TABLE t1 (id bigint(20) unsigned NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES(1234),(97716021308405775),(97716021308405770),(97716021308405780);
+SELECT
+  id,
+  CASE id
+    WHEN '97716021308405770' THEN '70'
+    WHEN '97716021308405775' THEN '75'
+    WHEN '97716021308405780' THEN '80'
+  END AS c1
+FROM t1;
+
+SELECT
+  id,
+  CASE
+    WHEN id='97716021308405770' THEN '70'
+    WHEN id='97716021308405775' THEN '75'
+    WHEN id='97716021308405780' THEN '80'
+  END AS c1
+FROM t1;
+
+SELECT id, id BETWEEN '97716021308405775' AND '97716021308405775' AS c1 FROM t1;
+SELECT id, id BETWEEN '97716021308405775' AND 97716021308405775 AS c1 FROM t1;
+SELECT id, id BETWEEN 97716021308405775 AND '97716021308405775' AS c1 FROM t1;
+
+DROP TABLE t1;
+
+
 --echo #
 --echo # End of 10.3 tests
 --echo #
diff --git a/mysql-test/main/type_num.result b/mysql-test/main/type_num.result
index 2dadb4f1f8d..071f81ed57c 100644
--- a/mysql-test/main/type_num.result
+++ b/mysql-test/main/type_num.result
@@ -550,17 +550,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1 ';
 COUNT(*)
 2
 Warnings:
-Note	1292	Truncated incorrect DOUBLE value: '1 '
+Note	1292	Truncated incorrect DECIMAL value: '1 '
 SELECT COUNT(*) FROM t1 WHERE i2='1 ';
 COUNT(*)
 2
 Warnings:
-Note	1292	Truncated incorrect DOUBLE value: '1 '
+Note	1292	Truncated incorrect DECIMAL value: '1 '
 SELECT COUNT(*) FROM t1 WHERE i4='1 ';
 COUNT(*)
 2
 Warnings:
-Note	1292	Truncated incorrect DOUBLE value: '1 '
+Note	1292	Truncated incorrect DECIMAL value: '1 '
 SELECT COUNT(*) FROM t1 WHERE i8='1 ';
 COUNT(*)
 2
@@ -585,17 +585,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: ''
+Warning	1292	Truncated incorrect DECIMAL value: ''
 SELECT COUNT(*) FROM t1 WHERE i2='';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: ''
+Warning	1292	Truncated incorrect DECIMAL value: ''
 SELECT COUNT(*) FROM t1 WHERE i4='';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: ''
+Warning	1292	Truncated incorrect DECIMAL value: ''
 SELECT COUNT(*) FROM t1 WHERE i8='';
 COUNT(*)
 2
@@ -620,17 +620,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'x'
+Warning	1292	Truncated incorrect DECIMAL value: 'x'
 SELECT COUNT(*) FROM t1 WHERE i2='x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'x'
+Warning	1292	Truncated incorrect DECIMAL value: 'x'
 SELECT COUNT(*) FROM t1 WHERE i4='x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'x'
+Warning	1292	Truncated incorrect DECIMAL value: 'x'
 SELECT COUNT(*) FROM t1 WHERE i8='x';
 COUNT(*)
 2
@@ -655,17 +655,17 @@ SELECT COUNT(*) FROM t1 WHERE i1=' x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: ' x'
+Warning	1292	Truncated incorrect DECIMAL value: ' x'
 SELECT COUNT(*) FROM t1 WHERE i2=' x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: ' x'
+Warning	1292	Truncated incorrect DECIMAL value: ' x'
 SELECT COUNT(*) FROM t1 WHERE i4=' x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: ' x'
+Warning	1292	Truncated incorrect DECIMAL value: ' x'
 SELECT COUNT(*) FROM t1 WHERE i8=' x';
 COUNT(*)
 2
@@ -690,17 +690,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='.';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '.'
+Warning	1292	Truncated incorrect DECIMAL value: '.'
 SELECT COUNT(*) FROM t1 WHERE i2='.';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '.'
+Warning	1292	Truncated incorrect DECIMAL value: '.'
 SELECT COUNT(*) FROM t1 WHERE i4='.';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '.'
+Warning	1292	Truncated incorrect DECIMAL value: '.'
 SELECT COUNT(*) FROM t1 WHERE i8='.';
 COUNT(*)
 2
@@ -725,17 +725,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='-';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '-'
+Warning	1292	Truncated incorrect DECIMAL value: '-'
 SELECT COUNT(*) FROM t1 WHERE i2='-';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '-'
+Warning	1292	Truncated incorrect DECIMAL value: '-'
 SELECT COUNT(*) FROM t1 WHERE i4='-';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '-'
+Warning	1292	Truncated incorrect DECIMAL value: '-'
 SELECT COUNT(*) FROM t1 WHERE i8='-';
 COUNT(*)
 2
@@ -760,17 +760,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='+';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '+'
+Warning	1292	Truncated incorrect DECIMAL value: '+'
 SELECT COUNT(*) FROM t1 WHERE i2='+';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '+'
+Warning	1292	Truncated incorrect DECIMAL value: '+'
 SELECT COUNT(*) FROM t1 WHERE i4='+';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '+'
+Warning	1292	Truncated incorrect DECIMAL value: '+'
 SELECT COUNT(*) FROM t1 WHERE i8='+';
 COUNT(*)
 2
@@ -795,17 +795,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1x'
+Warning	1292	Truncated incorrect DECIMAL value: '1x'
 SELECT COUNT(*) FROM t1 WHERE i2='1x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1x'
+Warning	1292	Truncated incorrect DECIMAL value: '1x'
 SELECT COUNT(*) FROM t1 WHERE i4='1x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1x'
+Warning	1292	Truncated incorrect DECIMAL value: '1x'
 SELECT COUNT(*) FROM t1 WHERE i8='1x';
 COUNT(*)
 2
@@ -830,17 +830,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1e';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e'
+Warning	1292	Truncated incorrect DECIMAL value: '1e'
 SELECT COUNT(*) FROM t1 WHERE i2='1e';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e'
+Warning	1292	Truncated incorrect DECIMAL value: '1e'
 SELECT COUNT(*) FROM t1 WHERE i4='1e';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e'
+Warning	1292	Truncated incorrect DECIMAL value: '1e'
 SELECT COUNT(*) FROM t1 WHERE i8='1e';
 COUNT(*)
 2
@@ -865,17 +865,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1e+';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e+'
+Warning	1292	Truncated incorrect DECIMAL value: '1e+'
 SELECT COUNT(*) FROM t1 WHERE i2='1e+';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e+'
+Warning	1292	Truncated incorrect DECIMAL value: '1e+'
 SELECT COUNT(*) FROM t1 WHERE i4='1e+';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e+'
+Warning	1292	Truncated incorrect DECIMAL value: '1e+'
 SELECT COUNT(*) FROM t1 WHERE i8='1e+';
 COUNT(*)
 2
@@ -900,17 +900,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1E-';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1E-'
+Warning	1292	Truncated incorrect DECIMAL value: '1E-'
 SELECT COUNT(*) FROM t1 WHERE i2='1E-';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1E-'
+Warning	1292	Truncated incorrect DECIMAL value: '1E-'
 SELECT COUNT(*) FROM t1 WHERE i4='1E-';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1E-'
+Warning	1292	Truncated incorrect DECIMAL value: '1E-'
 SELECT COUNT(*) FROM t1 WHERE i8='1E-';
 COUNT(*)
 2
@@ -935,17 +935,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1Ex';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1Ex'
+Warning	1292	Truncated incorrect DECIMAL value: '1Ex'
 SELECT COUNT(*) FROM t1 WHERE i2='1Ex';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1Ex'
+Warning	1292	Truncated incorrect DECIMAL value: '1Ex'
 SELECT COUNT(*) FROM t1 WHERE i4='1Ex';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1Ex'
+Warning	1292	Truncated incorrect DECIMAL value: '1Ex'
 SELECT COUNT(*) FROM t1 WHERE i8='1Ex';
 COUNT(*)
 2
@@ -970,17 +970,17 @@ SELECT COUNT(*) FROM t1 WHERE i1='1e+x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e+x'
+Warning	1292	Truncated incorrect DECIMAL value: '1e+x'
 SELECT COUNT(*) FROM t1 WHERE i2='1e+x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e+x'
+Warning	1292	Truncated incorrect DECIMAL value: '1e+x'
 SELECT COUNT(*) FROM t1 WHERE i4='1e+x';
 COUNT(*)
 2
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e+x'
+Warning	1292	Truncated incorrect DECIMAL value: '1e+x'
 SELECT COUNT(*) FROM t1 WHERE i8='1e+x';
 COUNT(*)
 2
@@ -1005,27 +1005,26 @@ SELECT COUNT(*) FROM t1 WHERE i1='1e1000';
 COUNT(*)
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e1000'
+Warning	1292	Truncated incorrect DECIMAL value: '1e1000'
 SELECT COUNT(*) FROM t1 WHERE i2='1e1000';
 COUNT(*)
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e1000'
+Warning	1292	Truncated incorrect DECIMAL value: '1e1000'
 SELECT COUNT(*) FROM t1 WHERE i4='1e1000';
 COUNT(*)
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e1000'
+Warning	1292	Truncated incorrect DECIMAL value: '1e1000'
 SELECT COUNT(*) FROM t1 WHERE i8='1e1000';
 COUNT(*)
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '1e1000'
+Warning	1292	Truncated incorrect DECIMAL value: '1e1000'
 SELECT COUNT(*) FROM t1 WHERE d='1e1000';
 COUNT(*)
 0
 Warnings:
-Warning	1916	Got overflow when converting '' to DECIMAL. Value truncated
 Warning	1292	Truncated incorrect DECIMAL value: '1e1000'
 ALTER TABLE t1
 ADD KEY f4(f4),
diff --git a/mysql-test/main/type_num_innodb.result b/mysql-test/main/type_num_innodb.result
index 581a387b2e8..92dc705de90 100644
--- a/mysql-test/main/type_num_innodb.result
+++ b/mysql-test/main/type_num_innodb.result
@@ -46,39 +46,22 @@ ALTER TABLE t1 MODIFY a DECIMAL(10,0);
 SELECT * FROM t1,t2 WHERE a=d;
 a	b	c	pk	d	e
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'd'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'd'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'f'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'f'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'g'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'k'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'm'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'm'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'm'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'o'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'q'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'r'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'u'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'w'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'x'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'x'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 'y'
 ALTER TABLE t1 MODIFY a DOUBLE;
 SELECT * FROM t1,t2 WHERE a=d;
diff --git a/mysql-test/main/type_varchar.result b/mysql-test/main/type_varchar.result
index daf9ab8a1f0..1e9de7b78c5 100644
--- a/mysql-test/main/type_varchar.result
+++ b/mysql-test/main/type_varchar.result
@@ -476,7 +476,6 @@ a	(a DIV 2)
 t	0
 Warnings:
 Warning	1292	Truncated incorrect DECIMAL value: '1a'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 't '
 SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
 a	CAST(a AS SIGNED)
@@ -498,8 +497,8 @@ SELECT 5 = a FROM t1;
 0
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 's'
-Warning	1292	Truncated incorrect DOUBLE value: ''
+Warning	1292	Truncated incorrect DECIMAL value: 's'
+Warning	1292	Truncated incorrect DECIMAL value: ''
 DROP TABLE t1;
 CREATE TABLE t1 (a CHAR(16));
 INSERT INTO t1 VALUES ('5'), ('s'), ('');
@@ -509,8 +508,8 @@ SELECT 5 = a FROM t1;
 0
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 's               '
-Warning	1292	Truncated incorrect DOUBLE value: '                '
+Warning	1292	Truncated incorrect DECIMAL value: 's               '
+Warning	1292	Truncated incorrect DECIMAL value: '                '
 DROP TABLE t1;
 #
 # MDEV-13530 VARBINARY doesn't convert to to BLOB for sizes 65533, 65534 and 65535
diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result
index 99c3c50ea8c..ad3871c553a 100644
--- a/mysql-test/main/type_year.result
+++ b/mysql-test/main/type_year.result
@@ -203,11 +203,11 @@ SELECT * FROM t2 WHERE yy = 'test';
 yy	c2
 00	2000
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'test'
+Warning	1292	Truncated incorrect DECIMAL value: 'test'
 SELECT * FROM t4 WHERE yyyy = 'test';
 yyyy	c4
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'test'
+Warning	1292	Truncated incorrect DECIMAL value: 'test'
 SELECT * FROM t2 WHERE yy = '1999';
 yy	c2
 99	1999
diff --git a/mysql-test/main/warnings.result b/mysql-test/main/warnings.result
index aa4cab37741..8340cb9e981 100644
--- a/mysql-test/main/warnings.result
+++ b/mysql-test/main/warnings.result
@@ -327,7 +327,6 @@ select CAST(a AS DECIMAL(13,5)) FROM (SELECT '' as a) t;
 CAST(a AS DECIMAL(13,5))
 0.00000
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
 create table t1 (a integer unsigned);
 insert into t1 values (1),(-1),(0),(-2);
diff --git a/mysql-test/main/xtradb_mrr.result b/mysql-test/main/xtradb_mrr.result
index f4d54a78a5c..93d349870bc 100644
--- a/mysql-test/main/xtradb_mrr.result
+++ b/mysql-test/main/xtradb_mrr.result
@@ -664,70 +664,70 @@ table3.col_varchar_nokey = table2.col_varchar_key AND table3.pk > table2.col_var
 count(*)	sum(table1.col_int_key*table2.pk)
 240	185955
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
-Warning	1292	Truncated incorrect DOUBLE value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
+Warning	1292	Truncated incorrect DECIMAL value: 'v'
 set @my_save_join_cache_level= @@join_cache_level;
 set @my_save_join_buffer_size= @@join_buffer_size;
 set join_cache_level=6;
diff --git a/mysql-test/suite/funcs_1/r/innodb_func_view.result b/mysql-test/suite/funcs_1/r/innodb_func_view.result
index 737335afddd..917388437e5 100644
--- a/mysql-test/suite/funcs_1/r/innodb_func_view.result
+++ b/mysql-test/suite/funcs_1/r/innodb_func_view.result
@@ -3413,11 +3413,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3433,11 +3430,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
 DROP VIEW v1;
 
@@ -3455,11 +3449,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
@@ -3477,11 +3468,8 @@ NULL	NULL	1
 -1.00	-1                            	5
 -3333.33	-3333.3333                    	28
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
@@ -3501,11 +3489,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3521,11 +3506,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
 DROP VIEW v1;
 
@@ -3543,11 +3525,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--           '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3563,11 +3542,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--           '
 DROP VIEW v1;
 
diff --git a/mysql-test/suite/funcs_1/r/memory_func_view.result b/mysql-test/suite/funcs_1/r/memory_func_view.result
index 74dc4557f50..9cc133e96dc 100644
--- a/mysql-test/suite/funcs_1/r/memory_func_view.result
+++ b/mysql-test/suite/funcs_1/r/memory_func_view.result
@@ -3414,11 +3414,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3434,11 +3431,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
 DROP VIEW v1;
 
@@ -3456,11 +3450,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
@@ -3478,11 +3469,8 @@ NULL	NULL	1
 -1.00	-1                            	5
 -3333.33	-3333.3333                    	28
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
@@ -3502,11 +3490,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3522,11 +3507,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
 DROP VIEW v1;
 
@@ -3544,11 +3526,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--           '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3564,11 +3543,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--           '
 DROP VIEW v1;
 
diff --git a/mysql-test/suite/funcs_1/r/myisam_func_view.result b/mysql-test/suite/funcs_1/r/myisam_func_view.result
index 74dc4557f50..9cc133e96dc 100644
--- a/mysql-test/suite/funcs_1/r/myisam_func_view.result
+++ b/mysql-test/suite/funcs_1/r/myisam_func_view.result
@@ -3414,11 +3414,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3434,11 +3431,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	29
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- '
 DROP VIEW v1;
 
@@ -3456,11 +3450,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	28
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
@@ -3478,11 +3469,8 @@ NULL	NULL	1
 -1.00	-1                            	5
 -3333.33	-3333.3333                    	28
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---\xC3\xA4\xC3\x96\xC3\xBC\xC3\x9F@\xC2\xB5*$-- \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 Warning	1292	Truncated incorrect DECIMAL value: '-3333.3333\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
@@ -3502,11 +3490,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3522,11 +3507,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	27
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ''
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<---------1000 characters----------------------------------------------------------------------------------------------------...'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
 DROP VIEW v1;
 
@@ -3544,11 +3526,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--           '
 SHOW CREATE VIEW v1;
 View	Create View	character_set_client	collation_connection
@@ -3564,11 +3543,8 @@ NULL	NULL	1
 -1.00	-1	5
 -3333.33	-3333.3333	26
 Warnings:
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '                              '
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: '<--------30 characters------->'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$--           '
 DROP VIEW v1;
 
diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result
index 8eb7a9372b5..9a3410ed59c 100644
--- a/mysql-test/suite/gcol/r/gcol_bugfixes.result
+++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result
@@ -250,7 +250,7 @@ HAVING x > '2000-02-06'
 ORDER BY col_time_nokey, pk;
 x
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: '2000-02-06'
+Warning	1292	Truncated incorrect DECIMAL value: '2000-02-06'
 DROP TABLE c;
 # Bug#21341044: Conditional jump at sort_param::make_sort_key
 CREATE TABLE t1 (
diff --git a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
index b7deea88a9c..01ad4659b46 100644
--- a/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
+++ b/mysql-test/suite/sys_vars/r/keep_files_on_create_basic.result
@@ -23,13 +23,13 @@ SELECT @@global.keep_files_on_create = 'OFF';
 @@global.keep_files_on_create = 'OFF'
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'OFF'
+Warning	1292	Truncated incorrect DECIMAL value: 'OFF'
 SET @@session.keep_files_on_create = DEFAULT;
 SELECT @@session.keep_files_on_create = 'OFF';
 @@session.keep_files_on_create = 'OFF'
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'OFF'
+Warning	1292	Truncated incorrect DECIMAL value: 'OFF'
 '#--------------------FN_DYNVARS_054_03-------------------------#'
 SET @@global.keep_files_on_create = ON;
 SELECT @@global.keep_files_on_create;
diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
index 7ed1b689f5a..411bf5a77e4 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_basic.result
@@ -14,7 +14,7 @@ SELECT @@global.log_bin_trust_function_creators = 'FALSE';
 @@global.log_bin_trust_function_creators = 'FALSE'
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'FALSE'
+Warning	1292	Truncated incorrect DECIMAL value: 'FALSE'
 '#--------------------FN_DYNVARS_063_03-------------------------#'
 SET @@global.log_bin_trust_function_creators = ON;
 SELECT @@global.log_bin_trust_function_creators;
diff --git a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
index 633dc274dec..53381db3148 100644
--- a/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
+++ b/mysql-test/suite/sys_vars/r/low_priority_updates_basic.result
@@ -23,13 +23,13 @@ SELECT @@global.low_priority_updates = 'FALSE';
 @@global.low_priority_updates = 'FALSE'
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'FALSE'
+Warning	1292	Truncated incorrect DECIMAL value: 'FALSE'
 SET @@session.low_priority_updates = DEFAULT;
 SELECT @@session.low_priority_updates = 'FALSE';
 @@session.low_priority_updates = 'FALSE'
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'FALSE'
+Warning	1292	Truncated incorrect DECIMAL value: 'FALSE'
 '#--------------------FN_DYNVARS_069_03-------------------------#'
 SET @@global.low_priority_updates = ON;
 SELECT @@global.low_priority_updates;
diff --git a/mysql-test/suite/sys_vars/r/skip_replication_basic.result b/mysql-test/suite/sys_vars/r/skip_replication_basic.result
index bb04df169a1..b137e24da02 100644
--- a/mysql-test/suite/sys_vars/r/skip_replication_basic.result
+++ b/mysql-test/suite/sys_vars/r/skip_replication_basic.result
@@ -16,7 +16,7 @@ select @@session.skip_replication = variable_value from information_schema.sessi
 @@session.skip_replication = variable_value
 1
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'OFF'
+Warning	1292	Truncated incorrect DECIMAL value: 'OFF'
 set session skip_replication=0;
 select @@session.skip_replication;
 @@session.skip_replication
diff --git a/sql/field.cc b/sql/field.cc
index f100963903a..a52c050afa4 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -7265,8 +7265,7 @@ my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
   ASSERT_COLUMN_MARKED_FOR_READ;
   THD *thd= get_thd();
   Converter_str2my_decimal_with_warn(thd,
-                                     Warn_filter_string(thd, this),
-                                     E_DEC_FATAL_ERROR,
+                                     Warn_filter_string(thd, this), 0,
                                      Field_string::charset(),
                                      (const char *) ptr,
                                      field_length, decimal_value);
@@ -7677,8 +7676,7 @@ my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
 {
   ASSERT_COLUMN_MARKED_FOR_READ;
   THD *thd= get_thd();
-  Converter_str2my_decimal_with_warn(thd, Warn_filter(thd),
-                                     E_DEC_FATAL_ERROR,
+  Converter_str2my_decimal_with_warn(thd, Warn_filter(thd), 0,
                                      Field_varstring::charset(),
                                      (const char *) get_data(),
                                      get_length(), decimal_value);
@@ -8509,8 +8507,7 @@ my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
     length= get_length(ptr);
 
   THD *thd= get_thd();
-  Converter_str2my_decimal_with_warn(thd, Warn_filter(thd),
-                                     E_DEC_FATAL_ERROR,
+  Converter_str2my_decimal_with_warn(thd, Warn_filter(thd), 0,
                                      Field_blob::charset(),
                                      blob, length, decimal_value);
   return decimal_value;
diff --git a/sql/field.h b/sql/field.h
index be3a648617b..c9f5a34a3ae 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -311,7 +311,7 @@ class Value_source
                                              const char *end)
   {
     Converter_str2my_decimal_with_warn(NULL, Warn_filter_all(),
-                                       E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
+                                       0,
                                        cs, cptr, end - cptr, decimal_value);
     return decimal_value;
   }
diff --git a/sql/sql_type.cc b/sql/sql_type.cc
index 9d3a47adfa5..7a847c90b8f 100644
--- a/sql/sql_type.cc
+++ b/sql/sql_type.cc
@@ -764,6 +764,11 @@ Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h)
         m_type_handler= &type_handler_datetime;
     }
   }
+  else if ((a == INT_RESULT && b == STRING_RESULT) ||
+           (b == INT_RESULT && a == INT_RESULT))
+  {
+    m_type_handler= &type_handler_newdecimal;
+  }
   else if ((a == INT_RESULT || a == DECIMAL_RESULT) &&
            (b == INT_RESULT || b == DECIMAL_RESULT))
   {
diff --git a/storage/tokudb/mysql-test/tokudb/r/type_varchar.result b/storage/tokudb/mysql-test/tokudb/r/type_varchar.result
index bf98e12ce16..80c92bfe874 100644
--- a/storage/tokudb/mysql-test/tokudb/r/type_varchar.result
+++ b/storage/tokudb/mysql-test/tokudb/r/type_varchar.result
@@ -446,7 +446,6 @@ a	(a DIV 2)
 t	0
 Warnings:
 Warning	1292	Truncated incorrect DECIMAL value: '1a'
-Warning	1918	Encountered illegal value '' when converting to DECIMAL
 Warning	1292	Truncated incorrect DECIMAL value: 't '
 SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
 a	CAST(a AS SIGNED)
@@ -468,8 +467,8 @@ SELECT 5 = a FROM t1;
 0
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 's'
-Warning	1292	Truncated incorrect DOUBLE value: ''
+Warning	1292	Truncated incorrect DECIMAL value: 's'
+Warning	1292	Truncated incorrect DECIMAL value: ''
 DROP TABLE t1;
 CREATE TABLE t1 (a CHAR(16));
 INSERT INTO t1 VALUES ('5'), ('s'), ('');
@@ -479,6 +478,6 @@ SELECT 5 = a FROM t1;
 0
 0
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 's               '
-Warning	1292	Truncated incorrect DOUBLE value: '                '
+Warning	1292	Truncated incorrect DECIMAL value: 's               '
+Warning	1292	Truncated incorrect DECIMAL value: '                '
 DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/type_year.result b/storage/tokudb/mysql-test/tokudb/r/type_year.result
index 86f0d9b128e..5fcd42fe06d 100644
--- a/storage/tokudb/mysql-test/tokudb/r/type_year.result
+++ b/storage/tokudb/mysql-test/tokudb/r/type_year.result
@@ -204,11 +204,11 @@ SELECT * FROM t2 WHERE yy = 'test';
 yy	c2
 00	2000
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'test'
+Warning	1292	Truncated incorrect DECIMAL value: 'test'
 SELECT * FROM t4 WHERE yyyy = 'test';
 yyyy	c4
 Warnings:
-Warning	1292	Truncated incorrect DOUBLE value: 'test'
+Warning	1292	Truncated incorrect DECIMAL value: 'test'
 SELECT * FROM t2 WHERE yy = '1999';
 yy	c2
 99	1999
