X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryBacklinksprop.php;h=ef7b9af9869f1fdc3331fd42bea6acb2ea8f0aad;hb=4e6810e4a2c1d821d8d108c7974ac16917561764;hp=236fb9e06c6621dc70492ec08178aa0c20d04ebf;hpb=99fefe9af6c35ded8e7c9da7bd099719f7133054;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryBacklinksprop.php b/includes/api/ApiQueryBacklinksprop.php index 236fb9e06c..ef7b9af986 100644 --- a/includes/api/ApiQueryBacklinksprop.php +++ b/includes/api/ApiQueryBacklinksprop.php @@ -238,7 +238,7 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase { if ( isset( $show['fragment'] ) && isset( $show['!fragment'] ) || isset( $show['redirect'] ) && isset( $show['!redirect'] ) ) { - $this->dieUsageMsg( 'show' ); + $this->dieWithError( 'apierror-show' ); } $this->addWhereIf( "rd_fragment != $emptyString", isset( $show['fragment'] ) ); $this->addWhereIf( @@ -264,6 +264,12 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase { } } + // MySQL (or at least 5.5.5-10.0.23-MariaDB) chooses a really bad query + // plan if it thinks there will be more matching rows in the linktable + // than are in page. Use STRAIGHT_JOIN here to force it to use the + // intended, fast plan. See T145079 for details. + $this->addOption( 'STRAIGHT_JOIN' ); + $this->addOption( 'LIMIT', $params['limit'] + 1 ); $res = $this->select( __METHOD__ );