SHOW INDEX works in MySQL 3.23.58, but SHOW INDEXES does not.
authorJerome Jamnicky <jeronim@users.mediawiki.org>
Mon, 24 May 2004 22:24:49 +0000 (22:24 +0000)
committerJerome Jamnicky <jeronim@users.mediawiki.org>
Mon, 24 May 2004 22:24:49 +0000 (22:24 +0000)
SHOW INDEX should work for 3.x and up:
http://dev.mysql.com/doc/mysql/en/SHOW_INDEX.html

includes/Database.php

index db203fb..a3b4c45 100644 (file)
@@ -316,7 +316,10 @@ class Database {
        # If errors are explicitly ignored, returns NULL on failure
        function indexExists( $table, $index, $fname = "Database::indexExists" ) 
        {
-               $sql = "SHOW INDEXES FROM $table";
+               # SHOW INDEX works in MySQL 3.23.58, but SHOW INDEXES does not.
+               # SHOW INDEX should work for 3.x and up:
+               # http://dev.mysql.com/doc/mysql/en/SHOW_INDEX.html
+               $sql = "SHOW INDEX FROM $table";
                $res = $this->query( $sql, DB_READ, $fname );
                if ( !$res ) {
                        return NULL;