Don't count unions of bracketed selects as being write queries
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 6 Jan 2010 04:05:49 +0000 (04:05 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 6 Jan 2010 04:05:49 +0000 (04:05 +0000)
includes/db/Database.php

index 36f34a3..b1b0441 100644 (file)
@@ -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
+}