MDL-69451 dml: use same temptables for both rw and ro database handle

moodle_read_slave_trait: when creating another handle, restore temptables
property that is clobbered by raw_connect().

Also a better condition for temptable related queries detection in
pgsql_native_moodle_database.

dml_pgsql_read_slave_test::test_temp_table(): use real db connection
if possible, otherwise skip the test.
This commit is contained in:
Srdjan
2021-08-06 10:00:20 +10:00
parent 0d0e66d37c
commit fa0eecd6bf
3 changed files with 48 additions and 11 deletions
+1 -1
View File
@@ -295,7 +295,7 @@ class pgsql_native_moodle_database extends moodle_database {
}
// ... a nuisance - temptables use this.
if (preg_match('/\bpg_constraint/', $sql) && $this->temptables->get_temptables()) {
if (preg_match('/\bpg_catalog/', $sql) && $this->temptables->get_temptables()) {
return false;
}