Skip to content

Commit

Permalink
Determine mysql / mariadb command name for dbinterop tests
Browse files Browse the repository at this point in the history
In more recent versions of mariadb, the mysql commmands (mysql, mysqldump) etc. are not present anymore.
Instead, mariadb and mariadb-dump need to be used.
  • Loading branch information
mstilkerich committed Jun 5, 2024
1 parent 0c1f597 commit 24507c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ RELEASE_VERSION ?= $(shell git tag --points-at HEAD)
# The following environment variables are assumed for MYSQL:
# - MYSQL_PASSWORD: Password of the MySQL root user
# - MYSQL_CMD_PREFIX: Prefix to use for all mysql commands (intended use: docker exec)
MYSQL := $(MYSQL_CMD_PREFIX) mysql -u root -p"$$MYSQL_PASSWORD"
MYSQLDUMP := $(MYSQL_CMD_PREFIX) mysqldump -u root -p"$$MYSQL_PASSWORD"
MYSQLCMD := $(shell $(MYSQL_CMD_PREFIX) sh -c 'which mariadb mysql | head -n 1')
MYSQLDUMPCMD := $(shell $(MYSQL_CMD_PREFIX) sh -c 'which mariadb-dump mysqldump | head -n 1')
MYSQL := $(MYSQL_CMD_PREFIX) $(MYSQLCMD) -u root -p"$$MYSQL_PASSWORD"
MYSQLDUMP := $(MYSQL_CMD_PREFIX) $(MYSQLDUMP) -u root -p"$$MYSQL_PASSWORD"

# POSTGRES_CMD_PREFIX can be used to run the command inside a docker container
# For simplicity, we assume an isolated test database that we can directly access as the postgres user with no sensitive password
Expand Down

0 comments on commit 24507c6

Please sign in to comment.