aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-31 03:58:21 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-12-31 03:58:21 +0000
commitec625722feb4da50848aac0b627b83b3bb0460a8 (patch)
tree2f0cc3907193f2d62a2ffd2d7afe28e958f52875
parent6e5d82cf8d30c789b3cde77b71286f20a1b86677 (diff)
downloadelgg-ec625722feb4da50848aac0b627b83b3bb0460a8.tar.gz
elgg-ec625722feb4da50848aac0b627b83b3bb0460a8.tar.bz2
Closes #1424: Faulty database migrations will now halt an upgrade.
git-svn-id: http://code.elgg.org/elgg/trunk@3783 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/database.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index a3c93f48c..87b002508 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -65,7 +65,7 @@ function establish_db_link($dblinkname = "readwrite") {
if (isset($CONFIG->db_disable_query_cache)) {
$db_cache_off = $CONFIG->db_disable_query_cache;
}
-
+
// Set up cache if global not initialized and query cache not turned off
if ((!$DB_QUERY_CACHE) && (!$db_cache_off)) {
$DB_QUERY_CACHE = new ElggStaticVariableCache('db_query_cache'); //array();
@@ -97,7 +97,7 @@ function setup_db_connections() {
*/
function db_profiling_shutdown_hook() {
global $dbcalls;
-
+
elgg_log("DB Queries for this page: $dbcalls", 'DEBUG');
}
@@ -552,11 +552,12 @@ function db_upgrade($version, $fromdir = "") {
if (sizeof($sqlupgrades) > 0) {
foreach($sqlupgrades as $sqlfile) {
- try {
+// let's not allow failing upgrade to pass.
+// try {
run_sql_script($fromdir . $sqlfile);
- } catch (DatabaseException $e) {
- error_log($e->getmessage());
- }
+// } catch (DatabaseException $e) {
+// error_log($e->getmessage());
+// }
}
}
}