fix: escape SQL identifiers in db engine spec prequeries and metadata queries (#39840)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Shaitan
2026-05-15 14:48:38 +01:00
committed by GitHub
parent a06e6ea19b
commit 2e7a2b1f2d
12 changed files with 152 additions and 32 deletions

View File

@@ -169,6 +169,11 @@ def test_impersonation_username(mocker: MockerFixture) -> None:
'EXECUTE AS "alice" WITH NO REVERT;'
]
database.get_effective_user.return_value = 'evil" WITH NO REVERT; DROP TABLE x--'
assert StarRocksEngineSpec.get_prequeries(database) == [
'EXECUTE AS "evil"" WITH NO REVERT; DROP TABLE x--" WITH NO REVERT;'
]
def test_impersonation_disabled(mocker: MockerFixture) -> None:
"""