mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 11:17:23 +00:00
feat: Support expression in SET statement (#574)
Co-authored-by: Alex Vasilev <vaspiring@gmail.com>
This commit is contained in:
parent
eb7f1b005e
commit
6d8aacd85b
7 changed files with 63 additions and 52 deletions
|
@ -251,6 +251,26 @@ fn parse_use() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_set_variables() {
|
||||
mysql_and_generic().verified_stmt("SET sql_mode = CONCAT(@@sql_mode, ',STRICT_TRANS_TABLES')");
|
||||
assert_eq!(
|
||||
mysql_and_generic().verified_stmt("SET LOCAL autocommit = 1"),
|
||||
Statement::SetVariable {
|
||||
local: true,
|
||||
hivevar: false,
|
||||
variable: ObjectName(vec!["autocommit".into()]),
|
||||
value: vec![Expr::Value(Value::Number(
|
||||
#[cfg(not(feature = "bigdecimal"))]
|
||||
"1".to_string(),
|
||||
#[cfg(feature = "bigdecimal")]
|
||||
bigdecimal::BigDecimal::from(1),
|
||||
false
|
||||
))],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_auto_increment() {
|
||||
let sql = "CREATE TABLE foo (bar INT PRIMARY KEY AUTO_INCREMENT)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue