Merge "Fix grammatical error in several comments"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 8 Aug 2019 18:19:58 +0000 (18:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 8 Aug 2019 18:19:58 +0000 (18:19 +0000)
includes/jobqueue/JobQueueDB.php
includes/libs/rdbms/database/DatabaseMysqli.php

index f7b8ed2..d449e8a 100644 (file)
@@ -690,9 +690,9 @@ class JobQueueDB extends JobQueue {
                                        $dbw->update( 'job',
                                                [
                                                        'job_token' => '',
-                                                       'job_token_timestamp' => $dbw->timestamp( $now ) ], // time of release
-                                               [
-                                                       'job_id' => $ids ],
+                                                       'job_token_timestamp' => $dbw->timestamp( $now ) // time of release
+                                               ],
+                                               [ 'job_id' => $ids, "job_token != ''" ],
                                                __METHOD__
                                        );
                                        $affected = $dbw->affectedRows();
index ddb3944..4c18911 100644 (file)
@@ -82,8 +82,10 @@ class DatabaseMysqli extends DatabaseMysqlBase {
                }
 
                $mysqli = mysqli_init();
-
-               $connFlags = 0;
+               // Make affectedRows() for UPDATE reflect the number of matching rows, regardless
+               // of whether any column values changed. This is what callers want to know and is
+               // consistent with what Postgres, SQLite, and SQL Server return.
+               $connFlags = MYSQLI_CLIENT_FOUND_ROWS;
                if ( $this->getFlag( self::DBO_SSL ) ) {
                        $connFlags |= MYSQLI_CLIENT_SSL;
                        $mysqli->ssl_set(