rdbms: do not treat SAVEPOINT and RELEASE SAVEPOINT as write queries
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Oct 2018 05:36:06 +0000 (22:36 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Oct 2018 05:36:06 +0000 (22:36 -0700)
Change-Id: Ib5d15d90260f30d08f3641a7fb36d82d363b012c

includes/libs/rdbms/database/Database.php

index 68d4c9a..3d23a83 100644 (file)
@@ -1052,7 +1052,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                //   that transactions by themselves don't make changes, only actual writes
                //   within the transaction matter, which we still detect.
                return !preg_match(
-                       '/^(?:SELECT|BEGIN|ROLLBACK|COMMIT|SET|SHOW|EXPLAIN|\(SELECT)\b/i', $sql );
+                       '/^(?:SELECT|BEGIN|ROLLBACK|COMMIT|SAVEPOINT|RELEASE|SET|SHOW|EXPLAIN|\(SELECT)\b/i',
+                       $sql
+               );
        }
 
        /**