Removed deprecated class ImageGallery
[lhc/web/wiklou.git] / includes / api / ApiQueryBacklinksprop.php
index 236fb9e..ef7b9af 100644 (file)
@@ -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__ );