1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[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
This commit is contained in:
Andreas Fischer
2011-10-14 04:29:53 +02:00
parent 4e69fe6859
commit d86fccf9c9
2 changed files with 19 additions and 1 deletions

View File

@@ -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':