mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[feature/sphinx-fulltext-search] use CASE instead of IF
IF is not supported in pgsql, use CASE instead supported in both mysql and pgsql. PHPBB3-10946
This commit is contained in:
parent
118b57f71d
commit
b81941a997
2 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ source source_phpbb_{SPHINX_ID}_main
|
|||
p.forum_id,
\
|
||||
p.topic_id,
\
|
||||
p.poster_id,
\
|
||||
IF(p.post_id = t.topic_first_post_id, 1, 0) as topic_first_post,
\
|
||||
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
\
|
||||
p.post_time,
\
|
||||
p.post_subject,
\
|
||||
p.post_subject as title,
\
|
||||
|
@ -47,7 +47,7 @@ source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main
|
|||
p.forum_id,
\
|
||||
p.topic_id,
\
|
||||
p.poster_id,
\
|
||||
IF(p.post_id = t.topic_first_post_id, 1, 0) as topic_first_post,
\
|
||||
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
\
|
||||
p.post_time,
\
|
||||
p.post_subject,
\
|
||||
p.post_subject as title,
\
|
||||
|
|
|
@ -159,7 +159,7 @@ class phpbb_search_fulltext_sphinx
|
|||
p.forum_id,
|
||||
p.topic_id,
|
||||
p.poster_id,
|
||||
IF(p.post_id = t.topic_first_post_id, 1, 0) as topic_first_post,
|
||||
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
|
||||
p.post_time,
|
||||
p.post_subject,
|
||||
p.post_subject as title,
|
||||
|
@ -191,7 +191,7 @@ class phpbb_search_fulltext_sphinx
|
|||
p.forum_id,
|
||||
p.topic_id,
|
||||
p.poster_id,
|
||||
IF(p.post_id = t.topic_first_post_id, 1, 0) as topic_first_post,
|
||||
CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
|
||||
p.post_time,
|
||||
p.post_subject,
|
||||
p.post_subject as title,
|
||||
|
|
Loading…
Add table
Reference in a new issue