Skip to content

Commit 39c9b27

Browse files
add test case
1 parent cc73a24 commit 39c9b27

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/sqlparser_common.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8645,6 +8645,26 @@ fn parse_set_variable() {
86458645
_ => unreachable!(),
86468646
}
86478647

8648+
match verified_stmt("SET GLOBAL VARIABLE = 'Value'") {
8649+
Statement::Set(Set::SingleAssignment {
8650+
scope,
8651+
hivevar,
8652+
variable,
8653+
values,
8654+
}) => {
8655+
assert_eq!(scope, ContextModifier::Global);
8656+
assert!(!hivevar);
8657+
assert_eq!(variable, ObjectName::from(vec!["VARIABLE".into()]));
8658+
assert_eq!(
8659+
values,
8660+
vec![Expr::Value(
8661+
(Value::SingleQuotedString("Value".into())).with_empty_span()
8662+
)]
8663+
);
8664+
}
8665+
_ => unreachable!(),
8666+
}
8667+
86488668
let multi_variable_dialects = all_dialects_where(|d| d.supports_parenthesized_set_variables());
86498669
let sql = r#"SET (a, b, c) = (1, 2, 3)"#;
86508670
match multi_variable_dialects.verified_stmt(sql) {

0 commit comments

Comments
 (0)