Mysql strict mode

We should have been a little more specific with our response to the question.

STRICT_TRANS_TABLES is one of the values of MySQL global in SQL_MODE.

The initial question was on STRICT_TRANS_TABLES. There are other values in SQL_MODE which will break OpenEMR queries depending on the database software version.

MariaDB 10.2.4 SQL_MODE default values:

STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO , NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

MariaDB 10.3.14 SQL_MODE default values:

STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO , NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

The default SQL mode in MySQL 5.6: NO_ENGINE_SUBSTITUTION

The default SQL mode in MySQL 5.7 : ONLY_FULL_GROUP_BY , STRICT_TRANS_TABLES , NO_ZERO_IN_DATE , NO_ZERO_DATE , ERROR_FOR_DIVISION_BY_ZERO , NO_AUTO_CREATE_USER , and NO_ENGINE_SUBSTITUTION .

Now, depending on whether you use MySQL or MariaDB the behavior will be different for OpenEMR application.

For example - Error related to only_full_group_by when executing a query in OpenEMR with MySQL, is discussed by Brady et al here!

Another example is, SQL_MODE values like “NO_ZERO_IN_DATE”, and “NO_ZERO_DATE” will also have impact on OpenEMR apps which are default values in MySQL but NOT in MariaDB!

To be specific, Openemr_postcalender_events table has pc_enddate column default values as “0000-00-00” which will throw error when the above values are left as default values!

One can turn off the corresponding SQL_MODE to fix these errors.

In Summary, since you are using MariaDB and NOT MySQL you should be OK but watch out for values

Like ERROR_FOR_DIVISION_BY_ZERO etc.

But again, there is always Murphys Law :slight_smile:

-ViSolve OpenEMR support Team