From 7055739c502fcc050d72467870a790f0a57ddfdf Mon Sep 17 00:00:00 2001 From: DangTAnh <163684532+DangTAnh@users.noreply.github.com> Date: Thu, 15 Oct 2026 10:15:51 +0700 Subject: [PATCH 1/2] Add CREATE OR REPLACE to default SQL blacklist sqlparse tokenizes CREATE OR REPLACE as a single keyword, so the CREATE entry never matched and such statements passed the blacklist. Fixes #704. --- docs/settings.rst | 1 + explorer/app_settings.py | 1 + explorer/tests/test_utils.py | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index 9d069fbc..526bc390 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -28,6 +28,7 @@ Disallowed words in SQL queries to prevent destructive actions. # DDL 'ALTER', 'CREATE', + 'CREATE OR REPLACE', 'DROP', 'RENAME', 'TRUNCATE', diff --git a/explorer/app_settings.py b/explorer/app_settings.py index a25a336e..cee07a74 100644 --- a/explorer/app_settings.py +++ b/explorer/app_settings.py @@ -29,6 +29,7 @@ # DDL "ALTER", "CREATE", + "CREATE OR REPLACE", "DROP", "RENAME", "TRUNCATE", diff --git a/explorer/tests/test_utils.py b/explorer/tests/test_utils.py index e3f05523..127579d2 100644 --- a/explorer/tests/test_utils.py +++ b/explorer/tests/test_utils.py @@ -152,6 +152,11 @@ def test_ddl_create(self): passes, words = passes_blacklist(sql) self.assertFalse(passes) + def test_ddl_create_or_replace(self): + sql = "CREATE OR REPLACE VIEW foo AS SELECT 1;" + passes, words = passes_blacklist(sql) + self.assertFalse(passes) + def test_ddl_drop(self): sql = "DROP TABLE films, distributors;" passes, words = passes_blacklist(sql) From 1277834fc2e2b841e3edca922f7ab1f1a0f82ad7 Mon Sep 17 00:00:00 2001 From: DangTAnh Date: Sat, 7 Nov 2026 02:42:43 +0700 Subject: [PATCH 2/2] ci(docs): pin the docs job to ubuntu-24.04 for Python 3.9 --- .github/workflows/docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fc44f399..91ba05b8 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,8 @@ concurrency: jobs: docs: - runs-on: ubuntu-latest + # Python 3.9 is only published for Ubuntu 22.04/24.04; ubuntu-latest is now 26.04. + runs-on: ubuntu-24.04 name: docs steps: - name: Checkout