fix: check sql only contain read operation

This commit is contained in:
junjun
2026-02-02 17:42:00 +08:00
committed by Junjun
parent f9fb1f95b9
commit fa0b13b06e
+2 -2
View File
@@ -592,9 +592,9 @@ def exec_sql(ds: CoreDatasource | AssistantOutDsSchema, sql: str, origin_column=
def check_sql_read(sql: str, ds: CoreDatasource | AssistantOutDsSchema):
try:
dialect = None
if ds.type == "mysql" or ds.type == "doris" or ds.type == "starrocks":
if equals_ignore_case(ds.type, 'mysql', 'doris', 'starrocks'):
dialect = 'mysql'
elif ds.type == "sqlServer":
elif equals_ignore_case(ds.type, 'sqlServer'):
dialect = 'tsql'
statements = sqlglot.parse(sql, dialect=dialect)