Skip to content

Commit ee63b81

Browse files
[PECOBLR-2461] Fix test_show_columns_blocked: SHOW COLUMNS now allowed in MST (#778)
The server's MSTCheckRule allowlist has been broadened to include SHOW COLUMNS (ShowDeltaTableColumnsCommand). Flip the test to assert SHOW COLUMNS succeeds inside an MST transaction, matching the pattern already used by test_describe_table_not_blocked. Other SHOW variants (SHOW SCHEMAS/TABLES/CATALOGS/FUNCTIONS), DESCRIBE QUERY, DESCRIBE TABLE EXTENDED, and information_schema remain blocked as expected. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 2926daa commit ee63b81

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

tests/e2e/test_transactions.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,17 +624,21 @@ def test_cursor_tables_non_transactional_after_concurrent_create(
624624
class TestMstBlockedSql:
625625
"""SQL introspection statements inside active transactions.
626626
627-
The server restricts MST to a specific allowlist of commands. The error
628-
message from TRANSACTION_NOT_SUPPORTED.COMMAND is explicit:
627+
The server restricts MST to an allowlist enforced by MSTCheckRule. The
628+
TRANSACTION_NOT_SUPPORTED.COMMAND error originally advertised only:
629629
"Only SELECT / INSERT / MERGE / UPDATE / DELETE / DESCRIBE TABLE are supported."
630630
631+
The server has since broadened the allowlist to include SHOW COLUMNS
632+
(ShowDeltaTableColumnsCommand), observed on current DBSQL warehouses.
633+
631634
Blocked (throw + abort txn):
632-
- SHOW COLUMNS, SHOW TABLES, SHOW SCHEMAS, SHOW CATALOGS, SHOW FUNCTIONS
635+
- SHOW TABLES, SHOW SCHEMAS, SHOW CATALOGS, SHOW FUNCTIONS
633636
- DESCRIBE QUERY, DESCRIBE TABLE EXTENDED
634637
- SELECT FROM information_schema
635638
636639
Allowed:
637-
- DESCRIBE TABLE (basic form — explicitly listed in server's allowlist)
640+
- DESCRIBE TABLE (basic form)
641+
- SHOW COLUMNS
638642
"""
639643

640644
def _assert_blocked_and_txn_aborted(self, mst_conn_params, fq_table, blocked_sql):
@@ -704,10 +708,10 @@ def test_information_schema_blocked(self, mst_conn_params, mst_table, mst_catalo
704708
f"SELECT * FROM {mst_catalog}.information_schema.columns LIMIT 1",
705709
)
706710

707-
def test_show_columns_blocked(self, mst_conn_params, mst_table):
708-
"""SHOW COLUMNS is blocked in MST (ShowDeltaTableColumnsCommand)."""
711+
def test_show_columns_not_blocked(self, mst_conn_params, mst_table):
712+
"""SHOW COLUMNS succeeds in MST — allowed by the server's MSTCheckRule allowlist."""
709713
fq_table, _ = mst_table
710-
self._assert_blocked_and_txn_aborted(
714+
self._assert_not_blocked(
711715
mst_conn_params, fq_table, f"SHOW COLUMNS IN {fq_table}"
712716
)
713717

0 commit comments

Comments
 (0)