From d86fccf9c909602c37ec97577a19dc442e22206b Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 14 Oct 2011 04:29:53 +0200 Subject: [ticket/10327] Change CREATE INDEX to ALTER TABLE table ADD INDEX for MySQL. * CREATE INDEX is internally mapped to an ALTER INDEX statement. * CREATE INDEX requires the INDEX permission. * ALTER TABLE requires the (more powerful) ALTER permission. * We require the ALTER permission anyway for operation. * Changing CREATE INDEX to ALTER TABLE thus removes dependency on the INDEX permission which is good because some management software does not give out the INDEX permission by default. http://dev.mysql.com/doc/refman/5.0/en/create-index.html PHPBB3-10327 --- phpBB/includes/db/db_tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB') diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 10ca6c0a1f..0d8cf7fdab 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -2145,7 +2145,7 @@ class phpbb_db_tools } // no break case 'mysql_41': - $statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')'; + $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . '(' . implode(', ', $column) . ')'; break; case 'mssql': -- cgit v1.2.1