MDL-51374 dml: Delete selectively instead of purge for tmptables

This commit is contained in:
David Monllao 2016-03-16 10:48:41 +08:00
parent ef474575e1
commit ad90c7a5d5

View File

@ -1055,12 +1055,10 @@ abstract class moodle_database {
*/
public function reset_caches($tablenames = null) {
if (!empty($tablenames)) {
$temptablepurged = false;
$dbmetapurged = false;
foreach ($tablenames as $tablename) {
if ($temptablepurged === false && $this->temptables->is_temptable($tablename)) {
$this->get_temp_tables_cache()->purge();
$temptablepurged = true;
if ($this->temptables->is_temptable($tablename)) {
$this->get_temp_tables_cache()->delete($tablename);
} else if ($dbmetapurged === false) {
$this->tables = null;
$this->get_metacache()->purge();