From c37ebaf6c224e7ba571653eecd48a080d4c1a061 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 11 Dec 2022 00:23:16 +0100 Subject: [PATCH] MDEV-30153 ad hoc client versions are confusing try to make them less confusing for users. Hopefully, if the version string will be changed like - mariadb Ver 15.1 Distrib 10.11.2-MariaDB for Linux (x86_64) + mariadb from 10.11.2-MariaDB, client 15.1 for Linux (x86_64) users will be less inclined to reply "15.1" to the question "what mariadb version are you using?" --- client/mysql.cc | 8 ++++---- include/welcome_copyright_notice.h | 4 ++-- mysql-test/main/mysqlbinlog.result | 2 +- mysql-test/main/mysqlbinlog.test | 2 +- mysql-test/suite/innodb_zip/r/innochecksum_2.result | 3 ++- mysql-test/suite/innodb_zip/t/innochecksum_2.test | 4 ++-- scripts/wsrep_sst_mysqldump.sh | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 0ec8c734f24..06e662ad860 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1850,12 +1850,12 @@ static void usage(int version) #else const char* readline= "readline"; #endif - printf("%s Ver %s Distrib %s for %s (%s) using %s %s\n", - my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE, + printf("%s from %s, client %s for %s (%s) using %s %s\n", + my_progname, MYSQL_SERVER_VERSION, VER, SYSTEM_TYPE, MACHINE_TYPE, readline, rl_library_version); #else - printf("%s Ver %s Distrib %s for %s (%s), source revision %s\n", my_progname, VER, - MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE,SOURCE_REVISION); + printf("%s from %s, client %s for %s (%s), source revision %s\n", my_progname, + MYSQL_SERVER_VERSION, VER, SYSTEM_TYPE, MACHINE_TYPE,SOURCE_REVISION); #endif if (version) diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index 7993cd1dc3a..e50e9a02d66 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -31,8 +31,8 @@ static inline void print_version() { /* NOTE mysql.cc is not using this function! */ - printf("%s Ver %s Distrib %s for %s (%s)\n", - my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); + printf("%s from %s, client %s for %s (%s)\n", + my_progname, MYSQL_SERVER_VERSION, VER, SYSTEM_TYPE, MACHINE_TYPE); } #endif #endif /* _welcome_copyright_notice_h_ */ diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result index 101d4940a48..1d1f0a12c14 100644 --- a/mysql-test/main/mysqlbinlog.result +++ b/mysql-test/main/mysqlbinlog.result @@ -1269,7 +1269,7 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; -mariadb-binlog Ver VER Distrib DISTRIB for OS (ARCH) +mariadb-binlog from #.#.#-MariaDB, client #.# for OS (ARCH) # # Test --rewrite-db # diff --git a/mysql-test/main/mysqlbinlog.test b/mysql-test/main/mysqlbinlog.test index cccf9657973..4ef47978602 100644 --- a/mysql-test/main/mysqlbinlog.test +++ b/mysql-test/main/mysqlbinlog.test @@ -608,7 +608,7 @@ eval SET GLOBAL SERVER_ID = $old_server_id; # # MDEV-12372 mysqlbinlog --version output is the same on 10.x as on 5.5.x, and contains not only version # -replace_regex /.*mariadb-binlog(\.exe)? Ver .* Distrib .* for .* \([-_a-zA-Z0-9]+\)/mariadb-binlog Ver VER Distrib DISTRIB for OS (ARCH)/; +replace_regex /for \S+/for OS/ /\d+/#/ /#[-_A-Za-z0-9]*-MariaDB,/#-MariaDB,/ /\(.*\)/(ARCH)/ /^.*binlog(\.exe)?/mariadb-binlog/; exec $MYSQL_BINLOG --version; --echo # diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_2.result b/mysql-test/suite/innodb_zip/r/innochecksum_2.result index 681d8e1f4c7..33d80b02ca8 100644 --- a/mysql-test/suite/innodb_zip/r/innochecksum_2.result +++ b/mysql-test/suite/innodb_zip/r/innochecksum_2.result @@ -88,5 +88,6 @@ merge 0 Number of pages:# Number of pages:# [4]:# Print the version of innochecksum and exit -innochecksum Ver #.#.## Restart the DB server +innochecksum from #.#.#-MariaDB, client #.# for OS (ARCH) +# Restart the DB server DROP TABLE t1; diff --git a/mysql-test/suite/innodb_zip/t/innochecksum_2.test b/mysql-test/suite/innodb_zip/t/innochecksum_2.test index 62e792c1ce4..1743bd4a1eb 100644 --- a/mysql-test/suite/innodb_zip/t/innochecksum_2.test +++ b/mysql-test/suite/innodb_zip/t/innochecksum_2.test @@ -62,7 +62,7 @@ open IN_FILE,"<", "$dir/tmp/$file" or die $!; open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!; while() { unless ($_=~ /^debug.*$/ || $_=~ /\-#, \-\-debug.*$/ || $_=~ /http:.*html/) { - $_=~ s/^\S*innochecksum.+Ver.+[0-9]*\.[0-9]*\.[0-9]*.+$/innochecksum Ver #.#.#/g; + $_=~ s/^\S*innochecksum.* from .+$/innochecksum Ver #.#.#/g; $_=~ s/(Copyright\s\(c\))\s([0-9]*),\s([0-9]*)(.*)/$1 YEAR, YEAR $4/g; $_=~ s/Usage:.*\[-c/Usage: innochecksum [-c/g; print OUT_FILE $_; @@ -85,7 +85,7 @@ EOF --exec $INNOCHECKSUM -c $MYSQLD_DATADIR/test/t1.ibd --echo [4]:# Print the version of innochecksum and exit ---replace_regex /.*innochecksum.*Ver.*[0-9]*.[0-9]*.[0-9]*.*/innochecksum Ver #.#.#/ +--replace_regex /for \S+/for OS/ /\d+/#/ /#[-_A-Za-z0-9]*-MariaDB,/#-MariaDB,/ /\(.*\)/(ARCH)/ /^.*innochecksum(\.exe)?/innochecksum/ --exec $INNOCHECKSUM -V $MYSQLD_DATADIR/test/t1.ibd --echo # Restart the DB server diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh index 82d8d4edd71..5e4a193b747 100644 --- a/scripts/wsrep_sst_mysqldump.sh +++ b/scripts/wsrep_sst_mysqldump.sh @@ -40,7 +40,7 @@ then fi # Check client version -if ! $MYSQL_CLIENT --version | grep -q -E 'Distrib 10\.[1-9]'; then +if ! $MYSQL_CLIENT --version | grep -q -E '(Distrib 10\.[1-9])|( from 1[1-9]\.)'; then $MYSQL_CLIENT --version >&2 wsrep_log_error "this operation requires MySQL client version 10.1 or newer" exit $EINVAL