From 24507c62370026107cb624d07878c225e0affa76 Mon Sep 17 00:00:00 2001 From: Michael Stilkerich Date: Wed, 5 Jun 2024 17:32:16 +0200 Subject: [PATCH] Determine mysql / mariadb command name for dbinterop tests 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. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7c94e728..4c2be169 100644 --- a/Makefile +++ b/Makefile @@ -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