-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix duplicate 'mysql' database issue (#284)
* fix: fix duplicate 'mysql' database issue Fixes #283
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] | ||
} |