apply security patch: v11.1.x/183-202409301521.patch

commit 408ef59069f4265049effb6a4b2eefa02625d5dd
Author: Scott Lepper <scott.lepper@gmail.com>
Date:   Mon Sep 30 11:18:26 2024 -0400

    remove sql expressions - backport 11.1.x
This commit is contained in:
github-actions[bot]
2024-10-01 22:30:49 +00:00
committed by joshhunt
parent dec1389471
commit 4f30c665e3
3 changed files with 28 additions and 4 deletions
+1 -2
View File
@@ -8,7 +8,6 @@ import (
"github.com/grafana/grafana/pkg/infra/log"
"github.com/jeremywohl/flatten"
"github.com/scottlepp/go-duck/duck"
)
const (
@@ -21,7 +20,7 @@ var logger = log.New("sql_expr")
// TablesList returns a list of tables for the sql statement
func TablesList(rawSQL string) ([]string, error) {
duckDB := duck.NewInMemoryDB()
duckDB := NewInMemoryDB()
rawSQL = strings.Replace(rawSQL, "'", "''", -1)
cmd := fmt.Sprintf("SELECT json_serialize_sql('%s')", rawSQL)
ret, err := duckDB.RunCommands([]string{cmd})