]> git.mjollnir.org Git - moodle.git/commitdiff
Delete the tweakTempTable() thing used to support temp tables in mssql.
authorstronk7 <stronk7>
Fri, 28 Aug 2009 17:30:18 +0000 (17:30 +0000)
committerstronk7 <stronk7>
Fri, 28 Aug 2009 17:30:18 +0000 (17:30 +0000)
Was hacky and incomplete. Proper solution must be mssql exclusive.

lib/ddl/database_manager.php
lib/ddl/mssql_sql_generator.php
lib/ddl/sql_generator.php

index fe9dd84fafd8d2b7cf0c7a27752a97135322ff37..3015cf1f41a5cc6b03eeaaf9e9d401f0d774c559 100644 (file)
@@ -492,8 +492,6 @@ class database_manager {
      * @return void
      */
     public function create_temp_table(xmldb_table $xmldb_table) {
-    /// hack for mssql - it requires names to start with #
-        $xmldb_table = $this->generator->tweakTempTable($xmldb_table);
 
     /// Check table doesn't exist
         if ($this->table_exists($xmldb_table, true)) {
@@ -517,8 +515,6 @@ class database_manager {
      * @return void
      */
     public function drop_temp_table(xmldb_table $xmldb_table) {
-    /// mssql requires names to start with #
-        $xmldb_table = $this->generator->tweakTempTable($xmldb_table);
 
     /// Check table doesn't exist
         if (!$this->table_exists($xmldb_table, true)) {
index 3484262a3c1ffe1f2f8e81c7b3199b362904265d..71d83ddae726d1c1de7f7aba3a985a6c1953434e 100644 (file)
@@ -124,16 +124,6 @@ class mssql_sql_generator extends sql_generator {
         return $sqlarr;
     }
 
-    /**
-     * Tweaks the temp table instance - required for mssql # naming
-     */
-    public function tweakTempTable($xmldb_table) {
-        if (strpos($xmldb_table->getName(), '#') !== 0) {
-            $xmldb_table->setName('#'.$xmldb_table->getName()); // MSSQL requires temp table names to start with #
-        }
-        return $xmldb_table;
-    }
-
     /**
      * Given one XMLDB Type, lenght and decimals, returns the DB proper SQL type
      */
index 44e57df6a820f0e447f402134c37a30e049a7aac..4b6dc5471b8d5c87a8b1e64ce14c39492458619c 100644 (file)
@@ -370,13 +370,6 @@ abstract class sql_generator {
         return $sqlarr;
     }
 
-    /**
-     * Tweaks the temp table instance - required for mssql # naming
-     */
-    public function tweakTempTable($xmldb_table) {
-        return $xmldb_table;
-    }
-
     /**
      * Given one correct xmldb_index, returns the SQL statements
      * needed to create it (in array)