{"record":{"id":"dd3759c60e75160f","repo":"doctrine/orm","slug":"limitsubqueryoutputwalker-is-to-be-used-on-selects","errorCode":null,"errorMessage":"LimitSubqueryOutputWalker is to be used on SelectStatements only","messagePattern":"LimitSubqueryOutputWalker is to be used on SelectStatements only","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Tools/Pagination/LimitSubqueryOutputWalker.php","lineNumber":169,"sourceCode":"        // No need for an order by clause, we'll order by rownum in the outer query.\n        $AST->orderByClause = null;\n    }\n\n    public function walkSelectStatement(SelectStatement $selectStatement): string\n    {\n        $sqlFinalizer = $this->getFinalizer($selectStatement);\n\n        $query = $this->getQuery();\n\n        $abstractSqlExecutor = $sqlFinalizer->createExecutor($query);\n\n        return $abstractSqlExecutor->getSqlStatements();\n    }\n\n    public function getFinalizer(AST\\DeleteStatement|AST\\UpdateStatement|AST\\SelectStatement $AST): SqlFinalizer\n    {\n        if (! $AST instanceof SelectStatement) {\n            throw new LogicException(self::class . ' is to be used on SelectStatements only');\n        }\n\n        if ($this->platformSupportsRowNumber()) {\n            $sql = $this->createSqlWithRowNumber($AST);\n        } else {\n            $sql = $this->createSqlWithoutRowNumber($AST);\n        }\n\n        return new SingleSelectSqlFinalizer($sql);\n    }\n\n    /**\n     * Walks down a SelectStatement AST node, wrapping it in a SELECT DISTINCT.\n     * This method is for use with platforms which support ROW_NUMBER.\n     *\n     * @throws RuntimeException\n     */\n    public function walkSelectStatementWithRowNumber(SelectStatement $AST): string","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/doctrine/orm/blob/d9b9ff73016bf598ae07515f97289ce8074e97a5/src/Tools/Pagination/LimitSubqueryOutputWalker.php#L151-L187","documentation":"Error \"LimitSubqueryOutputWalker is to be used on SelectStatements only\" thrown in doctrine/orm.","triggerScenarios":"Thrown at src/Tools/Pagination/LimitSubqueryOutputWalker.php:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9b9ff73016bf598ae07515f97289ce8074e97a5","analyzedAt":"2026-08-21T06:13:15.863Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}