From ddd5acf9004b8094e5c6110fc940eb7bdc4c69ac Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 6 Jan 2010 04:05:49 +0000 Subject: [PATCH] Don't count unions of bracketed selects as being write queries --- includes/db/Database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 36f34a3035..b1b0441b7d 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -422,7 +422,7 @@ abstract class DatabaseBase { * Should return true if unsure. */ function isWriteQuery( $sql ) { - return !preg_match( '/^(?:SELECT|BEGIN|COMMIT|SET|SHOW)\b/i', $sql ); + return !preg_match( '/^(?:SELECT|BEGIN|COMMIT|SET|SHOW|\(SELECT)\b/i', $sql ); } /** @@ -2853,4 +2853,4 @@ class LikeMatch { public function toString() { return $this->str; } -} \ No newline at end of file +} -- 2.20.1