From 4feeadeb59daf3f69657af33e7a01a0a681aae79 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 22 Sep 2006 16:16:48 +0000 Subject: [PATCH] Minor fix to be able to drop tables without prefix properly (adodb_log) --- .../classes/generators/XMLDBGenerator.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/xmldb/classes/generators/XMLDBGenerator.class.php b/lib/xmldb/classes/generators/XMLDBGenerator.class.php index 2c3f48e351..36d59b390a 100644 --- a/lib/xmldb/classes/generators/XMLDBGenerator.class.php +++ b/lib/xmldb/classes/generators/XMLDBGenerator.class.php @@ -447,18 +447,31 @@ class XMLDBgenerator { */ function getDropTableSQL($xmldb_table) { + $tempprefix = ''; + /// If the table needs to be created without prefix + if (in_array($xmldb_table->getName(), $this->getTablesWithoutPrefix())) { + /// Save current prefix to be restore later + $tempprefix = $this->prefix; + /// Empty prefix + $this->prefix = ''; + } + $results = array(); //Array where all the sentences will be stored $drop = str_replace('TABLENAME', $this->getEncQuoted($this->prefix . $xmldb_table->getName()), $this->drop_table_sql); $results[] = $drop; - /// TODO, call to getDropTableExtraSQL() if $rename_table_extra_code is enabled. It will add sequence/trigger drop code. + /// call to getDropTableExtraSQL() if $rename_table_extra_code is enabled. It will add sequence/trigger drop code. if ($this->drop_table_extra_code) { $extra_sentences = $this->getDropTableExtraSQL($xmldb_table); $results = array_merge($results, $extra_sentences); } + /// Re-set the original prefix if it has changed + if ($tempprefix) { + $this->prefix = $tempprefix; + } return $results; } -- 2.39.5