From 634f0159766d60e3d8eb7a872247231622aa071b Mon Sep 17 00:00:00 2001 From: Lucas Werkmeister Date: Thu, 16 May 2019 11:46:23 +0200 Subject: [PATCH] Add notice that FOR UPDATE is incompatible with aggregates MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/libs/rdbms/database/IDatabase.php b/includes/libs/rdbms/database/IDatabase.php index 05f787cfa9..7452278796 100644 --- a/includes/libs/rdbms/database/IDatabase.php +++ b/includes/libs/rdbms/database/IDatabase.php @@ -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. * -- 2.20.1