diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index e89f009242..d4821d0d5d 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1256,7 +1256,7 @@ function get_schema_struct()
'enable_magic_url' => array('BOOL', 1),
'enable_sig' => array('BOOL', 1),
'post_username' => array('VCHAR_UNI:255', ''),
- 'post_subject' => array('XSTEXT_UNI', ''),
+ 'post_subject' => array('XSTEXT_UNI', '', 'true_sort'),
'post_text' => array('MTEXT_UNI', ''),
'post_checksum' => array('VCHAR:32', ''),
'post_attachment' => array('BOOL', 0),
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index bfac176f73..214829722b 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -208,6 +208,7 @@ p a {
[Fix] Display correct message if no attachments found in user administration (Bug #11629)
[Fix] Let the "Delete all board cookies" being displayed for guests too (only prosilver) (Bug #11603)
[Fix] Do not display view topic link in MCP while there is no link present (Bug #11573)
+ [Fix] MySQL now properly sorts by post_subject (Bug #11637)
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 67f3258087..0344eb3085 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -698,7 +698,7 @@ class fulltext_mysql extends search_backend
{
if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>='))
{
- $alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
+ //$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
}
else
{
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 6002f3e556..5ba0c9f50f 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -607,6 +607,11 @@ if (version_compare($current_version, '3.0.RC1', '<='))
$db->sql_query($sql);
}
+ if ($map_dbms === 'mysql_41')
+ {
+ sql_column_change($map_dbms, POSTS_TABLE, 'post_subject', array('XSTEXT_UNI', '', 'true_sort'));
+ }
+
$no_updates = false;
}
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index a4eb2519aa..0838947c76 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -243,7 +243,7 @@ CREATE TABLE phpbb_forums (
forum_topics_real mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
forum_last_post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
forum_last_poster_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
- forum_last_post_subject varchar(100) DEFAULT '' NOT NULL,
+ forum_last_post_subject varchar(100) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci,
forum_last_post_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
forum_last_poster_name varchar(255) DEFAULT '' NOT NULL,
forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL,