Description:
Rejecting the maximum value of the type double (1.7976931348623157E+308) when parsing the statement doesn't catch expressions, e.g.:
create table t1 (c1 int,c2 double);
mysql> insert into t1 values (234,9999999e30*9999999e30);
Query OK, 1 row affected (0.01 sec)
mysql> select * from t1;
+------------+---------------------+
| c1 | c2 |
+------------+---------------------+
| 234 | 9.9999980000001e+73 |
+------------+---------------------+
3 rows in set (0.00 sec)
mysql> insert into t1 values (234,9999999e130*9999999e230);
Query OK, 1 row affected (0.00 sec)
mysql> select * from t1;
+------------+---------------------+
| c1 | c2 |
+------------+---------------------+
| 234 | 9.9999980000001e+73 |
| 234 | NULL |
+------------+---------------------+
4 rows in set (0.00 sec)
mysql> insert into t1 values (234,9999999e330/9999999e230);
ERROR 1367 (22007): Illegal double '9999999e330' value found during parsing
mysql> insert into t1 values (234,9999999e30/9999999e20);
Query OK, 1 row affected (0.00 sec)
How to repeat:
execute with mysql:
create table t1 (c1 int,c2 double);
insert into t1 values (234,9999999e30*9999999e30);
select * from t1;
insert into t1 values (234,9999999e130*9999999e230);
select * from t1;
insert into t1 values (234,9999999e330/9999999e230);
Suggested fix:
The expression needs to be evaluated and in case the evaluation wouldn't be possible or the result of the expression would not be valid a warning or error should be set. That also valid for update, prepare, execute, select etc.