mybb / merge-system

The MyBB Merge System allows for easy merging of an existing forum (be it MyBB or another forum software) into a MyBB 1.8.x forum.
Other
34 stars 33 forks source link

Merge breaks when MySQL's sql_mode is set to some specific values or "Strict Mode" is on #241

Open yuliu opened 4 years ago

yuliu commented 4 years ago

PostgreSQL and SQLite may have equivalently so-called strict mode, but I'm not familiar with them.

Quick search: PostgreSQL: no findings. SQLite: https://sqlite.org/src/wiki?name=StrictMode

Relevant issue: #235. I can't confirm which setting is in effect here, the setting of sql_mode when I'm experiencing the problem is STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION.

A community post complains about sql_mode set with only_full_group_by: https://community.mybb.com/thread-225560-post-1339852.html#pid1339852

Seems MySQL is involving more strict modes along new version releases. So some queries may break the merging in newer MySQL versions.

euantorano commented 4 years ago

I believe PostgreSQL is strict by default basically, an I'm not aware of any options to make it more/less strict. @kawaii may know better though.

yuliu commented 4 years ago

MySQL strict mode may be disabled by setting sql_mode to some combinations of not strict modes, for example:

SET SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY'

This should be useful for normal users who use the merge system but for merge system's developers doing so may not be recommended IMO.