1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [task/git-tools] Change the GNU --lines argument to the POSIX -l
  [task/git-tools] Solve dependency on the GNU wc --max-line-length option
  [ticket/8944] Patch db_tools to support index length for MySQL4
  [ticket/9039] Make mssqlnative.php non-executable
  [ticket/8944] Add index length to CREATE INDEX for MySQL4 in database_update
  [ticket/9800] Update tracker URL in docs/README.html
This commit is contained in:
Igor Wiedler
2010-09-09 00:23:33 +02:00
5 changed files with 41 additions and 8 deletions

View File

@@ -611,7 +611,7 @@ class phpbb_db_tools
* drop_columns: Removing/Dropping columns
* add_primary_keys: adding primary keys
* add_unique_index: adding an unique index
* add_index: adding an index
* add_index: adding an index (can be column:index_size if you need to provide size)
*
* The values are in this format:
* {TABLE NAME} => array(
@@ -1804,6 +1804,12 @@ class phpbb_db_tools
{
$statements = array();
// remove index length unless MySQL4
if ('mysql_40' != $this->sql_layer)
{
$column = preg_replace('#:.*$#', '', $column);
}
switch ($this->sql_layer)
{
case 'firebird':
@@ -1814,6 +1820,16 @@ class phpbb_db_tools
break;
case 'mysql_40':
// add index size to definition as required by MySQL4
foreach ($column as $i => $col)
{
if (false !== strpos($col, ':'))
{
list($col, $index_size) = explode(':', $col);
$column[$i] = "$col($index_size)";
}
}
// no break
case 'mysql_41':
$statements[] = 'CREATE INDEX ' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
break;

0
phpBB/includes/db/mssqlnative.php Executable file → Normal file
View File