From e3518e54b83ce7521c5b445a7126c1cd340c8529 Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Tue, 17 Sep 2024 10:54:48 +0200 Subject: [PATCH] Add test for hiding secrets in table functions in the output of EXPLAIN QUERY TREE. --- tests/integration/test_mask_sensitive_info/test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration/test_mask_sensitive_info/test.py b/tests/integration/test_mask_sensitive_info/test.py index 5366de39ea7..c92da35570a 100644 --- a/tests/integration/test_mask_sensitive_info/test.py +++ b/tests/integration/test_mask_sensitive_info/test.py @@ -496,6 +496,17 @@ def test_table_functions(): if not error: node.query(f"DROP TABLE {table_name}") + # Check EXPLAIN QUERY TREE + for toggle, secret in enumerate(["[HIDDEN]", password]): + skip = ['mysql', 'postgresql'] + for table_function in table_functions: + should_skip = any([table_function.startswith(prefix_to_skip) for prefix_to_skip in skip]) + if not should_skip: + output = node.query(f"EXPLAIN QUERY TREE SELECT * FROM {table_function} {show_secrets}={toggle}") + assert secret in output + if not toggle: + assert password not in output + def test_table_function_ways_to_call(): password = new_password()