From: Lucas Werkmeister Date: Thu, 16 May 2019 09:46:23 +0000 (+0200) Subject: Add notice that FOR UPDATE is incompatible with aggregates X-Git-Tag: 1.34.0-rc.0~1683 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=634f0159766d60e3d8eb7a872247231622aa071b;p=lhc%2Fweb%2Fwiklou.git Add notice that FOR UPDATE is incompatible with aggregates 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 --- 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. *