Skip to content

Commit

Permalink
Fix regression with BEGIN..END and BigQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
nene committed Dec 2, 2024
1 parent b984abe commit d902de2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/parser.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ program

statement
= non_transaction_statement
/ transaction_statement // math BEGIN transaction after BEGIN..END block
/ transaction_statement // match BEGIN transaction after BEGIN..END block
/ &{ return isAcceptUnsupportedGrammar(); } x:unsupported_grammar_stmt { return x; }

// This is referenced by BEGIN..END blocks of FUNCTION definitions,
Expand Down Expand Up @@ -198,8 +198,10 @@ inner_program
});
}

// BigQuery allows transactions inside BEGIN..END blocks, Postgres doesn't allow it.
inner_program_statement
= non_transaction_statement
= &postgres x:non_transaction_statement { return x; }
/ &bigquery x:statement { return x; }
/ &postgres x:return_stmt { return x; }

/**
Expand Down

0 comments on commit d902de2

Please sign in to comment.