[MDEV-8319] ERROR_FOR_DIVISION_BY_ZERO not throwing error Created: 2015-06-15 Updated: 2015-06-18 Resolved: 2015-06-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | 10.0.19 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Kyle McNally | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Windows 8.1 |
||
| Description |
|
ERROR_FOR_DIVISION_BY_ZERO doesn't appear to be honored.
There is a warning, but according to https://mariadb.com/kb/en/mariadb/sql_mode/ it should "Return a 1365 'Division by 0' error (instead of a warning)" |
| Comments |
| Comment by Ian Gilfillan [ 2015-06-18 ] |
|
I am not sure what the intended behaviour is - to me it looks like a bug, as you would expect an option called "ERROR_*" to actually return an error, at least in strict mode. I have tested the behaviour on MariaDB 5.5, MySQL 5.6.19 and it works in the same undocumented way as well. The option has also been deprecated in MySQL 5.6. I'll update the documentation to reflect what happens now, but leaving the task open for re-assigning if its seen as a bug rather than intentional. |
| Comment by Kyle McNally [ 2015-06-18 ] |
|
According to this: https://dev.mysql.com/doc/refman/5.6/en/sql-mode.html#sqlmode_error_for_division_by_zero It looks like the warning would almost suffice: "If this mode is enabled, division by zero inserts NULL and produces a warning." However, "If this mode and strict mode are enabled, division by zero produces an error,..." which was the previously documented outcome. Either is fine with me. It doesn't affect my program at all. I was just tightening up my server after switching from MySql and noticed that this mode wasn't the same as the documentation. |