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.

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