]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Closes #1424: Faulty database migrations will now halt an upgrade.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 31 Dec 2009 03:58:21 +0000 (03:58 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 31 Dec 2009 03:58:21 +0000 (03:58 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3783 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/database.php

index a3c93f48c27f6d51b3dc7956eb4da1f0d37998e0..87b0025082e86ca0027c7659e5776bc45b68ba8c 100644 (file)
@@ -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());
+//                             }
                        }
                }
        }