diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-01-04 10:52:32 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-01-04 10:52:32 +0200 |
commit | 6268bdadf70609953c57f62e051defd8f0041046 (patch) | |
tree | 07fa0a018982e2f1b902f4cdac34275af99d6c80 | |
parent | 3f38e2a452575e22813c363a8f7900f727f6b16b (diff) | |
parent | 1bf9acceef252000618a137853638c612339024b (diff) | |
download | mariadb-git-6268bdadf70609953c57f62e051defd8f0041046.tar.gz |
Merge 10.5 into 10.6
-rw-r--r-- | .travis.yml | 8 | ||||
-rwxr-xr-x | debian/autobake-deb.sh | 5 | ||||
-rw-r--r-- | debian/control | 56 | ||||
-rw-r--r-- | debian/mariadb-server-10.6.install | 2 | ||||
-rw-r--r-- | debian/mariadb-test.install | 2 | ||||
-rwxr-xr-x | debian/rules | 9 | ||||
-rw-r--r-- | debian/salsa-ci.yml | 916 | ||||
-rw-r--r-- | debian/tests/smoke | 1 | ||||
-rw-r--r-- | extra/wolfssl/CMakeLists.txt | 57 | ||||
m--------- | extra/wolfssl/wolfssl | 0 | ||||
-rw-r--r-- | include/ssl_compat.h | 6 | ||||
-rw-r--r-- | mysql-test/suite/perfschema/r/misc.result | 10 | ||||
-rw-r--r-- | mysql-test/suite/perfschema/t/misc.test | 11 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 | ||||
-rw-r--r-- | storage/innobase/include/os0file.h | 3 | ||||
-rw-r--r-- | storage/innobase/os/os0file.cc | 4 |
16 files changed, 574 insertions, 518 deletions
diff --git a/.travis.yml b/.travis.yml index 11cc0353b61..bf0831d9f1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -114,8 +114,8 @@ compiler: - clang env: - CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=archive,optimizer_unfixed_bugs,parts,sys_vars,unit,vcol,innodb,innodb_gis,innodb_zip,innodb_fts - - CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,encryption,rocksdb,versioning,rpl - - CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles + - CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=binlog,binlog_encryption,rocksdb,versioning,rpl + - CC_VERSION=7 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=csv,federated,funcs_1,funcs_2,gcol,handler,heap,json,maria,perfschema,plugins,multi_source,roles,encryption - CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main jobs: @@ -191,10 +191,10 @@ jobs: arch: s390x compiler: gcc env: CC_VERSION=10 TYPE=RelWithDebInfo MYSQL_TEST_SUITES=main - # Sporadically fails on main.multi_update_big test (MDEV-23955) - - arch: arm64 # Until OSX becomes a bit more stable - os: osx + # ppc64el builder frequently runs out of memory + - arch: ppc64le before_install: - if [[ "${TRAVIS_OS_NAME}" == 'osx' ]]; then diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index c5a88728ef1..0ef59247904 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -22,6 +22,9 @@ if [[ -d storage/columnstore/columnstore/debian ]]; then cp -v storage/columnstore/columnstore/debian/mariadb-plugin-columnstore.* debian/ echo >> debian/control cat storage/columnstore/columnstore/debian/control >> debian/control + # ColumnStore is explcitly disabled in the native build, so allow it now + # when build it when triggered by autobake-deb.sh + sed '/-DPLUGIN_COLUMNSTORE=NO/d' -i debian/rules fi # General CI optimizations to keep build output smaller @@ -33,7 +36,7 @@ then # MCOL-4149: ColumnStore builds are so slow and big that they must be skipped on # both Travis-CI and Gitlab-CI - sed 's|-DPLUGIN_COLUMNSTORE=YES|-DPLUGIN_COLUMNSTORE=NO|' -i debian/rules + sed 's|$(CMAKEFLAGS)|$(CMAKEFLAGS) -DPLUGIN_COLUMNSTORE=NO|' -i debian/rules sed "/Package: mariadb-plugin-columnstore/,/^$/d" -i debian/control fi diff --git a/debian/control b/debian/control index 0640d46253e..9ddda9e9ae2 100644 --- a/debian/control +++ b/debian/control @@ -285,16 +285,16 @@ Conflicts: mariadb-client-10.0, mysql-client-core-5.7, mysql-client-core-8.0, virtual-mysql-client-core -Replaces: mariadb-client-core-5.1, - mariadb-client-core-5.2, - mariadb-client-core-5.3, - mariadb-client-core-5.5, - mariadb-client-core-10.0, +Replaces: mariadb-client-core-10.0, mariadb-client-core-10.1, mariadb-client-core-10.2, mariadb-client-core-10.3, mariadb-client-core-10.4, mariadb-client-core-10.5, + mariadb-client-core-5.1, + mariadb-client-core-5.2, + mariadb-client-core-5.3, + mariadb-client-core-5.5, mysql-client-core-5.1, mysql-client-core-5.5, mysql-client-core-5.6, @@ -346,16 +346,16 @@ Conflicts: mariadb-client (<< ${source:Version}), mysql-client-core-8.0, mytop, virtual-mysql-client -Replaces: mariadb-client-5.1, - mariadb-client-5.2, - mariadb-client-5.3, - mariadb-client-5.5, - mariadb-client-10.0, +Replaces: mariadb-client-10.0, mariadb-client-10.1, mariadb-client-10.2, mariadb-client-10.3, mariadb-client-10.4, mariadb-client-10.5, + mariadb-client-5.1, + mariadb-client-5.2, + mariadb-client-5.3, + mariadb-client-5.5, mysql-client-5.0, mysql-client-5.1, mysql-client-5.5, @@ -400,16 +400,16 @@ Conflicts: mariadb-server-core-10.0, mysql-server-core-5.7, mysql-server-core-8.0, virtual-mysql-server-core -Replaces: mariadb-server-core-5.1, - mariadb-server-core-5.2, - mariadb-server-core-5.3, - mariadb-server-core-5.5, - mariadb-server-core-10.0, +Replaces: mariadb-server-core-10.0, mariadb-server-core-10.1, mariadb-server-core-10.2, mariadb-server-core-10.3, mariadb-server-core-10.4, mariadb-server-core-10.5, + mariadb-server-core-5.1, + mariadb-server-core-5.2, + mariadb-server-core-5.3, + mariadb-server-core-5.5, mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, @@ -476,16 +476,16 @@ Conflicts: mariadb-server (<< ${source:Version}), mysql-server-5.7, mysql-server-8.0, virtual-mysql-server -Replaces: mariadb-server-5.1, - mariadb-server-5.2, - mariadb-server-5.3, - mariadb-server-5.5, - mariadb-server-10.0, +Replaces: mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3, mariadb-server-10.4, mariadb-server-10.5, + mariadb-server-5.1, + mariadb-server-5.2, + mariadb-server-5.3, + mariadb-server-5.5, mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, @@ -718,18 +718,18 @@ Depends: mariadb-client-10.6 (= ${binary:Version}), ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} -Breaks: mariadb-test-5.5, - mariadb-test-10.0, +Breaks: mariadb-test-10.0, mariadb-test-10.1, mariadb-test-10.2, mariadb-test-10.3, mariadb-test-10.4, -Replaces: mariadb-test-5.5, - mariadb-test-10.0, + mariadb-test-5.5 +Replaces: mariadb-test-10.0, mariadb-test-10.1, mariadb-test-10.2, mariadb-test-10.3, mariadb-test-10.4, + mariadb-test-5.5, virtual-mysql-testsuite Provides: virtual-mysql-testsuite Suggests: patch @@ -747,23 +747,23 @@ Multi-Arch: foreign Depends: ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} -Breaks: mariadb-test-data-5.5, - mariadb-test-data-10.0, +Breaks: mariadb-test-data-10.0, mariadb-test-data-10.1, mariadb-test-data-10.2, mariadb-test-data-10.3, mariadb-test-data-10.4, + mariadb-test-data-5.5, mysql-testsuite, mysql-testsuite-5.5, mysql-testsuite-5.6, mysql-testsuite-5.7, mysql-testsuite-8.0 -Replaces: mariadb-test-data-5.5, - mariadb-test-data-10.0, +Replaces: mariadb-test-data-10.0, mariadb-test-data-10.1, mariadb-test-data-10.2, mariadb-test-data-10.3, mariadb-test-data-10.4, + mariadb-test-data-5.5, mysql-testsuite, mysql-testsuite-5.5, mysql-testsuite-5.6, diff --git a/debian/mariadb-server-10.6.install b/debian/mariadb-server-10.6.install index f0c644482cd..018fc6bcdd1 100644 --- a/debian/mariadb-server-10.6.install +++ b/debian/mariadb-server-10.6.install @@ -3,7 +3,6 @@ debian/additions/debian-start.inc.sh usr/share/mysql debian/additions/echo_stderr usr/share/mysql debian/additions/mariadb.conf.d/50-mysqld_safe.cnf etc/mysql/mariadb.conf.d debian/additions/mariadb.conf.d/50-server.cnf etc/mysql/mariadb.conf.d -support-files/rpm/enable_encryption.preset etc/mysql/mariadb.conf.d/99-enable-encryption.cnf.preset debian/additions/source_mariadb-10.6.py usr/share/apport/package-hooks etc/apparmor.d/usr.sbin.mariadbd etc/security/user_map.conf @@ -11,6 +10,7 @@ lib/*/security/pam_user_map.so lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf lib/systemd/system/mysql.service lib/systemd/system/mysqld.service +support-files/rpm/enable_encryption.preset etc/mysql/mariadb.conf.d/99-enable-encryption.cnf.preset usr/bin/aria_chk usr/bin/aria_dump_log usr/bin/aria_ftdump diff --git a/debian/mariadb-test.install b/debian/mariadb-test.install index 56947ac78ef..bbcc200c368 100644 --- a/debian/mariadb-test.install +++ b/debian/mariadb-test.install @@ -8,7 +8,6 @@ usr/lib/*/libmariadb3/plugin/qa_auth_interface.so usr/lib/mysql/plugin/adt_null.so usr/lib/mysql/plugin/auth_0x0100.so usr/lib/mysql/plugin/auth_test_plugin.so -usr/lib/mysql/plugin/test_sql_service.so usr/lib/mysql/plugin/daemon_example.ini usr/lib/mysql/plugin/debug_key_management.so usr/lib/mysql/plugin/dialog_examples.so @@ -20,6 +19,7 @@ usr/lib/mysql/plugin/libdaemon_example.so usr/lib/mysql/plugin/mypluglib.so usr/lib/mysql/plugin/qa_auth_interface.so usr/lib/mysql/plugin/qa_auth_server.so +usr/lib/mysql/plugin/test_sql_service.so usr/lib/mysql/plugin/test_versioning.so usr/share/man/man1/mariadb-client-test-embedded.1 usr/share/man/man1/mariadb-client-test.1 diff --git a/debian/rules b/debian/rules index a79e8c2bd84..cf73a08431b 100755 --- a/debian/rules +++ b/debian/rules @@ -48,12 +48,6 @@ ifeq (32,$(DEB_HOST_ARCH_BITS)) CMAKEFLAGS += -DPLUGIN_ROCKSDB=NO endif -# ColumnStore only attempts to build on a few platforms as dictated by CMake checks -# Also note in debian/control the CS-only build deps marked '[amd64]' -ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),amd64)) - CMAKEFLAGS += -DPLUGIN_COLUMNSTORE=YES -endif - # Add extra flag to avoid WolfSSL code crashing the entire mariadbd on s390x. This # can be removed once upstream has made the code s390x compatible, see # https://jira.mariadb.org/browse/MDEV-21705 and @@ -85,6 +79,8 @@ ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) dh_auto_build --builddirectory=builddir-native -- import_executables endif + # Don't build ColumnStore as part of the native build, only build it when + # triggered by autobake-deb.sh. Saves build time and disk space. mkdir -p $(BUILDDIR) && cd $(BUILDDIR) && \ sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \ CC=${CC} \ @@ -97,6 +93,7 @@ endif -DCMAKE_SYSTEM_PROCESSOR=$(DEB_HOST_ARCH) \ -DBUILD_CONFIG=mysql_release \ -DPLUGIN_AWS_KEY_MANAGEMENT=NO \ + -DPLUGIN_COLUMNSTORE=NO \ -DDEB=$(DEB_VENDOR) ..' # This is needed, otherwise 'make test' will run before binaries have been built diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml index f62358a1e48..299a54a4520 100644 --- a/debian/salsa-ci.yml +++ b/debian/salsa-ci.yml @@ -1,9 +1,10 @@ -# Inlude Salsa-CI as a base +--- +# Include Salsa-CI as a base include: - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml -# Overridfe Salsa-CI with MariaDB specific variations +# Override Salsa-CI with MariaDB specific variations variables: DEB_BUILD_OPTIONS: "nocheck noautodbgsym" RELEASE: sid @@ -13,14 +14,16 @@ variables: SALSA_CI_DISABLE_BUILD_PACKAGE_ALL: 1 SALSA_CI_DISABLE_BUILD_PACKAGE_ANY: 1 GIT_SUBMODULE_STRATEGY: recursive + SALSA_CI_GBP_BUILDPACKAGE_ARGS: "--git-submodules" # did not apply to extract-sources stages: + - provisioning - build - test - upgrade in Sid - - upgrade from Buster/Stretch/Jessie - - test extras + - upgrade from Buster/Stretch - upgrade extras + - test extras - publish # Stage referenced by Salsa-CI template aptly stanza, so must exist even though not used build: @@ -37,6 +40,7 @@ build: - debian/autobake-deb.sh |& tail -n 10000 # Keep Gitlab-CI output under 4 MB - cd ..; rm -rfv *.tmp # Clean away build files not to store as artifacts - cp -v *.* ${WORKING_DIR}/ + - rm -rf "${WORKING_DIR}/source_dir" # Remove excess source files - du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB. - ccache -s # Show ccache stats to validate it worked - mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR} || true @@ -46,29 +50,72 @@ build buster-backports: script: - *autobake-deb-steps variables: - RELEASE: buster-backports + RELEASE: buster-backports build stretch-backports: extends: .build-package script: - *autobake-deb-steps variables: - RELEASE: stretch-backports + RELEASE: stretch-backports -build native deb: +# base image missing git +build i386: extends: .build-package script: - - mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR} - - mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR} - # NOTE! --git-submodules needed despite GIT_SUBMODULE_STRATEGY since --git-export-dir is used - - gbp buildpackage --git-submodules --git-ignore-branch --git-ignore-new --git-export-dir=${WORKING_DIR} --git-builder="docker-build.sh ${SALSA_CI_IMAGES_DOCKERBUILDER}" |& filter-output - - du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB. - - mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR} - allow_failure: true + - apt-get update && apt-get install -y --no-install-recommends git + - *autobake-deb-steps + image: $SALSA_CI_IMAGES_BASE_I386 + variables: + ARCH: 'i386' + except: + variables: + - $SALSA_CI_DISABLE_BUILD_PACKAGE_I386 =~ /^(1|yes|true)$/ + +build native deb: + extends: .build-package + script: &buildpackage-script | + mkdir -p ${WORKING_DIR} ${CCACHE_WORK_DIR} + mv ${CCACHE_WORK_DIR} ${CCACHE_TMP_DIR} + export CCACHE_DIR=${CCACHE_TMP_DIR} + # Add deb-src entries + sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list + apt-get update && eatmydata apt-get install --no-install-recommends -y \ + aptitude \ + devscripts \ + ccache \ + equivs \ + build-essential \ + python3 + # Enter source package dir + cd ${WORKING_DIR}/${SOURCE_DIR} + # Install package build dependencies + eatmydata install-build-deps.sh . + # Generate ccache links + dpkg-reconfigure ccache + PATH="/usr/lib/ccache/:${PATH}" + # Reset ccache stats + ccache -z + # Create salsaci user and fix permissions + useradd salsaci + chown -R salsaci. ${WORKING_DIR} ${CCACHE_DIR} + # Define buildlog filename + BUILD_LOGFILE_SOURCE=$(dpkg-parsechangelog -S Source) + BUILD_LOGFILE_VERSION=$(dpkg-parsechangelog -S Version) + BUILD_LOGFILE_VERSION=${BUILD_LOGFILE_VERSION#*:} + BUILD_LOGFILE_ARCH=$(dpkg --print-architecture) + BUILD_LOGFILE="${WORKING_DIR}/${BUILD_LOGFILE_SOURCE}_${BUILD_LOGFILE_VERSION}_${BUILD_LOGFILE_ARCH}.build" + # Build package as user salsaci + su salsaci -c "eatmydata dpkg-buildpackage ${DB_BUILD_PARAM}" |& OUTPUT_FILENAME=${BUILD_LOGFILE} filter-output + # Restore PWD to ${WORKING_DIR} + cd ${WORKING_DIR} + rm -rf ${WORKING_DIR}/${SOURCE_DIR} + # Print ccache stats on job log + ccache -s + mv ${CCACHE_TMP_DIR} ${CCACHE_WORK_DIR} autopkgtest: extends: .test-autopkgtest - allow_failure: true piuparts: extends: .test-piuparts @@ -77,22 +124,75 @@ piuparts: blhc: extends: .test-blhc stage: test extras - dependencies: - - build native deb # Needs the correct debian/output/*.build - allow_failure: true + needs: + - job: build native deb + artifacts: true -lintian: - extends: .test-lintian +# In addition to Salsa-CI, also run these fully MariaDB specific build jobs -missing-breaks: - extends: .test-missing-breaks +# Define snippets used to construct jobs -# In addition to Salsa-CI, also run these fully MariaDB specific build jobs +.test-prepare-container: &test-prepare-container | + cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output + # Enable automatic restarts from maint scripts + sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d + # Fake /sbin/runlevel to avoid warnings of "invoke-rc.d: could not determine current runlevel" + echo -e '#!/bin/sh\necho "N 5"' > /sbin/runlevel; chmod +x /sbin/runlevel + # Avoid the warnings of "debconf: unable to initialize frontend: Dialog" + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + # Prime the apt cache so later apt commands can run + apt-get update + +.test-verify-initial: &test-verify-initial | + dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed + service mysql status || service mariadb status # Early MariaDB 10.5 only had 'mariadb' + mysql --skip-column-names -e "select @@version, @@version_comment" # Show version + echo 'SHOW DATABASES;' | mysql # List databases before upgrade + mysql -e "SELECT Host, User, plugin,authentication_string FROM user;" mysql + mysql -e "SELECT * FROM plugin;" mysql + +.test-enable-sid-repos: &test-enable-sid-repos | + # Replace any old repos with just Sid + echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list + # Upgrade minimal stack first + apt-get update + apt-get install -y apt + +.test-install: &test-install | + # Install MariaDB built in this commit + apt-get install -y ./*.deb + # Verify installation of MariaDB built in this commit + dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed + mariadb --version # Client version + +.test-verify-final: &test-verify-final | + mkdir -p debug # Ensure dir exists before using it + find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" + cp -ra /etc/mysql debug/etc-mysql + cp -ra /var/log/mysql debug/var-log-mysql + mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version + echo 'SHOW DATABASES;' | mariadb # List databases + mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test that InnoDB works + mariadb -e "SELECT Host, User, plugin,authentication_string FROM user;" mysql + mariadb -e "SELECT * FROM plugin;" mysql + +.test-verify-libs: &test-verify-libs + # Don't use a collapsed command as Gitlab-CI would hide each command from the output + - ldconfig -p | grep -e mariadb -e mysql + - pkg-config --list-all + - pkg-config --cflags --libs mysqlclient + - pkg-config --cflags --libs libmariadb + - pkg-config --cflags --libs mariadb + - apt-get install -y --no-install-recommends g++ + +.test-install-all-libs: &test-install-all-libs + - apt-get install -y ./libmariadb3_*.deb ./libmariadb-dev_*.deb ./libmariadb-dev-compat_*.deb ./libmariadbd19_*.deb ./libmariadbd-dev_*.deb ./mariadb-common_*.deb fresh install: stage: test - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:${RELEASE} artifacts: when: always @@ -100,72 +200,43 @@ fresh install: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - # Install MariaDB built in this commit - - apt-get install -y ./*.deb - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-prepare-container + - *test-install - service mariadb status # There is no init.d/mysql in MariaDB 10.6 - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version - - echo 'SHOW DATABASES;' | mariadb # List databases - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.3.x to mariadb-10.6.y upgrade: +mariadb-10.6 Sid upgrade: stage: upgrade in Sid - dependencies: - - build - image: debian:sid + needs: + - job: build + artifacts: true + image: debian:${RELEASE} artifacts: when: always name: "$CI_BUILD_NAME" paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - # Install almost everything currently in Debian Sid - - apt-get install -y 'default-mysql*' 'mariadb-*' libmariadb3 'libmariadb-*' 'libmariadbd*' 'libmariadbclient-*' - # Verify installation of MariaDB currently in Debian Sid - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mysql status - - mariadb --skip-column-names -e "select @@version, @@version_comment" - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - apt-get install -o Dpkg::Options::=--force-confnew -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version - - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-prepare-container + - *test-install + - service mariadb status # There is no init.d/mysql in MariaDB 10.6 + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.3.x buster to mariadb-10.6 upgrade: - stage: upgrade from Buster/Stretch/Jessie - dependencies: - - build +mariadb-10.3 Buster to mariadb-10.6 upgrade: + stage: upgrade from Buster/Stretch + needs: + - job: build + artifacts: true image: debian:buster artifacts: when: always @@ -173,43 +244,26 @@ mariadb-10.3.x buster to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - # Install almost everything currently in Debian Buster - - apt-get install -y 'default-mysql*' 'mariadb-*' libmariadb3 'libmariadb-*' 'libmariadbd*' 'libmariadbclient-*' + - *test-prepare-container + # Install everything MariaDB currently in Debian Buster + - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadb*' # Verify installation of MariaDB from Buster - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mysql status - - mysql --skip-column-names -e "select @@version, @@version_comment" - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - sed 's/buster/sid/g' -i /etc/apt/sources.list # Enable next Debian release - - sed '/sid-updates/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid - - sed '/security/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid - - apt-get update; apt-get install -y apt # Uprade minimal stack first - - apt-get install -o Dpkg::Options::=--force-confnew -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-verify-initial + - *test-enable-sid-repos + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-10.1 to mariadb-10.6 upgrade: - stage: upgrade from Buster/Stretch/Jessie - dependencies: - - build +mariadb-10.1 Stretch to mariadb-10.6 upgrade: + stage: upgrade from Buster/Stretch + needs: + - job: build + artifacts: true image: debian:stretch artifacts: when: always @@ -217,43 +271,27 @@ mariadb-10.1 to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - # Install almost everything currently in Debian Stretch + - *test-prepare-container + # Install almost everything currently in Debian Stretch, + # omitting libmariadbclient-dev-compat as it would conflict - apt-get install -y 'default-mysql*' 'mariadb-*' 'libmariadbd*' 'libmariadbclient*' - # Verify installation of MariaDB from Stretch - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mysql status - - mysql --skip-column-names -e "select @@version, @@version_comment" - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - sed 's/stretch/sid/g' -i /etc/apt/sources.list # Enable next Debian release - - sed '/sid-updates/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid - - sed '/security/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid - - apt-get update; apt-get install -y apt # Uprade minimal stack first - - apt-get install -o Dpkg::Options::=--force-confnew -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + # Verify installation of MariaDB from Buster + - *test-verify-initial + - *test-enable-sid-repos + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ test basic features: stage: test - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:${RELEASE} artifacts: when: always @@ -261,46 +299,72 @@ test basic features: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - # Install MariaDB built in this commit - - apt-get install -y ./*.deb - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-prepare-container + - *test-install - service mariadb status # There is no init.d/mysql in MariaDB 10.6 - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - echo 'SHOW DATABASES;' | mariadb # List databases - # Print info about server - - mariadb --skip-column-names -e "select @@version, @@version_comment" - - mariadb --skip-column-names -e "select engine, support, transactions, savepoints from information_schema.engines order by engine" | sort - - mariadb --skip-column-names -e "select plugin_name, plugin_status, plugin_type, plugin_library, plugin_license from information_schema.all_plugins order by plugin_name, plugin_library" - # Test various features - - mariadb -e "CREATE DATABASE db" - - mariadb -e "CREATE TABLE db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB; INSERT INTO db.t_innodb VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" - - mariadb -e "CREATE TABLE db.t_myisam(a2 SERIAL, c2 CHAR(8)) ENGINE=MyISAM; INSERT INTO db.t_myisam VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" - - mariadb -e "CREATE TABLE db.t_aria(a3 SERIAL, c3 CHAR(8)) ENGINE=Aria; INSERT INTO db.t_aria VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" - - mariadb -e "CREATE TABLE db.t_memory(a4 SERIAL, c4 CHAR(8)) ENGINE=MEMORY; INSERT INTO db.t_memory VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" - - mariadb -e "CREATE ALGORITHM=MERGE VIEW db.v_merge AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria" - - mariadb -e "CREATE ALGORITHM=TEMPTABLE VIEW db.v_temptable AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria" - - mariadb -e "CREATE PROCEDURE db.p() SELECT * FROM db.v_merge" - - mariadb -e "CREATE FUNCTION db.f() RETURNS INT DETERMINISTIC RETURN 1" - # Test that the features still work (this step can be done e.g. after an upgrade) - - mariadb -e "SHOW TABLES IN db" - - mariadb -e "SELECT * FROM db.t_innodb; INSERT INTO db.t_innodb VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" - - mariadb -e "SELECT * FROM db.t_myisam; INSERT INTO db.t_myisam VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" - - mariadb -e "SELECT * FROM db.t_aria; INSERT INTO db.t_aria VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" - - mariadb -e "SELECT * FROM db.t_memory; INSERT INTO db.t_memory VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" - - mariadb -e "SELECT COUNT(*) FROM db.v_merge" - - mariadb -e "SELECT COUNT(*) FROM db.v_temptable" - - mariadb -e "CALL db.p()" - - mariadb -e "SELECT db.f()" + - *test-verify-final + - | + # Print info about server + mariadb --skip-column-names -e "select @@version, @@version_comment" + mariadb --skip-column-names -e "select engine, support, transactions, savepoints from information_schema.engines order by engine" | sort + mariadb --skip-column-names -e "select plugin_name, plugin_status, plugin_type, plugin_library, plugin_license from information_schema.all_plugins order by plugin_name, plugin_library" + # Test various features + mariadb -e "CREATE DATABASE db" + mariadb -e "CREATE TABLE db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB; INSERT INTO db.t_innodb VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" + mariadb -e "CREATE TABLE db.t_myisam(a2 SERIAL, c2 CHAR(8)) ENGINE=MyISAM; INSERT INTO db.t_myisam VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" + mariadb -e "CREATE TABLE db.t_aria(a3 SERIAL, c3 CHAR(8)) ENGINE=Aria; INSERT INTO db.t_aria VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" + mariadb -e "CREATE TABLE db.t_memory(a4 SERIAL, c4 CHAR(8)) ENGINE=MEMORY; INSERT INTO db.t_memory VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')" + mariadb -e "CREATE ALGORITHM=MERGE VIEW db.v_merge AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria" + mariadb -e "CREATE ALGORITHM=TEMPTABLE VIEW db.v_temptable AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria" + mariadb -e "CREATE PROCEDURE db.p() SELECT * FROM db.v_merge" + mariadb -e "CREATE FUNCTION db.f() RETURNS INT DETERMINISTIC RETURN 1" + # Test that the features still work (this step can be done e.g. after an upgrade) + mariadb -e "SHOW TABLES IN db" + mariadb -e "SELECT * FROM db.t_innodb; INSERT INTO db.t_innodb VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" + mariadb -e "SELECT * FROM db.t_myisam; INSERT INTO db.t_myisam VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" + mariadb -e "SELECT * FROM db.t_aria; INSERT INTO db.t_aria VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" + mariadb -e "SELECT * FROM db.t_memory; INSERT INTO db.t_memory VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')" + mariadb -e "SELECT COUNT(*) FROM db.v_merge" + mariadb -e "SELECT COUNT(*) FROM db.v_temptable" + mariadb -e "CALL db.p()" + mariadb -e "SELECT db.f()" + - | + # Test TLS connections + dpkg -l | grep -i -e tls -e ssl + # Create user for TCP connection, must have password + mariadb -e "SET PASSWORD FOR 'mysql'@'localhost' = PASSWORD('asdf234');" + cat <<EOF > /root/.my.cnf + [client] + user=mysql + password=asdf234 + protocol=tcp + EOF + export CERT_PATH=/usr/share/mysql/mysql-test/std_data + openssl verify -CAfile $CERT_PATH/cacert.pem $CERT_PATH/server-cert.pem + openssl x509 -subject -issuer -noout -in $CERT_PATH/cacert.pem + openssl x509 -subject -issuer -noout -in $CERT_PATH/server-cert.pem + cat <<EOF > /etc/mysql/mariadb.conf.d/tls.cnf + [client-server] + ssl = on + ssl-ca = $CERT_PATH/cacert.pem + ssl-cert = $CERT_PATH/server-cert.pem + ssl-key = $CERT_PATH/server-key.pem + [server] + require-secure-transport = on + [client] + ssl-verify-server-cert = on + EOF + service mariadb restart + mariadb -Bse 'STATUS' | tee result + # Ensure important values present, otherwise fail job + grep --quiet "localhost via TCP/IP" result + mariadb -Bse 'SHOW VARIABLES' | grep -e tls -e ssl | tee result + grep --quiet "have_ssl YES" result + grep --quiet TLSv1.3 result + mariadb -Bse 'SHOW SESSION STATUS' | grep -i -e tls -e ssl | tee result + grep --quiet TLSv1.3 result variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ @@ -309,13 +373,14 @@ test basic features: # libmariadb-dev-compat layer. Should always end up using libmariadb.so.3 run-time. build mariadbclient consumer Python-MySQLdb: stage: test - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:${RELEASE} script: - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - mkdir -p debug # Ensure dir exists before using it - - apt-get update + - *test-prepare-container + # Run each step separately to avoitda 800+ lines chunk that lacks the + # commands themselves printed and Gitlab-CI cutting off the output - apt-get install -y pkg-config ./libmariadb-dev*.deb ./libmariadb3_*.deb ./mariadb-common*.deb - pkg-config --cflags --libs mysqlclient # See what MySQLdb builds with - apt-get install -y python3-pip @@ -323,27 +388,26 @@ build mariadbclient consumer Python-MySQLdb: - apt-get purge -y libmariadb-dev # Not needed for run-time - python3 -c "import MySQLdb; print(MySQLdb.get_client_info())" variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ libmysql* to libmariadb* upgrade: - stage: test extras - dependencies: - - build - image: debian:unstable + stage: upgrade in Sid + needs: + - job: build + artifacts: true + image: debian:${RELEASE} artifacts: when: always name: "$CI_BUILD_NAME" paths: - ${WORKING_DIR}/debug script: - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - dpkg -l | grep -iE 'maria|mysql|galera' || true - - apt-get update + - *test-prepare-container # Install all libmysql* available in Debian unstable - - apt-get install -y pkg-config libmysqld-dev libmysqlclient-dev + - apt-get install -y pkg-config libmysqlclient-dev - pkg-config --list-all - pkg-config --cflags mysqlclient # mysqlclient.pc from original package - apt-get install -y ./libmariadb3_*.deb ./mariadb-common_*.deb @@ -358,45 +422,37 @@ libmysql* to libmariadb* upgrade: - apt-get install -y ./libmariadbd-dev_*.deb - pkg-config --list-all - apt-get install -y default-libmysqlclient-dev default-libmysqld-dev - - ldconfig -p # | grep -e mariadb -e mysql - - pkg-config --list-all - - pkg-config --cflags --libs mysqlclient - - pkg-config --cflags --libs libmariadb - - pkg-config --cflags --libs mariadb + - *test-verify-libs except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -default-libmysqlclient-dev upgrade: +default-libmysqlclient-dev Sid upgrade: stage: upgrade in Sid - dependencies: - - build - image: debian:sid + needs: + - job: build + artifacts: true + image: debian:${RELEASE} artifacts: when: always name: "$CI_BUILD_NAME" paths: - ${WORKING_DIR}/debug script: - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - dpkg -l | grep -iE 'maria|mysql|galera' || true - - apt-get update + - *test-prepare-container - apt-get install -y pkg-config default-libmysqlclient-dev default-libmysqld-dev - pkg-config --list-all - - apt-get install -y ./libmariadb3_*.deb ./libmariadb-dev_*.deb ./libmariadb-dev-compat_*.deb ./libmariadbd19_*.deb ./libmariadbd-dev_*.deb ./mariadb-common_*.deb - - ldconfig -p # | grep -e mariadb -e mysql - - pkg-config --list-all - - pkg-config --cflags --libs mysqlclient - - pkg-config --cflags --libs libmariadb - - pkg-config --cflags --libs mariadb + - *test-install-all-libs + - *test-verify-libs except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -default-libmysqlclient-dev on buster upgrade: - stage: upgrade from Buster/Stretch/Jessie - dependencies: - - build +default-libmysqlclient-dev Buster upgrade: + stage: upgrade from Buster/Stretch + needs: + - job: build + artifacts: true image: debian:buster artifacts: when: always @@ -404,27 +460,21 @@ default-libmysqlclient-dev on buster upgrade: paths: - ${WORKING_DIR}/debug script: - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - dpkg -l | grep -iE 'maria|mysql|galera' || true - - apt-get update + - *test-prepare-container - apt-get install -y pkg-config default-libmysqlclient-dev - pkg-config --list-all - - echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list - - apt-get update; apt-get install -y apt # Uprade minimal stack first - - apt-get install -y ./libmariadb3_*.deb ./libmariadb-dev_*.deb ./libmariadb-dev-compat_*.deb ./libmariadbd19_*.deb ./libmariadbd-dev_*.deb ./mariadb-common_*.deb - - ldconfig -p # | grep -e mariadb -e mysql - - pkg-config --list-all - - pkg-config --cflags --libs mysqlclient - - pkg-config --cflags --libs libmariadb - - pkg-config --cflags --libs mariadb + - *test-enable-sid-repos + - *test-install-all-libs + - *test-verify-libs except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -default-libmysqlclient-dev on stretch upgrade: - stage: upgrade from Buster/Stretch/Jessie - dependencies: - - build +default-libmysqlclient-dev Stretch upgrade: + stage: upgrade from Buster/Stretch + needs: + - job: build + artifacts: true image: debian:stretch artifacts: when: always @@ -432,27 +482,21 @@ default-libmysqlclient-dev on stretch upgrade: paths: - ${WORKING_DIR}/debug script: - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - dpkg -l | grep -iE 'maria|mysql|galera' || true - - apt-get update + - *test-prepare-container - apt-get install -y pkg-config default-libmysqlclient-dev - pkg-config --list-all - - echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list - - apt-get update; apt-get install -y apt # Uprade minimal stack first - - apt-get install -y ./libmariadb3_*.deb ./libmariadb-dev_*.deb ./libmariadb-dev-compat_*.deb ./libmariadbd19_*.deb ./libmariadbd-dev_*.deb ./mariadb-common_*.deb - - ldconfig -p # | grep -e mariadb -e mysql - - pkg-config --list-all - - pkg-config --cflags --libs mysqlclient - - pkg-config --cflags --libs libmariadb - - pkg-config --cflags --libs mariadb + - *test-enable-sid-repos + - *test-install-all-libs + - *test-verify-libs except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb-connector-c on stretch upgrade: - stage: upgrade from Buster/Stretch/Jessie - dependencies: - - build +mariadb-connector-c Stretch upgrade: + stage: upgrade from Buster/Stretch + needs: + - job: build + artifacts: true image: debian:stretch artifacts: when: always @@ -460,73 +504,52 @@ mariadb-connector-c on stretch upgrade: paths: - ${WORKING_DIR}/debug script: - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - dpkg -l | grep -iE 'maria|mysql|galera' || true - - apt-get update + - *test-prepare-container - apt-get install -y pkg-config libmariadb2 libmariadb-dev libmariadb-dev-compat - pkg-config --list-all - - echo 'deb http://deb.debian.org/debian sid main' > /etc/apt/sources.list - - apt-get update; apt-get install -y apt # Uprade minimal stack first - - apt-get install -y ./libmariadb3_*.deb ./libmariadb-dev_*.deb ./libmariadb-dev-compat_*.deb ./libmariadbd19_*.deb ./libmariadbd-dev_*.deb ./mariadb-common_*.deb - - ldconfig -p # | grep -e mariadb -e mysql - - pkg-config --list-all - - pkg-config --cflags --libs mysqlclient - - pkg-config --cflags --libs libmariadb - - pkg-config --cflags --libs mariadb + - *test-enable-sid-repos + - *test-install-all-libs + - *test-verify-libs except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mysql-5.5 to mariadb-10.6 upgrade: - stage: upgrade from Buster/Stretch/Jessie - dependencies: - - build - image: debian:jessie +# Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. +# The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. +mysql-8.0 Sid to mariadb-10.6 upgrade: + stage: upgrade in Sid + needs: + - job: build + artifacts: true + image: debian:sid artifacts: when: always name: "$CI_BUILD_NAME" paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - - apt-get install -y mysql-server - # Verify installation of MySQL from Jessie - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mysql status - - mysql --skip-column-names -e "select @@version, @@version_comment" - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - sed 's/jessie/sid/g' -i /etc/apt/sources.list # Enable next Debian release - - sed '/sid-updates/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid - - sed '/security/d' -i /etc/apt/sources.list # Remove repositories that don't exist for Sid - - apt-get update; apt-get install -y apt || true # Install apt 1.4.9 so the wildcard command below works - - apt-get dist-upgrade -y || true # Upgrade all to avoid udev/systemd failures - - apt-get install -o Dpkg::Options::=--force-confnew -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-prepare-container + # First install often fail due to bug in mysql-8.0 + - apt-get install -y mysql-server 'libmysqlc*' || true + - sleep 10 && apt-get install -f + - *test-verify-initial + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - mariadb --skip-column-names -e "select @@version, @@version_comment" # Show version - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + # Installation often fails (not a MariaDB reason), so do not require this test to pass + allow_failure: true -# Upgrading from MySQL 5.7 involves automatic renaming of auth_socket plugin -# to unix_socket and automaticly re-adding Password column in user table. -mysql-5.7 to mariadb-10.6 upgrade: - stage: test extras - dependencies: - - build +mysql-5.7 Sid to mariadb-10.6 upgrade: + stage: upgrade in Sid + needs: + - job: build + artifacts: true image: debian:sid artifacts: when: always @@ -534,94 +557,98 @@ mysql-5.7 to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update - - apt-get install -y mysql-server - # Verify installation of MySQL from Sid - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mysql status - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-prepare-container + - apt-get install -y mysql-server-5.7 'libmysqlc*' + - *test-verify-initial + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ # Upgrading from MySQL 8.0 with datadir in place is not possible. Users need to do a data dump. # The Debian maintainer scripts detect this situation and simply moves old datadir aside and start fresh. -mysql-8.0 to mariadb-10.6 upgrade: +mysql-8.0 Focal to mariadb-10.6 upgrade: stage: upgrade extras - dependencies: - - build - image: debian:sid + needs: + - job: build buster-backports + artifacts: true + image: debian:buster artifacts: when: always name: "$CI_BUILD_NAME" paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output + - *test-prepare-container # Add Ubuntu Focal archive keys and repository - - apt-get update - apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work - apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 871920D1991BC93C 3B4FE6ACC0B21F32 - echo 'deb http://archive.ubuntu.com/ubuntu/ focal main restricted' > /etc/apt/sources.list.d/ubuntu.list - apt-get update - - apt-get install -y mysql-server - # Verify installation of MySQL from Ubuntu Focal - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed + # First install often fail due to bug in mysql-8.0 + - apt-get install -y mysql-server 'libmysqlc*' || true + - sleep 10 && apt-get install -f + - *test-verify-initial + # Enable backports to make galera-4 available + - echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list && apt-get update + - *test-install - service mysql status - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - *test-verify-final + variables: + GIT_STRATEGY: none + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + # Installation often fails (not a MariaDB reason), so do not require this test to pass + allow_failure: true + +mysql-5.7 Bionic to mariadb-10.5 upgrade: + stage: upgrade extras + needs: + - job: build stretch-backports + artifacts: true + image: debian:stretch + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + # Add Ubuntu Bionic archive keys and repository + - apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work + - apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 871920D1991BC93C 3B4FE6ACC0B21F32 + - echo 'deb http://archive.ubuntu.com/ubuntu/ bionic main restricted' > /etc/apt/sources.list.d/ubuntu.list + - apt-get update + - apt-get install -y 'mysql*' 'libmysqlc*' + - *test-verify-initial + # Enable backports to make libzstd1, rocksdb-tools + - echo 'deb http://deb.debian.org/debian stretch-backports main' >> /etc/apt/sources.list.d/backports.list + # Enable backports to make galera-4 available + - echo 'deb http://deb.debian.org/debian stretch-backports-sloppy main' >> /etc/apt/sources.list.d/backports.list && apt-get update + # Remove plugin that requires libcurl4, not available in Debian Stretch + - rm mariadb-plugin-s3*.deb + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ -mariadb.org-10.5.x to mariadb-10.6 upgrade: +mariadb.org-10.5 to mariadb-10.6 upgrade: stage: upgrade extras - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:sid artifacts: when: always @@ -629,47 +656,33 @@ mariadb.org-10.5.x to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update + - *test-prepare-container - apt install -y curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo 'deb [arch=amd64,i386] http://mirror.one.com/mariadb/repo/10.5/debian sid main' > /etc/apt/sources.list.d/mariadb.list + - echo 'deb http://mirror.one.com/mariadb/repo/10.5/debian sid main' > /etc/apt/sources.list.d/mariadb.list - apt-get update - - apt-get install -y mariadb-server-10.5 - # Verify installation of MySQL from Sid - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - service mariadb status - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mysql + # Package libmariadbclient-dev from mariadb.org conficts with libmariadb-dev in Sid, so cannot use wildcard that would include it + - apt-get install -y 'mariadb*' libmariadb3 'libmariadb-*' 'libmariadbd*' + - *test-verify-initial # Install MariaDB built in this commit - - apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected + # Force downgrades so our version installs on top of upstream revision, e.g. 1:10.5.5-1 vs 1:10.5.5+mariadb~sid + - apt-get install -y --allow-downgrades ./*.deb # Verify installation of MariaDB built in this commit - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - mariadb --version # Client version - - service mariadb status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - service mariadb status # There is no init.d/mysql in MariaDB 10.5 + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ mariadb.org-10.4 to mariadb-10.6 upgrade: stage: upgrade extras - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:sid artifacts: when: always @@ -677,51 +690,32 @@ mariadb.org-10.4 to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update + - *test-prepare-container - apt install -y curl systemctl # systemctl shim needed on platforms that don't have systemd - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo 'deb [arch=amd64,i386] http://mirror.one.com/mariadb/repo/10.4/debian sid main' > /etc/apt/sources.list.d/mariadb.list + - echo 'deb http://mirror.one.com/mariadb/repo/10.4/debian sid main' > /etc/apt/sources.list.d/mariadb.list - apt-get update - apt-get install -y mariadb-server-10.4 - # Verify installation of MySQL from Sid - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed # MariaDB.org version of 10.4 and early 10.5 do not install an init file, so # it must be installed here manually - cp /usr/share/mysql/mysql.init /etc/init.d/mysql; chmod +x /etc/init.d/mysql; service mysql start; sleep 5 - - service mysql status - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mysql - # Install MariaDB built in this commit - - apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-verify-initial + - *test-install + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - service mysql status - service mariadb status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ mariadb.org-10.3 to mariadb-10.6 upgrade: stage: upgrade extras - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:sid artifacts: when: always @@ -729,48 +723,35 @@ mariadb.org-10.3 to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update + - *test-prepare-container - apt install -y curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo 'deb [arch=amd64,i386] http://mirror.one.com/mariadb/repo/10.3/debian sid main' > /etc/apt/sources.list.d/mariadb.list + - echo 'deb http://mirror.one.com/mariadb/repo/10.3/debian sid main' > /etc/apt/sources.list.d/mariadb.list - apt-get update - apt-get install -y mariadb-server-10.3 - # Verify installation of MySQL from Sid + # Verify initial state before upgrade - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - service mysql status # prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3 - mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment" + - echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf - mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf - # Install MariaDB built in this commit - - apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ mariadb.org-10.2 to mariadb-10.6 upgrade: stage: upgrade extras - dependencies: - - build + needs: + - job: build + artifacts: true image: debian:sid artifacts: when: always @@ -778,40 +759,91 @@ mariadb.org-10.2 to mariadb-10.6 upgrade: paths: - ${WORKING_DIR}/debug script: - - sed -i "s/101/0/g" -i /usr/sbin/policy-rc.d # Enable automatic restarts from maint scripts - - cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output - - apt-get update + - *test-prepare-container - apt install -y curl - curl -sS https://mariadb.org/mariadb_release_signing_key.asc -o /etc/apt/trusted.gpg.d/mariadb.asc - - echo 'deb [arch=amd64,i386] http://mirror.one.com/mariadb/repo/10.2/debian sid main' > /etc/apt/sources.list.d/mariadb.list + - echo 'deb http://mirror.one.com/mariadb/repo/10.2/debian sid main' > /etc/apt/sources.list.d/mariadb.list - apt-get update - apt-get install -y mariadb-server-10.2 - # Verify installation of MySQL from Sid + # Verify initial state before upgrade - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - service mysql status # prepending with --defaults-file=/etc/mysql/debian.cnf is needed in upstream 5.5–10.3 - mysql --defaults-file=/etc/mysql/debian.cnf --skip-column-names -e "SELECT @@version, @@version_comment" + - echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf - mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - mysql --defaults-file=/etc/mysql/debian.cnf -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mysql --defaults-file=/etc/mysql/debian.cnf - # Install MariaDB built in this commit - - apt-get install -y ./*.deb || true # Allow to proceed so debug artifacts get collected - # Verify installation of MariaDB built in this commit - - dpkg -l | grep -iE 'maria|mysql|galera' || true # List installed - - mariadb --version # Client version + - *test-install + - service mysql status + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - *test-verify-final + variables: + GIT_STRATEGY: none + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + +mysql.com-5.7 to mariadb-10.6 upgrade: + stage: upgrade extras + needs: + - job: build buster-backports + artifacts: true + image: debian:buster + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + - | + apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work + apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 8C718D3B5072E1F5 + echo 'deb https://repo.mysql.com/apt/debian/ buster mysql-5.7' > /etc/apt/sources.list.d/mysql.list + apt-get update + apt-get install -y 'mysql*' 'libmysqlc*' + - *test-verify-initial + # Enable backports to make galera-4 available + - echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list.d/backports.list && apt-get update + - *test-install + - service mysql status + - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server + - *test-verify-final + variables: + GIT_STRATEGY: none + except: + variables: + - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ + +percona-xtradb-5.7 to mariadb-10.6 upgrade (MDEV-22679): + stage: upgrade extras + needs: + - job: build buster-backports + artifacts: true + image: debian:buster + artifacts: + when: always + name: "$CI_BUILD_NAME" + paths: + - ${WORKING_DIR}/debug + script: + - *test-prepare-container + - | + apt-get install --no-install-recommends --yes gpg gpg-agent dirmngr ca-certificates # Bare minimal (<4MB) for apt-key to work + apt-key adv --recv-keys --keyserver hkps://keyserver.ubuntu.com:443 9334A25F8507EFA5 + echo 'deb https://repo.percona.com/apt/ buster main' > /etc/apt/sources.list.d/mysql.list + apt-get update + apt-get install -y percona-xtradb-cluster-full-57 percona-xtrabackup-24 percona-toolkit pmm2-client + - service mysql status + - *test-verify-initial + # Enable backports to make galera-4 available + - echo 'deb http://deb.debian.org/debian buster-backports main' >> /etc/apt/sources.list.d/backports.list && apt-get update + - *test-install - service mysql status - - mkdir -p debug # Ensure dir exists before using it - - find /var/lib/mysql -ls > debug/var-lib-mysql.list || true # Ignore errors about "no such file or directory" - - cp -ra /etc/mysql debug/etc-mysql - - cp -ra /var/log/mysql debug/var-log-mysql - sleep 5 # Give the mysql_upgrade a bit of time to complete before querying the server - - mysql --skip-column-names -e "SELECT @@version, @@version_comment" - - mysql -e "SELECT Host,User,plugin,authentication_string FROM user;" mysql - - mysql -e "SELECT * FROM plugin;" mysql - - echo 'SHOW DATABASES;' | mariadb # List databases before upgrade are still there - - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" # Test InnoDB works + - *test-verify-final variables: - GIT_STRATEGY: none + GIT_STRATEGY: none except: variables: - $CI_COMMIT_TAG != null && $SALSA_CI_ENABLE_PIPELINE_ON_TAGS !~ /^(1|yes|true)$/ diff --git a/debian/tests/smoke b/debian/tests/smoke index 600864ff012..5dcc9248ee4 100644 --- a/debian/tests/smoke +++ b/debian/tests/smoke @@ -68,7 +68,6 @@ EOT mysql <<EOT SET GLOBAL innodb_compression_algorithm=lz4; -SET GLOBAL innodb_compression_algorithm=snappy; SET GLOBAL innodb_compression_algorithm=zlib; SET GLOBAL innodb_compression_algorithm=none; EOT diff --git a/extra/wolfssl/CMakeLists.txt b/extra/wolfssl/CMakeLists.txt index 953d377ebcf..c99fb155dd6 100644 --- a/extra/wolfssl/CMakeLists.txt +++ b/extra/wolfssl/CMakeLists.txt @@ -9,20 +9,32 @@ ENDIF() IF(CMAKE_SIZEOF_VOID_P MATCHES 8) IF(MSVC) SET(WOLFSSL_INTELASM ON) + SET(WOLFSSL_X86_64_BUILD 1) + SET(HAVE_INTEL_RDSEED 1) + SET(HAVE_INTEL_RDRAND 1) ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64") + SET(WOLFSSL_X86_64_BUILD 1) IF(CMAKE_C_COMPILER_ID MATCHES GNU AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) MESSAGE_ONCE(NO_INTEL_ASSEMBLY "Disable Intel assembly for WolfSSL - compiler is too old") - ELSEIF(WITH_MSAN) - MESSAGE_ONCE(MSAN_CANT_HANDLE_IT - "Disable Intel assembly for WolfSSL - MSAN can't handle it") ELSE() - MY_CHECK_C_COMPILER_FLAG(-maes) - MY_CHECK_C_COMPILER_FLAG(-msse4) - MY_CHECK_C_COMPILER_FLAG(-mpclmul) + IF(WITH_MSAN) + MESSAGE_ONCE(MSAN_CANT_HANDLE_IT + "Disable Intel assembly for WolfSSL - MSAN can't handle it") + ELSE() + MY_CHECK_C_COMPILER_FLAG(-maes) + MY_CHECK_C_COMPILER_FLAG(-msse4) + MY_CHECK_C_COMPILER_FLAG(-mpclmul) + IF(have_C__maes AND have_C__msse4 AND have_C__mpclmul) + SET(WOLFSSL_INTELASM ON) + ENDIF() + ENDIF() MY_CHECK_C_COMPILER_FLAG(-mrdrnd) MY_CHECK_C_COMPILER_FLAG(-mrdseed) - IF(have_C__maes AND have_C__msse4 AND have_C__mpclmul) - SET(WOLFSSL_INTELASM ON) + IF(have_C__mrdrnd) + SET(HAVE_INTEL_RDRAND ON) + ENDIF() + IF(have_C__mrdseed) + SET(HAVE_INTEL_RDSEED ON) ENDIF() ENDIF() ENDIF() @@ -44,7 +56,7 @@ ADD_DEFINITIONS(-DWOLFSSL_LIB -DBUILDING_WOLFSSL) INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/wolfssl) IF(MSVC) # size_t to long truncation warning - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4267 -wd4334 -wd4028") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4267 -wd4334 -wd4028 -wd4244") ENDIF() ADD_CONVENIENCE_LIBRARY(wolfssl ${WOLFSSL_SOURCES}) @@ -109,33 +121,22 @@ ELSE() SET(WOLFCRYPT_SOURCES ${WOLFCRYPT_SOURCES} ${WOLFCRYPT_SRCDIR}/integer.c) ENDIF() -IF(WOLFSSL_INTELASM) - SET(WOLFSSL_AESNI 1) - +IF(WOLFSSL_X86_64_BUILD) LIST(APPEND WOLFCRYPT_SOURCES ${WOLFCRYPT_SRCDIR}/cpuid.c) IF(MSVC) + SET(WOLFSSL_AESNI 1) LIST(APPEND WOLFCRYPT_SOURCES ${WOLFCRYPT_SRCDIR}/aes_asm.asm) - SET(WOLFSSL_X86_64_BUILD 1) - SET(HAVE_INTEL_RDSEED 1) - SET(HAVE_INTEL_RDRAND 1) IF(CMAKE_C_COMPILER_ID MATCHES Clang) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -msse4.2 -mpclmul -mrdrnd -mrdseed") ENDIF() - ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64") + ELSEIF(WOLFSSL_INTELASM) + SET(WOLFSSL_AESNI 1) SET(USE_INTEL_SPEEDUP 1) LIST(APPEND WOLFCRYPT_SOURCES - ${WOLFCRYPT_SRCDIR}/aes_asm.S - ${WOLFCRYPT_SRCDIR}/sha512_asm.S - ${WOLFCRYPT_SRCDIR}/sha256_asm.S) - ADD_DEFINITIONS(-maes -msse4 -mpclmul) - IF(have_C__mrdrnd) - SET(HAVE_INTEL_RDRAND 1) - ADD_DEFINITIONS(-mrdrnd) - ENDIF() - IF(have_C__mrdseed) - SET(HAVE_INTEL_RDSEED 1) - ADD_DEFINITIONS(-mrdseed) - ENDIF() + ${WOLFCRYPT_SRCDIR}/aes_asm.S + ${WOLFCRYPT_SRCDIR}/sha512_asm.S + ${WOLFCRYPT_SRCDIR}/sha256_asm.S) + ADD_DEFINITIONS(-maes -msse4.2 -mpclmul) ENDIF() ENDIF() diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl -Subproject e116c89a58af750421d82ece13f80516d2bde02 +Subproject 9c87f979a7f1d3a6d786b260653d566c1d31a1c diff --git a/include/ssl_compat.h b/include/ssl_compat.h index 8cc0e6a9a2b..9f4b6be8d95 100644 --- a/include/ssl_compat.h +++ b/include/ssl_compat.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2016, 2017 MariaDB Corporation + Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,19 +73,19 @@ #define EVP_MD_CTX_SIZE sizeof(EVP_MD_CTX) #endif -#define OPENSSL_init_ssl(X,Y) SSL_library_init() #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G)) #define EVP_CIPHER_CTX_buf_noconst(ctx) ((ctx)->buf) #define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt) #define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX) #ifndef HAVE_WOLFSSL +#define OPENSSL_init_ssl(X,Y) SSL_library_init() #define EVP_MD_CTX_reset(X) EVP_MD_CTX_cleanup(X) #define EVP_CIPHER_CTX_reset(X) EVP_CIPHER_CTX_cleanup(X) -#endif #define X509_get0_notBefore(X) X509_get_notBefore(X) #define X509_get0_notAfter(X) X509_get_notAfter(X) #endif +#endif #ifndef TLS1_3_VERSION #define SSL_CTX_set_ciphersuites(X,Y) 0 diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result index b859715e024..83ca6d5cf3f 100644 --- a/mysql-test/suite/perfschema/r/misc.result +++ b/mysql-test/suite/perfschema/r/misc.result @@ -164,3 +164,13 @@ Warnings: Note 1051 Unknown table 'test.t0' FLUSH TABLE t0; DROP TABLE t0; +# +# MDEV-24364 Alter rename table does not remove PFS share +# +create or replace table yt4 (x int) engine innodb; +alter table yt4 rename to t1, algorithm=copy; +drop tables t1; +select object_type, object_schema, object_name +from performance_schema.objects_summary_global_by_type +where object_schema="test"; +object_type object_schema object_name diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test index 38972f42cef..848be3beea1 100644 --- a/mysql-test/suite/perfschema/t/misc.test +++ b/mysql-test/suite/perfschema/t/misc.test @@ -287,3 +287,14 @@ enable_query_log; # an unexpected refcount. FLUSH TABLE t0; DROP TABLE t0; + +--echo # +--echo # MDEV-24364 Alter rename table does not remove PFS share +--echo # +create or replace table yt4 (x int) engine innodb; +alter table yt4 rename to t1, algorithm=copy; +drop tables t1; + +select object_type, object_schema, object_name +from performance_schema.objects_summary_global_by_type +where object_schema="test"; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 318c01bb1dc..4e1ff93c576 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -10956,6 +10956,8 @@ do_continue:; { /* The original table is the backup */ backup_name= alter_ctx.table_name; + PSI_CALL_drop_table_share(0, alter_ctx.db.str, (int) alter_ctx.db.length, + alter_ctx.table_name.str, (int) alter_ctx.table_name.length); } // Rename the new table to the correct name. diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 1e24803c8c1..7dd36e7df0b 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -38,6 +38,7 @@ Created 10/21/1995 Heikki Tuuri #include "fsp0types.h" #include "tpool.h" +#include "my_counter.h" #ifndef _WIN32 #include <dirent.h> @@ -266,7 +267,7 @@ struct os_file_size_t { constexpr ulint OS_AIO_N_PENDING_IOS_PER_THREAD= 256; -extern ulint os_n_file_reads; +extern Atomic_counter<ulint> os_n_file_reads; extern ulint os_n_file_writes; extern ulint os_n_fsyncs; diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index e461a44e143..b6188162d0c 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -154,7 +154,7 @@ static ulint os_innodb_umask = 0; #define WAIT_ALLOW_WRITES() innodb_wait_allow_writes() -ulint os_n_file_reads; +Atomic_counter<ulint> os_n_file_reads; static ulint os_bytes_read_since_printout; ulint os_n_file_writes; ulint os_n_fsyncs; @@ -4190,7 +4190,7 @@ os_aio_print(FILE* file) ULINTPF " OS fsyncs\n", log_sys.get_pending_flushes(), ulint{fil_n_pending_tablespace_flushes}, - os_n_file_reads, + ulint{os_n_file_reads}, os_n_file_writes, os_n_fsyncs); |