From eda444e2175bad10dc7f3c5297a4c8edebb628d5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 6 Aug 2004 19:07:55 +0000 Subject: [PATCH] Wrap Database::setTimer() in a check for existence of mysql_thread_id() function which was added in 4.3.0. If it's not available, don't set up the thread killer. --- includes/Database.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/Database.php b/includes/Database.php index b76b2f2a3e..1680761f49 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -650,9 +650,11 @@ class Database { function startTimer( $timeout ) { global $IP; - - $tid = mysql_thread_id( $this->mConn ); - exec( "php $IP/killthread.php $timeout $tid &>/dev/null &" ); + if( function_exists( "mysql_thread_id" ) ) { + # This will kill the query if it's still running after $timeout seconds. + $tid = mysql_thread_id( $this->mConn ); + exec( "php $IP/killthread.php $timeout $tid &>/dev/null &" ); + } } function stopTimer() -- 2.20.1