My db-config.php is as below, config as Read-Only:
$wpdb->add_database( array(
'host' => DB_HOST, // If port is other than 3306, use host:port.
'user' => DB_USER',
'password' => DB_PASSWORD,
'name' => DB_NAME,
'write' => 0,
'read' => 1,
'dataset' => 'global',
'timeout' => 0.2,
) );
I found when a write query is execute, any query after for the same table will be executed as global__w. And with my read-only configuration, that causes SELECT statement returning empty result.
I checked code, this is intensional to prevent reading from slaves which might be lagging after a write.
so any idea to solve my situation?
Thanks!