Bug #22942 | sql_mode ERROR_FOR_DIVISION_BY_ZERO not working | ||
---|---|---|---|
Submitted: | 3 Oct 2006 14:56 | Modified: | 3 Oct 2006 20:11 |
Reporter: | Marc ALFF | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.26 | OS: | |
Assigned to: | CPU Architecture: | Any |
[3 Oct 2006 14:56]
Marc ALFF
[3 Oct 2006 15:08]
Paul DuBois
I see no difference from what is documented at http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html, which says: Produce an error in strict mode (otherwise a warning) when a division by zero (or MOD(X,0)) occurs during an INSERT or UPDATE. If this mode is not enabled, MySQL instead returns NULL for divisions by zero. For INSERT IGNORE or UPDATE IGNORE, MySQL generates a warning for divisions by zero, but the result of the operation is NULL. You're not inserting any data, just selecting it. Div-0 errors occur only when you attempt to modify table data.