Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.1(EOL), 10.2(EOL)
-
None
Description
MySQL produces better-looking warnings upon wrong function parameters.
Please also note that at least in this case it produces them regardless of the sql_mode.
MariaDB 10.2 |
MariaDB [test]> set sql_mode=''; |
Query OK, 0 rows affected (0.00 sec) |
|
MariaDB [test]> select log(-1); |
+---------+ |
| log(-1) |
|
+---------+ |
| NULL | |
+---------+ |
1 row in set (0.00 sec) |
|
MariaDB [test]> set sql_mode='ERROR_FOR_DIVISION_BY_ZERO'; |
Query OK, 0 rows affected (0.00 sec) |
|
MariaDB [test]> select log(-1); |
+---------+ |
| log(-1) |
|
+---------+ |
| NULL | |
+---------+ |
1 row in set, 1 warning (0.00 sec) |
|
MariaDB [test]> show warnings;
|
+---------+------+---------------+ |
| Level | Code | Message | |
+---------+------+---------------+ |
| Warning | 1365 | Division by 0 | |
+---------+------+---------------+ |
1 row in set (0.00 sec) |
MySQL 5.7 |
MySQL [test]> set sql_mode=''; |
Query OK, 0 rows affected (0.00 sec) |
|
MySQL [test]> select log(-1); |
+---------+ |
| log(-1) |
|
+---------+ |
| NULL | |
+---------+ |
1 row in set, 1 warning (0.00 sec) |
|
MySQL [test]> show warnings;
|
+---------+------+--------------------------------+ |
| Level | Code | Message | |
+---------+------+--------------------------------+ |
| Warning | 3020 | Invalid argument for logarithm | |
+---------+------+--------------------------------+ |
1 row in set (0.01 sec) |
|
MySQL [test]> set sql_mode='ERROR_FOR_DIVISION_BY_ZERO'; |
Query OK, 0 rows affected, 1 warning (0.00 sec) |
|
MySQL [test]> select log(-1); |
+---------+ |
| log(-1) |
|
+---------+ |
| NULL | |
+---------+ |
1 row in set, 1 warning (0.00 sec) |
|
MySQL [test]> show warnings;
|
+---------+------+--------------------------------+ |
| Level | Code | Message | |
+---------+------+--------------------------------+ |
| Warning | 3020 | Invalid argument for logarithm | |
+---------+------+--------------------------------+ |
1 row in set (0.00 sec) |
Attachments
Issue Links
- relates to
-
MDEV-7635 update defaults and simplify mysqld config parameters
- Closed