From ada5648103e591e471c9ae4524f425c805666f8d Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 16 Aug 2006 23:01:46 +0000 Subject: [PATCH] Fixing some potential problems with prefixes and object names. --- lib/xmldb/classes/generators/XMLDBGenerator.class.php | 2 +- lib/xmldb/classes/generators/mssql/mssql.class.php | 7 ------- lib/xmldb/classes/generators/mysql/mysql.class.php | 7 ------- .../classes/generators/postgres7/postgres7.class.php | 9 +-------- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/lib/xmldb/classes/generators/XMLDBGenerator.class.php b/lib/xmldb/classes/generators/XMLDBGenerator.class.php index ceab6a5732..bc90e79ca6 100644 --- a/lib/xmldb/classes/generators/XMLDBGenerator.class.php +++ b/lib/xmldb/classes/generators/XMLDBGenerator.class.php @@ -233,7 +233,7 @@ class XMLDBgenerator { $index = 'CREATE' . $unique . ' INDEX '; $index .= $this->getNameForObject($xmldb_table->getName(), implode(', ', $xmldb_index->getFields()), $suffix); - $index .= ' ON ' . $this->prefix . $this->getEncQuoted($xmldb_table->getName()); + $index .= ' ON ' . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); $index .= ' (' . implode(', ', $this->getEncQuoted($xmldb_index->getFields())) . ');'; return $index; diff --git a/lib/xmldb/classes/generators/mssql/mssql.class.php b/lib/xmldb/classes/generators/mssql/mssql.class.php index cf55554641..c345260519 100644 --- a/lib/xmldb/classes/generators/mssql/mssql.class.php +++ b/lib/xmldb/classes/generators/mssql/mssql.class.php @@ -60,13 +60,6 @@ class XMLDBmssql extends XMLDBgenerator { $this->reserved_words = $this->getReservedWords(); } - /** - * Set the prefix - */ - function setPrefix($prefix) { - $this->prefix = $prefix; - } - /** * Given one XMLDB Type, lenght and decimals, returns the DB proper SQL type */ diff --git a/lib/xmldb/classes/generators/mysql/mysql.class.php b/lib/xmldb/classes/generators/mysql/mysql.class.php index 4493e3dc6f..af2da9a2c6 100644 --- a/lib/xmldb/classes/generators/mysql/mysql.class.php +++ b/lib/xmldb/classes/generators/mysql/mysql.class.php @@ -58,13 +58,6 @@ class XMLDBmysql extends XMLDBGenerator { $this->reserved_words = $this->getReservedWords(); } - /** - * Set the prefix - */ - function setPrefix($prefix) { - $this->prefix = $prefix; - } - /** * Given one XMLDB Type, lenght and decimals, returns the DB proper SQL type */ diff --git a/lib/xmldb/classes/generators/postgres7/postgres7.class.php b/lib/xmldb/classes/generators/postgres7/postgres7.class.php index 9f9d76260a..b0db03e0c6 100644 --- a/lib/xmldb/classes/generators/postgres7/postgres7.class.php +++ b/lib/xmldb/classes/generators/postgres7/postgres7.class.php @@ -58,13 +58,6 @@ class XMLDBpostgres7 extends XMLDBgenerator { $this->reserved_words = $this->getReservedWords(); } - /** - * Set the prefix - */ - function setPrefix($prefix) { - $this->prefix = $prefix; - } - /** * Given one XMLDB Type, lenght and decimals, returns the DB proper SQL type */ @@ -139,7 +132,7 @@ class XMLDBpostgres7 extends XMLDBgenerator { */ function getCommentSQL ($xmldb_table) { - $comment = ";\n\nCOMMENT ON TABLE " . $this->prefix . $this->getEncQuoted($xmldb_table->getName()); + $comment = ";\n\nCOMMENT ON TABLE " . $this->getEncQuoted($this->prefix . $xmldb_table->getName()); $comment.= " IS '" . substr($xmldb_table->getComment(), 0, 250) . "'"; return $comment; -- 2.39.5