Skip to content

Commit

Permalink
Fix MySQL drop database query.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Dec 4, 2020
1 parent 1b45a45 commit fada933
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions open_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var _ = Describe("func Open()", func() {

err = db.PingContext(ctx)
Expect(err).ShouldNot(HaveOccurred())

err = close()
Expect(err).ShouldNot(HaveOccurred())
},
entry(MySQLDriver, MySQL),
)
Expand Down
2 changes: 1 addition & 1 deletion productmysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (mysqlCompatable) DropDatabase(
db *sql.DB,
name string,
) error {
_, err := db.ExecContext(ctx, "CREATE DATABASE IF EXISTS `"+name+"`")
_, err := db.ExecContext(ctx, "DROP DATABASE IF EXISTS `"+name+"`")
return err
}

Expand Down

0 comments on commit fada933

Please sign in to comment.