mirror of
https://github.com/apache/superset.git
synced 2026-05-28 03:05:13 +00:00
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:
@@ -694,7 +694,10 @@ class PostgresEngineSpec(BasicParametersMixin, PostgresBaseEngineSpec):
|
||||
be anything, and we would have to block users from running any queries
|
||||
referencing tables without an explicit schema.
|
||||
"""
|
||||
return [f'set search_path = "{schema}"'] if schema else []
|
||||
if not schema:
|
||||
return []
|
||||
escaped = schema.replace('"', '""')
|
||||
return [f'set search_path = "{escaped}"']
|
||||
|
||||
@classmethod
|
||||
def get_allow_cost_estimate(cls, extra: dict[str, Any]) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user