{"record":{"id":"26fa55618c0f0d48","repo":"doctrine/orm","slug":"no-result-variable-found-for-string-expression-s","errorCode":null,"errorMessage":"No result variable found for string expression \"%s\".","messagePattern":"No result variable found for string expression \"(.+?)\"\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Query/SqlWalker.php","lineNumber":2126,"sourceCode":"        if ($betweenExpr->not) {\n            $sql .= ' NOT';\n        }\n\n        $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression)\n            . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression);\n\n        return $sql;\n    }\n\n    /**\n     * Walks down a LikeExpression AST node, thereby generating the appropriate SQL.\n     */\n    public function walkLikeExpression(AST\\LikeExpression $likeExpr): string\n    {\n        $stringExpr = $likeExpr->stringExpression;\n        if (is_string($stringExpr)) {\n            if (! isset($this->queryComponents[$stringExpr]['resultVariable'])) {\n                throw new LogicException(sprintf('No result variable found for string expression \"%s\".', $stringExpr));\n            }\n\n            $leftExpr = $this->walkResultVariable($stringExpr);\n        } else {\n            $leftExpr = $stringExpr->dispatch($this);\n        }\n\n        $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE ';\n\n        if ($likeExpr->stringPattern instanceof AST\\InputParameter) {\n            $sql .= $this->walkInputParameter($likeExpr->stringPattern);\n        } elseif ($likeExpr->stringPattern instanceof AST\\Functions\\FunctionNode) {\n            $sql .= $this->walkFunction($likeExpr->stringPattern);\n        } elseif ($likeExpr->stringPattern instanceof AST\\PathExpression) {\n            $sql .= $this->walkPathExpression($likeExpr->stringPattern);\n        } else {\n            $sql .= $this->walkLiteral($likeExpr->stringPattern);\n        }","sourceCodeStart":2108,"sourceCodeEnd":2144,"githubUrl":"https://github.com/doctrine/orm/blob/d9b9ff73016bf598ae07515f97289ce8074e97a5/src/Query/SqlWalker.php#L2108-L2144","documentation":"Error \"No result variable found for string expression \"%s\".\" thrown in doctrine/orm.","triggerScenarios":"Thrown at src/Query/SqlWalker.php:2126 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"}