mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 18:57:21 +00:00
Support CREATE TABLE ON UPDATE <expr>
Function (#685)
* feat : OnUpdate Function Implement * feat : add GenericDialect Options
This commit is contained in:
parent
b1a000f149
commit
3e990466f8
3 changed files with 13 additions and 8 deletions
|
@ -1031,7 +1031,7 @@ fn parse_kill() {
|
|||
|
||||
#[test]
|
||||
fn parse_table_colum_option_on_update() {
|
||||
let sql1 = "CREATE TABLE foo (`modification_time` DATETIME ON UPDATE)";
|
||||
let sql1 = "CREATE TABLE foo (`modification_time` DATETIME ON UPDATE CURRENT_TIMESTAMP())";
|
||||
match mysql().verified_stmt(sql1) {
|
||||
Statement::CreateTable { name, columns, .. } => {
|
||||
assert_eq!(name.to_string(), "foo");
|
||||
|
@ -1042,9 +1042,13 @@ fn parse_table_colum_option_on_update() {
|
|||
collation: None,
|
||||
options: vec![ColumnOptionDef {
|
||||
name: None,
|
||||
option: ColumnOption::DialectSpecific(vec![Token::make_keyword(
|
||||
"ON UPDATE"
|
||||
)]),
|
||||
option: ColumnOption::OnUpdate(Expr::Function(Function {
|
||||
name: ObjectName(vec![Ident::new("CURRENT_TIMESTAMP")]),
|
||||
args: vec![],
|
||||
over: None,
|
||||
distinct: false,
|
||||
special: false,
|
||||
})),
|
||||
},],
|
||||
}],
|
||||
columns
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue