From bae2846c2cd4b2234cf5531c7dfe52c88c0fa6cc Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 28 Apr 2013 18:33:33 +0200 Subject: [PATCH] MDL-39390 delete old moodle_database column cache With MDL-39389 all the remaining drivers have been moved from the in-memory, per-request ::columns cache to the MUC (databasemeta) alternative. That makes the old cache unused, so this is, simply about to delete it, and warn in upgrade notes for potential sites using custom moodle_database drivers. --- lib/dml/moodle_database.php | 4 ---- lib/upgrade.txt | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index c7753a50f2c..2a6676c84e7 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -66,8 +66,6 @@ abstract class moodle_database { protected $database_manager; /** @var moodle_temptables temptables manager to provide cross-db support for temp tables. */ protected $temptables; - /** @var array Cache of column info. */ - protected $columns = array(); // I wish we had a shared memory cache for this :-( /** @var array Cache of table info. */ protected $tables = null; @@ -356,7 +354,6 @@ abstract class moodle_database { $this->database_manager->dispose(); $this->database_manager = null; } - $this->columns = array(); $this->tables = null; } @@ -945,7 +942,6 @@ abstract class moodle_database { * @return void */ public function reset_caches() { - $this->columns = array(); $this->tables = null; // Purge MUC as well $identifiers = array('dbfamily' => $this->get_dbfamily(), 'settings' => $this->get_settings_hash()); diff --git a/lib/upgrade.txt b/lib/upgrade.txt index a0236ef066f..b9999554ef6 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -3,6 +3,9 @@ information provided here is intended especially for developers. === 2.5 === +* The database drivers (moodle_database and subclasses) aren't using anymore the ::columns property + for caching database metadata. MUC (databasemeta) is used instead. Any custom DB driver should + apply for that change. * The cron output has been changed to include time and memory usage (see cron_trace_time_and_memory()), so any custom utility relying on the old output may require modification. * Function get_max_file_sizes now returns an option for (for example) "Course limit (500MB)" or