{"record":{"id":"cf0860c2b27d382f","repo":"yiisoft/yii2","slug":"length-must-be-greater-than-0","errorCode":null,"errorMessage":"Length must be greater than 0.","messagePattern":"Length must be greater than 0\\.","errorType":"exception","errorClass":"yii\\base\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"framework/db/SqlTokenizer.php","lineNumber":381,"sourceCode":"        $isKeyword = $this->isKeyword($this->_buffer, $content);\n        $this->_currentToken[] = new SqlToken([\n            'type' => $isKeyword ? SqlToken::TYPE_KEYWORD : SqlToken::TYPE_TOKEN,\n            'content' => is_string($content) ? $content : $this->_buffer,\n            'startOffset' => $this->offset - mb_strlen($this->_buffer, 'UTF-8'),\n            'endOffset' => $this->offset,\n        ]);\n        $this->_buffer = '';\n    }\n\n    /**\n     * Adds the specified length to the current offset.\n     * @param int $length\n     * @throws InvalidArgumentException\n     */\n    private function advance($length)\n    {\n        if ($length <= 0) {\n            throw new InvalidArgumentException('Length must be greater than 0.');\n        }\n\n        $this->offset += $length;\n        $this->_substrings = [];\n    }\n\n    /**\n     * Returns whether the SQL code is completely traversed.\n     * @return bool\n     */\n    private function isEof()\n    {\n        return $this->offset >= $this->length;\n    }\n}\n","sourceCodeStart":363,"sourceCodeEnd":397,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/SqlTokenizer.php#L363-L397","documentation":"Error \"Length must be greater than 0.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/SqlTokenizer.php:381 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":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}