Merge branch 'MDL-34211' of git://github.com/appalachianstate/moodle into MOODLE_23_S...
authorDan Poltawski <dan@moodle.com>
Mon, 16 Jul 2012 03:15:55 +0000 (11:15 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 16 Jul 2012 03:15:55 +0000 (11:15 +0800)
lib/ddl/mysql_sql_generator.php

index abd5ddd..bbd6de2 100644 (file)
@@ -364,18 +364,14 @@ class mysql_sql_generator extends sql_generator {
      */
     public function isNameInUse($object_name, $type, $table_name) {
 
-        // Calculate the real table name
-        $xmldb_table = new xmldb_table($table_name);
-        $tname = $this->getTableName($xmldb_table);
-
         switch($type) {
             case 'ix':
             case 'uix':
                 // First of all, check table exists
                 $metatables = $this->mdb->get_tables();
-                if (isset($metatables[$tname])) {
+                if (isset($metatables[$table_name])) {
                     // Fetch all the indexes in the table
-                    if ($indexes = $this->mdb->get_indexes($tname)) {
+                    if ($indexes = $this->mdb->get_indexes($table_name)) {
                         // Look for existing index in array
                         if (isset($indexes[$object_name])) {
                             return true;