Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-6415 now.

Google Bot creates SQL Errors (fix completed in vcs)

-----------------
SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'AND topic_moved_id = 0\n AND topic_last_post_time < \n AND topic_approved = \' at line 4 [1064]

SQL

SELECT topic_id, forum_id\n FROM phpbb_topics\n WHERE forum_id = \n AND topic_moved_id = 0\n AND topic_last_post_time < \n AND topic_approved = 1\n ORDER BY topic_last_post_time DESC\n LIMIT 1

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal->sql_error()

FILE: includes/db/mysql.php
LINE: 205
CALL: dbal_mysql->sql_query()

FILE: includes/db/dbal.php
LINE: 153
CALL: dbal_mysql->_sql_query_limit()

FILE: viewtopic.php
LINE: 134
CALL: dbal->sql_query_limit()
------------------------------------------
The call error happens when someone calls view next or prev when $row['topic_last_post_time'] is empty...

I added in front of that sql the following code that fixes it


if (!$row['topic_last_post_time'])
{
$user->setup('viewtopic');
trigger_error(($view == 'next') ? 'NO_NEWER_TOPICS' : 'NO_OLDER_TOPICS');
}

Comments / History

Changed ticket status from "New" to "Fix in progress"

Action performed by Kellanved (Former Team Member) on Nov 5th 2007, 23:53

Assigned ticket to user "Kellanved"

Action performed by Kellanved (Former Team Member) on Nov 5th 2007, 23:53

Linked ticket with changeset: r8228

Action performed by Kellanved (Former Team Member) on Nov 6th 2007, 00:05

Changed ticket status from "Fix in progress" to "Fix completed in CVS"

Action performed by Kellanved (Former Team Member) on Nov 6th 2007, 00:07

Ticket details

Related SVN changesets