Merge "DatabasePostgres: Ignore "IGNORE" option to update()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 26 Feb 2019 05:30:36 +0000 (05:30 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 26 Feb 2019 05:30:36 +0000 (05:30 +0000)
includes/libs/rdbms/database/DatabasePostgres.php
maintenance/populateExternallinksIndex60.php

index 0935d5a..381b1fd 100644 (file)
@@ -653,6 +653,18 @@ __INDEXATTR__;
                return true;
        }
 
+       protected function makeUpdateOptionsArray( $options ) {
+               if ( !is_array( $options ) ) {
+                       $options = [ $options ];
+               }
+
+               // PostgreSQL doesn't support anything like "ignore" for
+               // UPDATE.
+               $options = array_diff( $options, [ 'IGNORE' ] );
+
+               return parent::makeUpdateOptionsArray( $options );
+       }
+
        /**
         * INSERT SELECT wrapper
         * $varMap must be an associative array of the form [ 'dest1' => 'source1', ... ]
index 9b029fe..695773e 100644 (file)
@@ -73,7 +73,7 @@ class PopulateExternallinksIndex60 extends LoggedUpdateMaintenance {
                                        ],
                                        [
                                                'el_id' => $row->el_id,
-                                       ], __METHOD__, [ 'IGNORE' ]
+                                       ], __METHOD__
                                );
                        }
                        wfWaitForSlaves();