Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 954 Bytes

File metadata and controls

23 lines (14 loc) · 954 Bytes

sqlparse: Keeping Oracle Procedure Declarations Together

Upstream PR: andialbrecht/sqlparse#858

Bug

Oracle-style CREATE PROCEDURE ... AS declarations could be split away from the following BEGIN ... END body. That produced invalid statement boundaries for procedural SQL.

Contract

A procedure declaration section belongs to the same split statement as its body. PostgreSQL dollar-quoted bodies after AS should not be mistaken for Oracle declarations.

Fix

The splitter now keeps Oracle declaration sections in the same statement as the procedure body, with regression coverage for the Oracle case and a PostgreSQL dollar-quoted counterexample.

Verification

  • Focused regression tests -> 2 passed
  • tests/test_split.py -> 51 passed
  • Full test suite -> 489 passed, 2 xfailed, 1 xpassed
  • ruff check sqlparse/ tests/test_split.py -> passed
  • git diff --check -> passed