MyBB Community Forums

Full Version: DB_MySQLs' `table_exits()` should be executed on write link (usually source server)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
To get correct and consistent results on a replication, the table_exits() method should be executed on write link (usually the source server) for DB_MySQL / DB_MySQLi / MysqlPdoDbDriver, whereas on a random link now. The reason is explained at https://community.mybb.com/thread-119212...#pid863290 (limited access).

DB_MySQL, DB_MySQLi and MysqlPdoDbDriver using query() without writeQuery specified for table_exits():
https://github.com/mybb/mybb/blob/mybb_1...#L682-L709
https://github.com/mybb/mybb/blob/mybb_1...#L678-L705
https://github.com/mybb/mybb/blob/mybb_1...#L141-L156

DB_PgSQL and PostgresPdoDbDriver both using write_query() for table_exits(), which is the right way I think:
https://github.com/mybb/mybb/blob/mybb_1...l.php#L651
https://github.com/mybb/mybb/blob/mybb_1...o.php#L124

SQLite doesn't support replication so it doesn't have such problem.

Btw, MySQL calls a master server source server now.