Skip to content

Commit

Permalink
Merge pull request #53 from mudkipme/fix/mariadb1010
Browse files Browse the repository at this point in the history
Fix compatibility with MariaDB 10.10
  • Loading branch information
petoju authored Dec 28, 2022
2 parents 4164e7a + 3a9081f commit 2af7c56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ workflows:
- integration:
matrix:
parameters:
target: ["testversion5.6", "testversion5.7", "testversion8.0", "testpercona5.7", "testpercona8.0", "testmariadb10.3", "testmariadb10.8", "testtidb6.1.0"]
target: ["testversion5.6", "testversion5.7", "testversion8.0", "testpercona5.7", "testpercona8.0", "testmariadb10.3", "testmariadb10.8", "testmariadb10.10", "testtidb6.1.0"]
- gotest
4 changes: 2 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ bin/terraform:
testacc: fmtcheck bin/terraform
PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout=60s

acceptance: testversion5.6 testversion5.7 testversion8.0 testpercona5.7 testpercona8.0 testmariadb10.3 testmariadb10.8 testtidb6.1.0
acceptance: testversion5.6 testversion5.7 testversion8.0 testpercona5.7 testpercona8.0 testmariadb10.3 testmariadb10.8 testmariadb10.10 testtidb6.1.0

testversion%:
$(MAKE) MYSQL_VERSION=$* MYSQL_PORT=33$(shell echo "$*" | tr -d '.') testversion
Expand Down Expand Up @@ -60,7 +60,7 @@ testtidb:
@sh -c "'$(CURDIR)/scripts/tidb-test-cluster.sh' --destroy"

testmariadb%:
$(MAKE) MYSQL_VERSION=$* MYSQL_PORT=36$(shell echo "$*" | tr -d '.') testmariadb
$(MAKE) MYSQL_VERSION=$* MYSQL_PORT=6$(shell echo "$*" | tr -d '.') testmariadb

testmariadb:
-docker run --rm --name test-mariadb$(MYSQL_VERSION) -e MYSQL_ROOT_PASSWORD="$(TEST_PASSWORD)" -d -p $(MYSQL_PORT):3306 mariadb:$(MYSQL_VERSION)
Expand Down
3 changes: 2 additions & 1 deletion mysql/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,12 @@ func quoteIdentifier(in string) string {

func serverVersion(db *sql.DB) (*version.Version, error) {
var versionString string
err := db.QueryRow("SELECT @@GLOBAL.innodb_version").Scan(&versionString)
err := db.QueryRow("SELECT @@GLOBAL.version").Scan(&versionString)
if err != nil {
return nil, err
}

versionString = strings.SplitN(versionString, ":", 2)[0]
return version.NewVersion(versionString)
}

Expand Down

0 comments on commit 2af7c56

Please sign in to comment.