Bug 10732 - use a stricter SQL_MODE
Summary: use a stricter SQL_MODE
Status: RESOLVED DUPLICATE of bug 17258
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
Depends on:
Reported: 2013-08-14 18:27 UTC by Galen Charlton
Modified: 2018-04-09 19:19 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2013-08-14 18:27:02 UTC
It would be nice to have Koha use a stricter MySQL/MariaDB SQL_MODE.  Currently, Koha essentially expects that SQL_MODE is NULL.

In particular, STRICT_TRANS_TABLES would add better type checking -- for example, no more inserting strings into an int field and expecting things to magically work.

Another mode to consider is NO_ZERO_DATE [2].

It appears that MySQL on OS X ships with SQL_MODE set to a value that includes STRICT_TRANS_TABLES; a user report indicates that at least one seed data script cannot be loaded as a consequence. [3]

[1] http://dev.mysql.com/doc/refman/5.6/en/server-sql-mode.html#sqlmode_strict_trans_tables
[2] http://dev.mysql.com/doc/refman/5.6/en/server-sql-mode.html#sqlmode_no_zero_date
[3] http://lists.katipo.co.nz/pipermail/koha/2013-August/037031.html
Comment 1 Jonathan Druart 2018-04-09 19:19:44 UTC

*** This bug has been marked as a duplicate of bug 17258 ***