Add notice that FOR UPDATE is incompatible with aggregates
authorLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Thu, 16 May 2019 09:46:23 +0000 (11:46 +0200)
committerLucas Werkmeister <lucas.werkmeister@wikimedia.de>
Thu, 16 May 2019 09:51:43 +0000 (11:51 +0200)
On some database types, combining locking reads with aggregate functions
is not allowed, and MediaWiki detects such cases and logs a deprecation
warning (on all database types), so we don’t really want people to use
this even if the target database type happens to support it. Add a
warning to the documentation.

Change-Id: Ib6fd2148aeb0c94c0a13b33aec08e3308c740b01

includes/libs/rdbms/database/IDatabase.php

index 05f787c..7452278 100644 (file)
@@ -713,7 +713,8 @@ interface IDatabase {
         *     is applied to a result set after OFFSET.
         *
         *   - FOR UPDATE: Boolean: lock the returned rows so that they can't be
-        *     changed until the next COMMIT.
+        *     changed until the next COMMIT. Cannot be used with aggregate functions
+        *     (COUNT, MAX, etc., but also DISTINCT).
         *
         *   - DISTINCT: Boolean: return only unique result rows.
         *