From 64bc771c3f103f9bf6a4b7731f75301c58c62618 Mon Sep 17 00:00:00 2001 From: Lawrin Novitsky Date: Mon, 24 Jun 2019 18:40:52 +0200 Subject: [PATCH] Updated Travis and AppVeyor configs to use 10.4 for tests. Fixed typo in one test preventing function from being created with 10.4 for the test --- .travis/build/build.sh | 8 ++++---- .travis/build/docker-entrypoint.sh | 21 +++++++++++++-------- appveyor.yml | 4 ++-- test/catalog2.c | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.travis/build/build.sh b/.travis/build/build.sh index 3f27ae0b..29757529 100644 --- a/.travis/build/build.sh +++ b/.travis/build/build.sh @@ -4,22 +4,22 @@ echo "************************************************************************** echo "* searching for last complete build" echo "**************************************************************************" -wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.3/ +wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.4/ grep -o ">build-[0-9]*" index.html | grep -o "[0-9]*" | tac | while read -r line ; do - curl -s --head http://hasky.askmonty.org/archive/10.3/build-$line/kvm-deb-jessie-amd64/md5sums.txt | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null + curl -s --head http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/md5sums.txt | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null if [ $? = "0" ]; then echo "**************************************************************************" echo "* Processing $line" echo "**************************************************************************" - wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.3/build-$line/kvm-deb-jessie-amd64/debs/binary/ + wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/debs/binary/ grep -o ">[^\"]*\.deb" $line.html | grep -o "[^>]*\.deb" | while read -r file ; do if [[ "$file" =~ ^mariadb-plugin.* ]] ; then echo "skipped file: $file" else echo "download file: $file" - wget -q -o /dev/null -O .travis/build/$file http://hasky.askmonty.org/archive/10.3/build-$line/kvm-deb-jessie-amd64/debs/binary/$file + wget -q -o /dev/null -O .travis/build/$file http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/debs/binary/$file fi done diff --git a/.travis/build/docker-entrypoint.sh b/.travis/build/docker-entrypoint.sh index 2b0846c1..721cc7d9 100644 --- a/.travis/build/docker-entrypoint.sh +++ b/.travis/build/docker-entrypoint.sh @@ -44,10 +44,8 @@ _check_config() { toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then cat >&2 <<-EOM - ERROR: mysqld failed while attempting to check config command was: "${toRun[*]}" - $errors EOM exit 1 @@ -59,7 +57,9 @@ _check_config() { # latter only show values present in config files, and not server defaults _get_config() { local conf="$1"; shift - "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }' + "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \ + | awk '$1 == "'"$conf"'" && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }' + # match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)" } # allow the container to be started with `--user` @@ -67,7 +67,7 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" -a "$(id -u)" = '0' ]; then _check_config "$@" DATADIR="$(_get_config 'datadir' "$@")" mkdir -p "$DATADIR" - chown -R mysql:mysql "$DATADIR" + find "$DATADIR" \! -user mysql -exec chown mysql '{}' + exec gosu mysql "$BASH_SOURCE" "$@" fi @@ -88,7 +88,15 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then mkdir -p "$DATADIR" echo 'Initializing database' - mysql_install_db --datadir="$DATADIR" --rpm + installArgs=( --datadir="$DATADIR" --rpm ) + if { mysql_install_db --help || :; } | grep -q -- '--auth-root-authentication-method'; then + # beginning in 10.4.3, install_db uses "socket" which only allows system user root to connect, switch back to "normal" to allow mysql root without a password + # see https://github.com/MariaDB/server/commit/b9f3f06857ac6f9105dc65caae19782f09b47fb3 + # (this flag doesn't exist in 10.0 and below) + installArgs+=( --auth-root-authentication-method=normal ) + fi + # "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here) + mysql_install_db "${installArgs[@]}" "${@:2}" echo 'Database initialized' SOCKET="$(_get_config 'socket' "$@")" @@ -135,7 +143,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then -- What's done in this file shouldn't be replicated -- or products like mysql-fabric won't work SET @@SESSION.SQL_LOG_BIN=0; - DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost') ; SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ; @@ -162,8 +169,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then if [ "$MYSQL_DATABASE" ]; then echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" | "${mysql[@]}" fi - - echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}" fi echo diff --git a/appveyor.yml b/appveyor.yml index 3527743d..062576c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,11 +1,11 @@ environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - DB: 10.3.14 + DB: 10.4.6 CMAKE_PARAM_G: 'Visual Studio 14 2015 Win64' - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - DB: 10.3.14 + DB: 10.4.6 CMAKE_PARAM_G: 'Visual Studio 15 2017 Win64' # scripts that are called at very beginning, before repo cloning diff --git a/test/catalog2.c b/test/catalog2.c index a85e6af1..be528f0d 100644 --- a/test/catalog2.c +++ b/test/catalog2.c @@ -625,7 +625,7 @@ ODBC_TEST(t_sqlprocedurecolumns) ); OK_SIMPLE_STMT(Hstmt1, "create function procedure_columns_test4_func(re_paramF int) returns varchar(32) deterministic "\ - "begin return CONCAT('abc', paramF); end;" + "begin return CONCAT('abc', re_paramF); end;" ); OK_SIMPLE_STMT(Hstmt1, "create function procedure_columns_test4_func_noparam() returns varchar(32) deterministic "\