Make SpecialWhatLinkshere::showIndirectLinks use buildSelectSubquery()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 28 Mar 2018 21:36:18 +0000 (14:36 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 28 Mar 2018 21:36:18 +0000 (14:36 -0700)
This avoids the SPI log warning from d395dfb039

Change-Id: I193418a224a8c6c0cc919e29c66686947d5969bf

includes/specials/SpecialWhatlinkshere.php

index 6f91c46..3080fbf 100644 (file)
@@ -162,7 +162,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        ];
                        $on['rd_namespace'] = $target->getNamespace();
                        // Inner LIMIT is 2X in case of stale backlinks with wrong namespaces
                        ];
                        $on['rd_namespace'] = $target->getNamespace();
                        // Inner LIMIT is 2X in case of stale backlinks with wrong namespaces
-                       $subQuery = $dbr->selectSQLText(
+                       $subQuery = $dbr->buildSelectSubquery(
                                [ $table, 'redirect', 'page' ],
                                [ $fromCol, 'rd_from' ],
                                $conds[$table],
                                [ $table, 'redirect', 'page' ],
                                [ $fromCol, 'rd_from' ],
                                $conds[$table],
@@ -175,7 +175,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                                ]
                        );
                        return $dbr->select(
                                ]
                        );
                        return $dbr->select(
-                               [ 'page', 'temp_backlink_range' => "($subQuery)" ],
+                               [ 'page', 'temp_backlink_range' => $subQuery ],
                                [ 'page_id', 'page_namespace', 'page_title', 'rd_from', 'page_is_redirect' ],
                                [],
                                __CLASS__ . '::showIndirectLinks',
                                [ 'page_id', 'page_namespace', 'page_title', 'rd_from', 'page_is_redirect' ],
                                [],
                                __CLASS__ . '::showIndirectLinks',