diff options
author | Nils Adermann <naderman@naderman.de> | 2006-12-16 20:24:34 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2006-12-16 20:24:34 +0000 |
commit | 1e34820cd87837b545b310022ee460803d8c5b54 (patch) | |
tree | 8cb1026f115e8fe067d770b2bbc5fa4a42de1ce1 /phpBB/includes/search/fulltext_mysql.php | |
parent | 6938688e75e703208bd1087be8f37383da8e3f15 (diff) | |
download | forums-1e34820cd87837b545b310022ee460803d8c5b54.tar forums-1e34820cd87837b545b310022ee460803d8c5b54.tar.gz forums-1e34820cd87837b545b310022ee460803d8c5b54.tar.bz2 forums-1e34820cd87837b545b310022ee460803d8c5b54.tar.xz forums-1e34820cd87837b545b310022ee460803d8c5b54.zip |
- Optimize acl_getf_global a bit
- a little performance improvement of the IP regular expressions
- convert post_text/subject collation to utf8_unicode_ci if a user wants to use mysql_fulltext to allow case insensitivity [Bug #6272]
- mysql_fulltext should alter all necessary columns at once to speed up the process
- validate URLs against RFC3986
- fixed some weirdness in make_clickable
I hope I didn't break any URLs with this commit, if I did then report it to the bugtracker please!
git-svn-id: file:///svn/phpbb/trunk@6774 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/search/fulltext_mysql.php')
-rw-r--r-- | phpBB/includes/search/fulltext_mysql.php | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 598299e316..490b676906 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -639,14 +639,29 @@ class fulltext_mysql extends search_backend $this->get_stats(); } + $alter = array(); + if (!isset($this->stats['post_subject'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_subject)'); + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; + } + $alter[] = 'ADD FULLTEXT (post_subject)'; } if (!isset($this->stats['post_text'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_text)'); + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; + } + $alter[] = 'ADD FULLTEXT (post_text)'; + } + + if (sizeof($alter)) + { + $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); } $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); @@ -672,14 +687,21 @@ class fulltext_mysql extends search_backend $this->get_stats(); } + $alter = array(); + if (isset($this->stats['post_subject'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_subject'); + $alter[] = 'DROP INDEX post_subject'; } if (isset($this->stats['post_text'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_text'); + $alter[] = 'DROP INDEX post_text'; + } + + if (sizeof($alter)) + { + $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); } $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); |