Bug 10732

Summary: use a stricter SQL_MODE
Product: Koha Reporter: Galen Charlton <gmcharlt>
Component: Architecture, internals, and plumbingAssignee: Galen Charlton <gmcharlt>
Status: RESOLVED DUPLICATE QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

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 ***