File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1146,6 +1146,11 @@ pub const RESERVED_FOR_TABLE_ALIAS: &[Keyword] = &[
11461146 Keyword :: TABLESAMPLE ,
11471147 Keyword :: FROM ,
11481148 Keyword :: OPEN ,
1149+ Keyword :: INSERT ,
1150+ Keyword :: UPDATE ,
1151+ Keyword :: DELETE ,
1152+ Keyword :: EXEC ,
1153+ Keyword :: EXECUTE ,
11491154] ;
11501155
11511156/// Can't be used as a column alias, so that `SELECT <expr> alias`
Original file line number Diff line number Diff line change @@ -672,6 +672,23 @@ fn parse_select_with_table_alias() {
672672 );
673673}
674674
675+ #[test]
676+ fn parse_consecutive_queries() {
677+ let select_then_exec = "SELECT * FROM deleted; EXECUTE my_sp 'some', 'params'";
678+ let _ = all_dialects()
679+ .parse_sql_statements(select_then_exec)
680+ .unwrap();
681+ let _ = all_dialects_not_requiring_semicolon_statement_delimiter()
682+ .statements_without_semicolons_parse_to(select_then_exec, "");
683+
684+ let select_then_update = "SELECT 1 FROM x; UPDATE y SET z = 1";
685+ let _ = all_dialects()
686+ .parse_sql_statements(select_then_update)
687+ .unwrap();
688+ let _ = all_dialects_not_requiring_semicolon_statement_delimiter()
689+ .statements_without_semicolons_parse_to(select_then_update, "");
690+ }
691+
675692#[test]
676693fn parse_analyze() {
677694 verified_stmt("ANALYZE TABLE test_table");
You can’t perform that action at this time.
0 commit comments