diff options
author | rxu <rxu@mail.ru> | 2011-11-26 01:30:03 +0800 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2011-11-27 23:11:22 +0800 |
commit | 77e00d14a196d14910bdf2275ab01380b7b7f18f (patch) | |
tree | 2812269a3437e5428ce6d1d2ce0d96cb7bc0ee04 /phpBB/includes/functions.php | |
parent | e08e22ca127c24e9d958eb3025ed50a40f1dd8d8 (diff) | |
download | forums-77e00d14a196d14910bdf2275ab01380b7b7f18f.tar forums-77e00d14a196d14910bdf2275ab01380b7b7f18f.tar.gz forums-77e00d14a196d14910bdf2275ab01380b7b7f18f.tar.bz2 forums-77e00d14a196d14910bdf2275ab01380b7b7f18f.tar.xz forums-77e00d14a196d14910bdf2275ab01380b7b7f18f.zip |
[ticket/10497] Fix SQL error when guest visits forum with unread topic
Regression from the ticket PHPBB3-9008 fix.
When topic marking was enabled for guests, and a guest visited a forum with
a new topic which is marked unread, the built SQL missed an alias for a
TOPICS_TABLE which resulted in the following error:
Unknown column 't.topic_approved' in 'where clause' [1054]
The fix is to add an alias for the table.
PHPBB3-10497
PHPBB3-9008
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 944e53052b..7ce83b871a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1943,11 +1943,11 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti } else { - $sql = 'SELECT topic_id - FROM ' . TOPICS_TABLE . ' - WHERE forum_id = ' . $forum_id . ' - AND topic_last_post_time > ' . $mark_time_forum . ' - AND topic_moved_id = 0 ' . + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t + WHERE t.forum_id = ' . $forum_id . ' + AND t.topic_last_post_time > ' . $mark_time_forum . ' + AND t.topic_moved_id = 0 ' . $sql_update_unapproved; $result = $db->sql_query($sql); |