http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5366 --- Comment #19 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to comment #18)
As a data point, I'm currently running MariaDB 5.5.31, using mariadb.org's Debian Wheezy package.
So far, I am *not* running into any glitches with inserting into tables that don't set explicit defaults for non-NULL columns.
<snip>
I wonder if, back when this was originally tested, whether MariaDB was shipping with a default value of SQL_MODE that included 'STRICT_TRANS_TABLES':
ariaDB [koha]> SET SESSION sql_mode = 'STRICT_TRANS_TABLES'; Query OK, 0 rows affected (0.00 sec)
MariaDB [koha]> INSERT INTO foo (field2) VALUES ('field2 set, field1 not'); ERROR 1364 (HY000): Field 'field1' doesn't have a default value
This is entirely possible as this last error is what I was seeing.
If that's the case, perhaps a solution is to set SQL_MODE explicitly whenever Koha makes a database connection. The initial value would almost certainly have to be '', for compatibility reasons, but it would be a very worthy code to then start tightening the screws and work our way up to setting SQL_MODE to TRADITIONAL or the like -- and this would be an improvement regardless of whether any given Koha site uses MariaDB or MySQL.
This sounds like a good approach, and one which I would certainly support (fwiw). -- You are receiving this mail because: You are the QA Contact for the bug. You are watching all bug changes.