Skip to content

Allow sqlparse 0.6.x - #1615

Merged
dbaty merged 1 commit into
dbcli:mainfrom
pouwerkerk:sqlparse-0.6
Aug 24, 2026
Merged

Allow sqlparse 0.6.x#1615
dbaty merged 1 commit into
dbcli:mainfrom
pouwerkerk:sqlparse-0.6

Conversation

@pouwerkerk

@pouwerkerk pouwerkerk commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Widens the sqlparse constraint from <0.6 to <0.7.

sqlparse 0.6.0 (released 2026-08-13) fixes several denial-of-service issues and a string-escaping bug:

Its only other notable change is dropping Python 3.8/3.9, which pgcli no longer appears to support. With the current <0.6 cap, anyone who has pgcli installed can't pick up the fixed sqlparse release (Dependabot flags it and the resolver refuses).

The sqlparse.engine.grouping.MAX_GROUPING_DEPTH / MAX_GROUPING_TOKENS knobs that pgcli sets to None still exist in 0.6.0 and behave the same.

Checklist

  • I've added this contribution to the changelog.rst.
  • I've added my name to the AUTHORS file (or it's already there).
  • I installed pre-commit hooks (pip install pre-commit && pre-commit install). (No Python source changed in this PR.)
  • I verified that my changes work as expected: full test suite run locally on Python 3.13 with both sqlparse 0.5.4 and 0.6.0 — identical results (2612 passed, 117 skipped, 1 xfailed, 1 xpassed).
  • Please squash merge this pull request (uncheck if you'd like us to merge as multiple commits)

Fixes #1618.

DiegoDAF added a commit to DiegoDAF/pgcli.daf that referenced this pull request Aug 18, 2026
Our dependency was capped at "sqlparse >=0.3.0,<0.6", which prevented
installing 0.6.0 -- the release that fixes four advisories confirmed against
OSV:

  CVE-2026-59893  quadratic regex handling of dollar-quoted SQL literals
  CVE-2026-71491  quadratic O(n^2) DoS in group_comments
  CVE-2026-54284  TokenList.__init__ materializes O(subtree) values
  CVE-2026-59894  SQL string escaping in generated snippets

The dollar-quote one matters in practice here: DO $$ ... $$ blocks are routine
in the scripts we run through pgcli.

Cap raised to <0.7 and the floor to >=0.5.0. Verified against 0.6.0 before
bumping: full unit suite (3154 passed) and the whole behave suite (15 features,
61 scenarios, 0 failed) are green, plus a smoke test of the installed binary
(plain select, DO $$ block, multi-statement, trailing comment).

Upstream is doing the same in dbcli#1615 (issue dbcli#1618).
sqlparse 0.6.0 (2026-08-13) fixes several denial-of-service issues
(CVE-2026-59893, CVE-2026-54284, CVE-2026-71491) and a string-escaping bug
(CVE-2026-59894). Its only other notable change is dropping Python 3.8/3.9,
which pgcli no longer supports either. The <0.6 cap prevented users from
installing the fixed release; widen it to <0.7.

The full test suite gives identical results on sqlparse 0.5.4 and 0.6.0
(2612 passed, 117 skipped, 1 xfailed, 1 xpassed).
@fseguin-pass

Copy link
Copy Markdown

👋 @dbaty Does it look good to you ?

@dbaty
dbaty merged commit fe6c158 into dbcli:main Aug 24, 2026
@fseguin-pass

Copy link
Copy Markdown

Thank you !

@dbaty

dbaty commented Aug 24, 2026

Copy link
Copy Markdown
Member

A release will be published soon. Well, as soon as I figure out how to do it. ;)

@pouwerkerk

pouwerkerk commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @dbaty, for reviewing and thanks to you and the other maintainers for maintaining pgcli! I use it every day.

@j-bennet

Copy link
Copy Markdown
Contributor

@dbaty I'll release; you're going to need pypi privileges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for sqlparse 0.6.0

4 participants