Skip to content

Add CREATE OR REPLACE to default SQL blacklist - #720

Open
DangTAnh wants to merge 1 commit into
explorerhq:masterfrom
DangTAnh:pr/704-create-or-replace-blacklist
Open

DangTAnh wants to merge 1 commit into
explorerhq:masterfrom
DangTAnh:pr/704-create-or-replace-blacklist

Conversation

@DangTAnh

Copy link
Copy Markdown
Contributor

sqlparse tokenizes CREATE OR REPLACE ... as a single keyword token, so the existing CREATE blacklist entry never matches and these statements pass passes_blacklist.

Fixes #704

Changes:

  • explorer/app_settings.py: add "CREATE OR REPLACE" to default EXPLORER_SQL_BLACKLIST
  • docs/settings.rst: mirror the default in docs
  • explorer/tests/test_utils.py: regression test test_ddl_create_or_replace

Testing: manage.py test explorer.tests.test_utils -- 43 tests OK; new test fails without the fix and passes with it.

sqlparse tokenizes CREATE OR REPLACE as a single keyword, so the CREATE entry never matched and such statements passed the blacklist. Fixes explorerhq#704.
@DangTAnh

DangTAnh commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up: the red docs check on this branch is unrelated to the change. ubuntu-latest moved to Ubuntu 26.04, where actions/setup-python has no Python 3.9 build, so the job dies in Set up Python (it also fails on the dependabot/npm_and_yarn/multi branch). Opened #730 (pin the docs job to ubuntu-24.04) which makes that job pass again; this PR can be refreshed against master once it lands.

This branch has not been deployed

No deployments
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.

'CREATE OR REPLACE' missing in EXPLORER_SQL_BLACKLIST

1 participant