From 7d554d1ad598b36cb6e5999086c563ed9c45c0d8 Mon Sep 17 00:00:00 2001 From: Magnus Manske Date: Fri, 18 Mar 2005 09:20:17 +0000 Subject: [PATCH] Bypassing UNION SQL for mysql3 --- includes/Block.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Block.php b/includes/Block.php index 5ea64f60f0..f97cabce15 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -63,6 +63,7 @@ class Block */ function load( $address = '', $user = 0, $killExpired = true ) { + global $wgDBmysql4 ; $fname = 'Block::load'; wfDebug( "Block::load: '$address', '$user', $killExpired\n" ); @@ -83,7 +84,7 @@ class Block $sql = "SELECT * FROM $ipblocks WHERE ipb_user={$user} $options"; } elseif ($user=="") { $sql = "SELECT * FROM $ipblocks WHERE ipb_address='" . $db->strencode( $address ) . "' $options"; - } elseif ( $options=='' ) { + } elseif ( $options=='' && $wgDBmysql4 ) { # If there are no optiones (e.g. FOR UPDATE), use a UNION # so that the query can make efficient use of indices $sql = "SELECT * FROM $ipblocks WHERE ipb_address='" . $db->strencode( $address ) . -- 2.20.1