NOBUG postgresql driver - better index names detection. Related to MDL-22804
authorEloy Lafuente <stronk7@moodle.org>
Wed, 16 Jun 2010 15:46:08 +0000 (15:46 +0000)
committerEloy Lafuente <stronk7@moodle.org>
Wed, 16 Jun 2010 15:46:08 +0000 (15:46 +0000)
lib/dml/pgsql_native_moodle_database.php

index 28df53a..cd5ddf2 100644 (file)
@@ -322,7 +322,7 @@ class pgsql_native_moodle_database extends moodle_database {
                 }
                 $columns = explode(',', $matches[4]);
                 $columns = array_map(array($this, 'trim_quotes'), $columns);
-                $indexes[$matches[2]] = array('unique'=>!empty($matches[1]),
+                $indexes[$row['indexname']] = array('unique'=>!empty($matches[1]),
                                               'columns'=>$columns);
             }
             pg_free_result($result);