{"record":{"id":"8270c46b1e922631","repo":"risingwavelabs/risingwave","slug":"variable","errorCode":null,"errorMessage":"variable","messagePattern":"variable","errorType":"validation","errorClass":"ParserError","httpStatus":null,"severity":"error","filePath":"src/sqlparser/src/parser.rs","lineNumber":5176,"sourceCode":"                        Expr::Value(v) => match v {\n                            Value::Interval { value, .. } => {\n                                if value != \"+00:00\" {\n                                    return Err(StrError(\"only support \\\"+00:00\\\" \".into()));\n                                }\n                                Ok(SetTimeZoneValue::Ident(Ident::with_quote_unchecked(\n                                    '\\'',\n                                    \"UTC\".to_owned(),\n                                )))\n                            }\n                            _ => Err(StrError(\"expect Value::Interval\".into())),\n                        },\n                        _ => Err(StrError(\"expect Expr::Value\".into())),\n                    })),\n                ),\n                Self::parse_identifier.map(SetTimeZoneValue::Ident),\n                Self::ensure_parse_value.map(SetTimeZoneValue::Literal),\n            ))\n            .expect(\"variable\")\n            .parse_next(self)?;\n\n            Ok(Statement::SetTimeZone {\n                local: modifier == Some(Keyword::LOCAL),\n                value,\n            })\n        } else if self.parse_keyword(Keyword::CHARACTERISTICS) && modifier == Some(Keyword::SESSION)\n        {\n            self.expect_keywords(&[Keyword::AS, Keyword::TRANSACTION])?;\n            Ok(Statement::SetTransaction {\n                modes: self.parse_transaction_modes()?,\n                snapshot: None,\n                session: true,\n            })\n        } else if self.parse_keyword(Keyword::TRANSACTION) && modifier.is_none() {\n            if self.parse_keyword(Keyword::SNAPSHOT) {\n                let snapshot_id = self.ensure_parse_value()?;\n                return Ok(Statement::SetTransaction {","sourceCodeStart":5158,"sourceCodeEnd":5194,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/sqlparser/src/parser.rs#L5158-L5194","documentation":"Raised while parsing `SET TIME ZONE <value>`: the value must be a literal (LOCAL/DEFAULT handled earlier, a parsed value, or an identifier); any other token triggers `.expect(\"variable\")`. It reports that the time zone argument is missing or is not a supported value form.","triggerScenarios":"Parsing `SET TIME ZONE <bad>` where the argument is an expression, a double-quoted identifier, a number that is not a valid literal form, or missing (statement ends after ZONE).","commonSituations":"Session setup scripts ported from other databases (e.g. `SET TIME ZONE INTERVAL '+00:00'` forms); templated SQL where the tz placeholder expanded to nothing; quoting differences losing the zone name.","solutions":["Provide a supported value: `SET TIME ZONE 'UTC'` or an identifier like `SET TIME ZONE UTC`.","Use LOCAL/DEFAULT keywords if that is the intent: `SET TIME ZONE LOCAL`.","Check the statement is complete and the zone value's quoting survived templating/shell processing."],"exampleFix":"// before\nSET TIME ZONE \"America/New_York\";\n// after\nSET TIME ZONE 'America/New_York';","handlingStrategy":"try-catch","validationCode":"function validTimeZoneValue(v) {\n  return ['LOCAL','DEFAULT'].includes(v.toUpperCase()) || /^[A-Za-z_][A-Za-z0-9_\\/+-]*$/.test(v) || (/^'.*'$/.test(v));\n}","typeGuard":null,"tryCatchPattern":"try { run(sql); } catch (e) { if (String(e).includes('variable') && /TIME ZONE/i.test(sql)) { sql = sql.replace(/TIME ZONE\\s*$/, \"TIME ZONE 'UTC'\"); run(sql); } else { throw e; } }","preventionTips":["Always quote time zone names as single-quoted strings.","Ensure template placeholders for the zone are non-empty before execution.","Port INTERVAL-style zone syntax from other engines to a quoted zone name."],"tags":["sql","parser","set-time-zone","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"}