Skip to content

Commit

Permalink
fix: fix duplicate 'mysql' database issue (#284)
Browse files Browse the repository at this point in the history
* fix: fix duplicate 'mysql' database issue

Fixes #283
  • Loading branch information
fanyang01 authored Dec 13, 2024
1 parent d4498cb commit 68f29ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion catalog/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (prov *DatabaseProvider) AllDatabases(ctx *sql.Context) []sql.Database {
}

switch schemaName {
case "information_schema", "pg_catalog", "__sys__":
case "information_schema", "pg_catalog", "__sys__", "mysql":
continue
}

Expand Down
8 changes: 8 additions & 0 deletions test/bats/mysql/unique_databases.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bats

@test "Ensure every database reported by SHOW DATABASES is unique" {
run mysql -h 127.0.0.1 -u root --raw --batch --skip-column-names -e "SHOW DATABASES"
[ "$status" -eq 0 ]
unique_databases=$(echo "$output" | sort | uniq -d)
[ -z "$unique_databases" ]
}

0 comments on commit 68f29ab

Please sign in to comment.