From: stronk7 Date: Sun, 24 Sep 2006 15:34:18 +0000 (+0000) Subject: XMLDB generators can return empty arrays if there is nothing to do. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c1761c4292d0fb8d32ce0cd932cb8cf9c8befda1;p=moodle.git XMLDB generators can return empty arrays if there is nothing to do. --- diff --git a/lib/ddllib.php b/lib/ddllib.php index bd3ed162fd..f03eb30ab0 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -308,7 +308,7 @@ function install_from_xmldb_file($file) { $structure = $xmldb_file->getStructure(); if (!$sqlarr = $structure->getCreateStructureSQL($CFG->dbtype, $CFG->prefix, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr); @@ -335,7 +335,7 @@ function create_table($table, $continue=true, $feedback=true) { } if(!$sqlarr = $table->getCreateTableSQL($CFG->dbtype, $CFG->prefix, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr, $continue, $feedback); @@ -363,7 +363,7 @@ function drop_table($table, $continue=true, $feedback=true) { } if(!$sqlarr = $table->getDropTableSQL($CFG->dbtype, $CFG->prefix, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr, $continue, $feedback); @@ -393,7 +393,7 @@ function add_field($table, $field, $continue=true, $feedback=true) { } if(!$sqlarr = $table->getAddFieldSQL($CFG->dbtype, $CFG->prefix, $field, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr, $continue, $feedback); @@ -423,7 +423,7 @@ function drop_field($table, $field, $continue=true, $feedback=true) { } if(!$sqlarr = $table->getDropFieldSQL($CFG->dbtype, $CFG->prefix, $field, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr, $continue, $feedback); @@ -453,7 +453,7 @@ function change_field_precision($table, $field, $continue=true, $feedback=true) } if(!$sqlarr = $table->getAlterFieldSQL($CFG->dbtype, $CFG->prefix, $field, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr, $continue, $feedback); @@ -516,7 +516,7 @@ function change_field_default($table, $field, $continue=true, $feedback=true) { } if(!$sqlarr = $table->getModifyDefaultSQL($CFG->dbtype, $CFG->prefix, $field, false)) { - return false; + return true; //Empty array = nothing to do = no error } return execute_sql_arr($sqlarr, $continue, $feedback);