MDL-51374 dml: Delete selectively instead of purge for tmptables
authorDavid Monllao <davidm@moodle.com>
Wed, 16 Mar 2016 02:48:41 +0000 (10:48 +0800)
committerDavid Monllao <davidm@moodle.com>
Wed, 16 Mar 2016 02:48:41 +0000 (10:48 +0800)
lib/dml/moodle_database.php

index 4f74576..70a3b30 100644 (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();