Add test for hiding secrets in table functions in the output of EXPLAIN QUERY TREE.

This commit is contained in:
Vitaly Baranov 2024-09-17 10:54:48 +02:00
parent a461d20af9
commit e3518e54b8

View File

@ -496,6 +496,17 @@ def test_table_functions():
if not error: if not error:
node.query(f"DROP TABLE {table_name}") 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(): def test_table_function_ways_to_call():
password = new_password() password = new_password()