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:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user