MDL-32434 allow database_manager->drop_table() for temporary tables
This commit is contained in:
@@ -122,14 +122,30 @@ class oracle_sql_generator extends sql_generator {
|
||||
}
|
||||
|
||||
/**
|
||||
* Given one correct xmldb_table and the new name, returns the SQL statements
|
||||
* Given one correct xmldb_table, returns the SQL statements
|
||||
* to drop it (inside one array).
|
||||
*
|
||||
* @param xmldb_table $xmldb_table The table to drop.
|
||||
* @return array SQL statement(s) for dropping the specified table.
|
||||
*/
|
||||
public function getDropTableSQL($xmldb_table) {
|
||||
$sqlarr = parent::getDropTableSQL($xmldb_table);
|
||||
if ($this->temptables->is_temptable($xmldb_table->getName())) {
|
||||
array_unshift($sqlarr, "TRUNCATE TABLE ". $this->getTableName($xmldb_table)); // oracle requires truncate before being able to drop a temp table
|
||||
$this->temptables->delete_temptable($xmldb_table->getName());
|
||||
}
|
||||
return $sqlarr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given one correct xmldb_table, returns the SQL statements
|
||||
* to drop it (inside one array)
|
||||
*
|
||||
* @param xmldb_table $xmldb_table The table to drop.
|
||||
* @return array SQL statement(s) for dropping the specified table.
|
||||
*/
|
||||
public function getDropTempTableSQL($xmldb_table) {
|
||||
$sqlarr = $this->getDropTableSQL($xmldb_table);
|
||||
array_unshift($sqlarr, "TRUNCATE TABLE ". $this->getTableName($xmldb_table)); // oracle requires truncate before being able to drop a temp table
|
||||
$this->temptables->delete_temptable($xmldb_table->getName());
|
||||
return $sqlarr;
|
||||
return $this->getDropTableSQL($xmldb_table);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user