mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
fix r9713 for #36565
Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9931 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d0e9e4189c
commit
ee65d2147b
11 changed files with 18 additions and 8 deletions
|
@ -1305,6 +1305,7 @@ function get_schema_struct()
|
||||||
'poster_ip' => array('INDEX', 'poster_ip'),
|
'poster_ip' => array('INDEX', 'poster_ip'),
|
||||||
'poster_id' => array('INDEX', 'poster_id'),
|
'poster_id' => array('INDEX', 'poster_id'),
|
||||||
'post_approved' => array('INDEX', 'post_approved'),
|
'post_approved' => array('INDEX', 'post_approved'),
|
||||||
|
'post_username' => array('INDEX', 'post_username'),
|
||||||
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
|
'tid_post_time' => array('INDEX', array('topic_id', 'post_time')),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -444,8 +444,7 @@ class fulltext_mysql extends search_backend
|
||||||
if (sizeof($author_ary) && $author_name)
|
if (sizeof($author_ary) && $author_name)
|
||||||
{
|
{
|
||||||
// first one matches post of registered users, second one guests and deleted users
|
// first one matches post of registered users, second one guests and deleted users
|
||||||
$sql_author = ' AND (' . $db->sql_in_set('p.poster_id', $author_ary) . " AND p.post_username = ''";
|
$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
|
||||||
$sql_author .= ' OR p.poster_id = ' . ANONYMOUS . ' AND p.post_username ' . $author_name . ')';
|
|
||||||
}
|
}
|
||||||
else if (sizeof($author_ary))
|
else if (sizeof($author_ary))
|
||||||
{
|
{
|
||||||
|
@ -553,8 +552,7 @@ class fulltext_mysql extends search_backend
|
||||||
if ($author_name)
|
if ($author_name)
|
||||||
{
|
{
|
||||||
// first one matches post of registered users, second one guests and deleted users
|
// first one matches post of registered users, second one guests and deleted users
|
||||||
$sql_author = '(' . $db->sql_in_set('p.poster_id', $author_ary) . " AND p.post_username = ''";
|
$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
|
||||||
$sql_author .= ' OR p.poster_id = ' . ANONYMOUS . ' AND p.post_username ' . $author_name . ')';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -628,8 +628,7 @@ class fulltext_native extends search_backend
|
||||||
if ($author_name)
|
if ($author_name)
|
||||||
{
|
{
|
||||||
// first one matches post of registered users, second one guests and deleted users
|
// first one matches post of registered users, second one guests and deleted users
|
||||||
$sql_author = '(' . $db->sql_in_set('p.poster_id', $author_ary) . " AND p.post_username = ''";
|
$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
|
||||||
$sql_author .= ' OR p.poster_id = ' . ANONYMOUS . ' AND p.post_username ' . $author_name . ')';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -840,8 +839,7 @@ class fulltext_native extends search_backend
|
||||||
if ($author_name)
|
if ($author_name)
|
||||||
{
|
{
|
||||||
// first one matches post of registered users, second one guests and deleted users
|
// first one matches post of registered users, second one guests and deleted users
|
||||||
$sql_author = '(' . $db->sql_in_set('p.poster_id', $author_ary) . " AND p.post_username = ''";
|
$sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
|
||||||
$sql_author .= ' OR p.poster_id = ' . ANONYMOUS . ' AND p.post_username ' . $author_name . ')';
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -721,6 +721,9 @@ function database_update_info()
|
||||||
'post_id' => array('post_id'),
|
'post_id' => array('post_id'),
|
||||||
'pm_id' => array('pm_id'),
|
'pm_id' => array('pm_id'),
|
||||||
),
|
),
|
||||||
|
POSTS_TABLE => array(
|
||||||
|
'post_username' => array('post_username'),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -650,6 +650,7 @@ CREATE INDEX phpbb_posts_topic_id ON phpbb_posts(topic_id);;
|
||||||
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);;
|
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts(poster_ip);;
|
||||||
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);;
|
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts(poster_id);;
|
||||||
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);;
|
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts(post_approved);;
|
||||||
|
CREATE INDEX phpbb_posts_post_username ON phpbb_posts(post_username);;
|
||||||
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);;
|
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts(topic_id, post_time);;
|
||||||
|
|
||||||
CREATE GENERATOR phpbb_posts_gen;;
|
CREATE GENERATOR phpbb_posts_gen;;
|
||||||
|
|
|
@ -803,6 +803,9 @@ GO
|
||||||
CREATE INDEX [post_approved] ON [phpbb_posts]([post_approved]) ON [PRIMARY]
|
CREATE INDEX [post_approved] ON [phpbb_posts]([post_approved]) ON [PRIMARY]
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
CREATE INDEX [post_username] ON [phpbb_posts]([post_username]) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time]) ON [PRIMARY]
|
CREATE INDEX [tid_post_time] ON [phpbb_posts]([topic_id], [post_time]) ON [PRIMARY]
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
|
@ -459,6 +459,7 @@ CREATE TABLE phpbb_posts (
|
||||||
KEY poster_ip (poster_ip),
|
KEY poster_ip (poster_ip),
|
||||||
KEY poster_id (poster_id),
|
KEY poster_id (poster_id),
|
||||||
KEY post_approved (post_approved),
|
KEY post_approved (post_approved),
|
||||||
|
KEY post_username (post_username(255)),
|
||||||
KEY tid_post_time (topic_id, post_time)
|
KEY tid_post_time (topic_id, post_time)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -459,6 +459,7 @@ CREATE TABLE phpbb_posts (
|
||||||
KEY poster_ip (poster_ip),
|
KEY poster_ip (poster_ip),
|
||||||
KEY poster_id (poster_id),
|
KEY poster_id (poster_id),
|
||||||
KEY post_approved (post_approved),
|
KEY post_approved (post_approved),
|
||||||
|
KEY post_username (post_username),
|
||||||
KEY tid_post_time (topic_id, post_time)
|
KEY tid_post_time (topic_id, post_time)
|
||||||
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
|
) CHARACTER SET `utf8` COLLATE `utf8_bin`;
|
||||||
|
|
||||||
|
|
|
@ -879,6 +879,8 @@ CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id)
|
||||||
/
|
/
|
||||||
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved)
|
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved)
|
||||||
/
|
/
|
||||||
|
CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username)
|
||||||
|
/
|
||||||
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time)
|
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time)
|
||||||
/
|
/
|
||||||
|
|
||||||
|
|
|
@ -630,6 +630,7 @@ CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
|
||||||
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
|
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
|
||||||
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
|
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
|
||||||
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
|
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
|
||||||
|
CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
|
||||||
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
|
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -447,6 +447,7 @@ CREATE INDEX phpbb_posts_topic_id ON phpbb_posts (topic_id);
|
||||||
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
|
CREATE INDEX phpbb_posts_poster_ip ON phpbb_posts (poster_ip);
|
||||||
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
|
CREATE INDEX phpbb_posts_poster_id ON phpbb_posts (poster_id);
|
||||||
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
|
CREATE INDEX phpbb_posts_post_approved ON phpbb_posts (post_approved);
|
||||||
|
CREATE INDEX phpbb_posts_post_username ON phpbb_posts (post_username);
|
||||||
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
|
CREATE INDEX phpbb_posts_tid_post_time ON phpbb_posts (topic_id, post_time);
|
||||||
|
|
||||||
# Table: 'phpbb_privmsgs'
|
# Table: 'phpbb_privmsgs'
|
||||||
|
|
Loading…
Add table
Reference in a new issue