File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1241,6 +1241,11 @@ pub const RESERVED_FOR_TABLE_ALIAS: &[Keyword] = &[
12411241 Keyword :: TABLESAMPLE ,
12421242 Keyword :: FROM ,
12431243 Keyword :: OPEN ,
1244+ Keyword :: INSERT ,
1245+ Keyword :: UPDATE ,
1246+ Keyword :: DELETE ,
1247+ Keyword :: EXEC ,
1248+ Keyword :: EXECUTE ,
12441249] ;
12451250
12461251/// Can't be used as a column alias, so that `SELECT <expr> alias`
Original file line number Diff line number Diff line change @@ -697,6 +697,23 @@ fn parse_select_with_table_alias() {
697697 );
698698}
699699
700+ #[test]
701+ fn parse_consecutive_queries() {
702+ let select_then_exec = "SELECT * FROM deleted; EXECUTE my_sp 'some', 'params'";
703+ let _ = all_dialects()
704+ .parse_sql_statements(select_then_exec)
705+ .unwrap();
706+ let _ = all_dialects_not_requiring_semicolon_statement_delimiter()
707+ .statements_without_semicolons_parse_to(select_then_exec, "");
708+
709+ let select_then_update = "SELECT 1 FROM x; UPDATE y SET z = 1";
710+ let _ = all_dialects()
711+ .parse_sql_statements(select_then_update)
712+ .unwrap();
713+ let _ = all_dialects_not_requiring_semicolon_statement_delimiter()
714+ .statements_without_semicolons_parse_to(select_then_update, "");
715+ }
716+
700717#[test]
701718fn parse_analyze() {
702719 verified_stmt("ANALYZE TABLE test_table");
You can’t perform that action at this time.
0 commit comments