X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdb%2FDatabasePostgres.php;h=f5fdca1fb9b8334849ca82e943614ea3c70d6d7d;hb=c80376f7d9178cc6647c0ce5710a7c61a2ad0e96;hp=3d7267aba4026ebefa0b0231e21a7a1ea7167619;hpb=cc54e1fa85762cf5b0f891ff0271b780eda28019;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 3d7267aba4..f5fdca1fb9 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -827,6 +827,8 @@ __INDEXATTR__; * In Postgres when using FOR UPDATE, only the main table and tables that are inner joined * can be locked. That means tables in an outer join cannot be FOR UPDATE locked. Trying to do * so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly. + * + * MySQL uses "ORDER BY NULL" as an optimization hint, but that syntax is illegal in PostgreSQL. */ function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__, $options = array(), $join_conds = array() @@ -842,6 +844,10 @@ __INDEXATTR__; } } } + + if ( isset( $options['ORDER BY'] ) && $options['ORDER BY'] == 'NULL' ) { + unset( $options['ORDER BY'] ); + } } return parent::selectSQLText( $table, $vars, $conds, $fname, $options, $join_conds ); @@ -1229,7 +1235,7 @@ __INDEXATTR__; * @see getSearchPath() * @see setSearchPath() * @since 1.19 - * @return array list of actual schemas for the current sesson + * @return array List of actual schemas for the current sesson */ function getSchemas() { $res = $this->query( "SELECT current_schemas(false)", __METHOD__ ); @@ -1316,7 +1322,7 @@ __INDEXATTR__; * Return schema name fore core MediaWiki tables * * @since 1.19 - * @return string core schema name + * @return string Core schema name */ function getCoreSchema() { return $this->mCoreSchema; @@ -1540,7 +1546,7 @@ SQL; /** * Various select options * - * @param array $options an associative array of options to be turned into + * @param array $options An associative array of options to be turned into * an SQL query, valid keys are listed in the function. * @return array */