diff options
author | Igor Wiedler <igor@wiedler.ch> | 2010-09-09 00:23:33 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2010-09-09 00:23:33 +0200 |
commit | 2baa8c61d119707246f87372bb9e8036fcfc99fb (patch) | |
tree | cacdb325fbf48e4d2d6875d2642a274f5f2bfb0a | |
parent | ea4d204cf68b3cee2bfb0633085e4ebdadeb3a80 (diff) | |
parent | 2e891c5eba78d68796dc6854d5805af2e3978641 (diff) | |
download | forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar.gz forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar.bz2 forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.tar.xz forums-2baa8c61d119707246f87372bb9e8036fcfc99fb.zip |
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
-rwxr-xr-x | git-tools/hooks/commit-msg | 9 | ||||
-rw-r--r-- | phpBB/docs/README.html | 2 | ||||
-rw-r--r-- | phpBB/includes/db/db_tools.php | 18 | ||||
-rw-r--r--[-rwxr-xr-x] | phpBB/includes/db/mssqlnative.php | 0 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 20 |
5 files changed, 41 insertions, 8 deletions
diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index d6ad57a38a..a6777ff9c9 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -55,16 +55,17 @@ quit() fi } -if [ "$(wc --max-line-length "$1" | cut -f1 -d" ")" -gt 80 ] +msg=$(grep -nE '.{81,}' "$1"); + +if [ $? -eq 0 ] then echo "The following lines are greater than 80 characters long:\n" >&2; - - grep -nE '.{81,}' "$1" >&2; + echo $msg >&2; quit $ERR_LENGTH; fi -lines=$(wc --lines "$1" | cut -f1 -d" "); +lines=$(wc -l "$1" | awk '{ print $1; }'); expecting=header; in_description=0; in_empty=0; diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 3510bc448e..bb88fdc01f 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -242,7 +242,7 @@ <p>The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums, they will be locked. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p> - <p><a href="http://www.phpbb.com/bugs/">http://www.phpbb.com/bugs/</a></p> + <p><a href="http://tracker.phpbb.com/">http://tracker.phpbb.com/</a></p> <p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p> diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php index 819ef69c96..f4b181c6ad 100644 --- a/phpBB/includes/db/db_tools.php +++ b/phpBB/includes/db/db_tools.php @@ -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; diff --git a/phpBB/includes/db/mssqlnative.php b/phpBB/includes/db/mssqlnative.php index 44d5722e4f..44d5722e4f 100755..100644 --- a/phpBB/includes/db/mssqlnative.php +++ b/phpBB/includes/db/mssqlnative.php diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fec09f89db..019469b061 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -880,7 +880,7 @@ function database_update_info() 'pm_id' => array('pm_id'), ), POSTS_TABLE => array( - 'post_username' => array('post_username'), + 'post_username' => array('post_username:255'), ), ), ), @@ -2141,7 +2141,7 @@ class updater_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( @@ -3520,6 +3520,12 @@ class updater_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': @@ -3530,6 +3536,16 @@ class updater_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; |