Skip to content

Commit d556181

Browse files
authored
Revert "fix parsing of INSERT INTO ... SELECT ... RETURNING (apache#1661)"
This reverts commit 38ef2bf.
1 parent 31e1b80 commit d556181

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

src/keywords.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,6 @@ pub const RESERVED_FOR_TABLE_ALIAS: &[Keyword] = &[
954954
Keyword::GLOBAL,
955955
Keyword::ANTI,
956956
Keyword::SEMI,
957-
Keyword::RETURNING,
958957
// for MSSQL-specific OUTER APPLY (seems reserved in most dialects)
959958
Keyword::OUTER,
960959
Keyword::SET,

tests/sqlparser_common.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -265,27 +265,6 @@ fn parse_insert_select_returning() {
265265
}
266266
}
267267

268-
#[test]
269-
fn parse_insert_select_from_returning() {
270-
let sql = "INSERT INTO table1 SELECT * FROM table2 RETURNING id";
271-
match verified_stmt(sql) {
272-
Statement::Insert(Insert {
273-
table: TableObject::TableName(table_name),
274-
source: Some(source),
275-
returning: Some(returning),
276-
..
277-
}) => {
278-
assert_eq!("table1", table_name.to_string());
279-
assert!(matches!(*source.body, SetExpr::Select(_)));
280-
assert_eq!(
281-
returning,
282-
vec![SelectItem::UnnamedExpr(Expr::Identifier(Ident::new("id"))),]
283-
);
284-
}
285-
bad_stmt => unreachable!("Expected valid insert, got {:?}", bad_stmt),
286-
}
287-
}
288-
289268
#[test]
290269
fn parse_returning_as_column_alias() {
291270
verified_stmt("SELECT 1 AS RETURNING");

0 commit comments

Comments
 (0)