SQL generators must not execute changes in DB. Just provide the needed SQL

in order to make database_manager to execute it. reset_sequence reimplemented.
This commit is contained in:
stronk7
2009-08-31 14:23:40 +00:00
parent 576ace3245
commit b1ca138716
8 changed files with 57 additions and 48 deletions
+7 -6
View File
@@ -109,11 +109,8 @@ class database_manager {
* @return success
*/
public function reset_sequence($table) {
/// Calculate the name of the table
if (is_string($table)) {
$tablename = $table;
} else {
$tablename = $table->getName();
if (!is_string($table) and !($table instanceof xmldb_table)) {
throw new ddl_exception('ddlunknownerror', NULL, 'incorrect table parameter!');
}
/// Check the table exists
@@ -121,7 +118,11 @@ class database_manager {
throw new ddl_table_missing_exception($tablename);
}
return $this->generator->reset_sequence($table);
if (!$sqlarr = $this->generator->getResetSequenceSQL($table)) {
throw new ddl_exception('ddlunknownerror', null, 'table reset sequence sql not generated');
}
$this->execute_sql_arr($sqlarr);
}
/**