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 @@ -1088,6 +1088,11 @@ pub const RESERVED_FOR_TABLE_ALIAS: &[Keyword] = &[
10881088 Keyword :: TABLESAMPLE ,
10891089 Keyword :: FROM ,
10901090 Keyword :: OPEN ,
1091+ Keyword :: INSERT ,
1092+ Keyword :: UPDATE ,
1093+ Keyword :: DELETE ,
1094+ Keyword :: EXEC ,
1095+ Keyword :: EXECUTE ,
10911096] ;
10921097
10931098/// Can't be used as a column alias, so that `SELECT <expr> alias`
Original file line number Diff line number Diff line change @@ -666,6 +666,23 @@ fn parse_select_with_table_alias() {
666666 );
667667}
668668
669+ #[test]
670+ fn parse_consecutive_queries() {
671+ let select_then_exec = "SELECT * FROM deleted; EXECUTE my_sp 'some', 'params'";
672+ let _ = all_dialects()
673+ .parse_sql_statements(select_then_exec)
674+ .unwrap();
675+ let _ = all_dialects_not_requiring_semicolon_statement_delimiter()
676+ .statements_without_semicolons_parse_to(select_then_exec, "");
677+
678+ let select_then_update = "SELECT 1 FROM x; UPDATE y SET z = 1";
679+ let _ = all_dialects()
680+ .parse_sql_statements(select_then_update)
681+ .unwrap();
682+ let _ = all_dialects_not_requiring_semicolon_statement_delimiter()
683+ .statements_without_semicolons_parse_to(select_then_update, "");
684+ }
685+
669686#[test]
670687fn parse_analyze() {
671688 verified_stmt("ANALYZE TABLE test_table");
You can’t perform that action at this time.
0 commit comments