Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: ghost test (#3626)

Danny Xu16ea3937959b
diff --git a/.github/workflows/backend-tests-default.yml b/.github/workflows/backend-tests-default.yml
new file mode 100644
index 0000000000..892cb46130
--- /dev/null
+++ b/.github/workflows/backend-tests-default.yml
@@ -0,0 +1,19 @@
+# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Backend Tests
+
+on:
+ pull_request:
+ branches:
+ - main
+ - "release/*.*.*"
+ paths:
+ - "docs/**"
+ - "frontend/**"
+ - "scripts/**"
+ - "quickstart/**"
+
+jobs:
+ job-ignored:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "Not required"'
diff --git a/.github/workflows/frontend-tests-default.yml b/.github/workflows/frontend-tests-default.yml
new file mode 100644
index 0000000000..36b808d262
--- /dev/null
+++ b/.github/workflows/frontend-tests-default.yml
@@ -0,0 +1,16 @@
+# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
+name: Frontend Tests
+
+on:
+ pull_request:
+ branches:
+ - main
+ - "release/*.*.*"
+ paths-ignore:
+ - "frontend/**"
+
+jobs:
+ job-ignored:
+ runs-on: ubuntu-latest
+ steps:
+ - run: 'echo "Not required"'
diff --git a/server/sql.go b/server/sql.go
index 2c91175139..c08b3586f0 100644
--- a/server/sql.go
+++ b/server/sql.go
@@ -198,7 +198,12 @@ func (s *Server) registerSQLRoutes(g *echo.Group) {
// Disallow cross-database query if specify database.
if exec.DatabaseName != "" {
for _, databaseName := range databaseList {
- if databaseName != "" && databaseName != exec.DatabaseName {
+ upperDatabaseName := strings.ToUpper(databaseName)
+ // We allow querying information schema.
+ if upperDatabaseName == "" || upperDatabaseName == "INFORMATION_SCHEMA" {
+ continue
+ }
+ if databaseName != exec.DatabaseName {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Malformed sql execute request, specify database %q but access database %q", exec.DatabaseName, databaseName))
}
}