{"record":{"id":"b8676738fbf06c6c","repo":"risingwavelabs/risingwave","slug":"number-or-string","errorCode":null,"errorMessage":"number or string","messagePattern":"number or string","errorType":"validation","errorClass":"ParserError","httpStatus":null,"severity":"error","filePath":"src/sqlparser/src/parser.rs","lineNumber":4518,"sourceCode":"                            Self::parse_identifier.verify(|ident| ident.real_value() == \"proctime\"),\n                            cut_err(Token::LParen),\n                            cut_err(Token::RParen),\n                        )\n                            .value(AsOf::ProcessTime),\n                        literal_i64.map(AsOf::TimestampNum),\n                        single_quoted_string.map(AsOf::TimestampString),\n                    ))\n                    .expect(\"proctime(), now(), number or string\"),\n                ),\n            ),\n            preceded(\n                (Keyword::SYSTEM_VERSION, Keyword::AS, Keyword::OF),\n                cut_err(\n                    alt((\n                        literal_i64.map(AsOf::VersionNum),\n                        single_quoted_string.map(AsOf::VersionString),\n                    ))\n                    .expect(\"number or string\"),\n                ),\n            ),\n        ))\n        .parse_next(self)\n    }\n\n    /// Parse a possibly qualified, possibly quoted identifier, e.g.\n    /// `foo` or `myschema.\"table\"\n    pub fn parse_object_name(&mut self) -> ModalResult<ObjectName> {\n        let mut idents = vec![];\n        loop {\n            idents.push(self.parse_identifier()?);\n            if !self.consume_token(&Token::Period) {\n                break;\n            }\n        }\n        Ok(ObjectName(idents))\n    }","sourceCodeStart":4500,"sourceCodeEnd":4536,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/sqlparser/src/parser.rs#L4500-L4536","documentation":"Raised while parsing a `FOR SYSTEM_VERSION AS OF ...` clause: only an integer literal or a single-quoted string is accepted after AS OF, and `.expect(\"number or string\")` fires otherwise. It reports that the version argument of a system-version query is missing or of an unsupported form.","triggerScenarios":"Parsing `... FOR SYSTEM_VERSION AS OF <expr>` where expr is a column, a function call, a double-quoted string, or the clause ends immediately after AS OF.","commonSituations":"Time-travel queries built from application variables that inject expressions instead of literals; dialect porting from engines with different snapshot/version syntax; truncated SQL.","solutions":["Provide an integer version number or a single-quoted version string after AS OF, e.g. `AS OF 42` or `AS OF 'v3'`.","Resolve version expressions in the client and inline the literal.","Verify the clause is not truncated at the end of the statement."],"exampleFix":"// before\nSELECT * FROM t FOR SYSTEM_VERSION AS OF CURRENT_VERSION;\n// after\nSELECT * FROM t FOR SYSTEM_VERSION AS OF 3;","handlingStrategy":"validation","validationCode":"function validVersionAsOf(v) { return /^\\d+$/.test(v) || (/^'.*'$/.test(v)); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve version expressions to literals before generating the query.","Never inject column references or function calls into SYSTEM_VERSION AS OF.","Guard against empty placeholders in templated time-travel queries."],"tags":["sql","parser","time-travel","syntax"],"backgroundTag":"invalid-argument-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}