mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
cleanup: mysql_upgrade.test
make it strict, don't just ignore all the pesky numbers it shows, replace the current mariadb version with X.Y.Z, replace first two components of the current version with X.Y replace the first component (or first-1, if the second is 0) with X fix perl to write mysql_upgrade_info files in binary mode, otherwise mariadb-upgrade reads them incorrectly on Windows.
This commit is contained in:
@@ -47,7 +47,8 @@ test
|
|||||||
Phase 7/7: Running 'FLUSH PRIVILEGES'
|
Phase 7/7: Running 'FLUSH PRIVILEGES'
|
||||||
OK
|
OK
|
||||||
Run it again - should say already completed
|
Run it again - should say already completed
|
||||||
This installation of MariaDB is already upgraded to VERSION.There is no need to run mysql_upgrade again for VERSION.
|
This installation of MariaDB is already upgraded to X.Y.Z-MariaDB.
|
||||||
|
There is no need to run mysql_upgrade again for X.Y.Z-MariaDB.
|
||||||
You can use --force if you still want to run mysql_upgrade
|
You can use --force if you still want to run mysql_upgrade
|
||||||
Force should run it regardless of whether it has been run before
|
Force should run it regardless of whether it has been run before
|
||||||
Phase 1/7: Checking and upgrading mysql database
|
Phase 1/7: Checking and upgrading mysql database
|
||||||
@@ -776,11 +777,11 @@ FLUSH PRIVILEGES;
|
|||||||
#
|
#
|
||||||
# MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed
|
# MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed
|
||||||
#
|
#
|
||||||
This installation of MariaDB is already upgraded to MariaDB .
|
This installation of MariaDB is already upgraded to X.Y.Z-MariaDB.
|
||||||
There is no need to run mysql_upgrade again for MariaDB .
|
There is no need to run mysql_upgrade again for X.Y.Z-MariaDB.
|
||||||
Looking for 'mariadb' as: mariadb
|
Looking for 'mariadb' as: mariadb
|
||||||
This installation of MariaDB is already upgraded to MariaDB .
|
This installation of MariaDB is already upgraded to X.Y.Z-MariaDB.
|
||||||
There is no need to run mysql_upgrade again for MariaDB .
|
There is no need to run mysql_upgrade again for X.Y.Z-MariaDB.
|
||||||
#
|
#
|
||||||
# MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it
|
# MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it
|
||||||
#
|
#
|
||||||
@@ -790,17 +791,17 @@ Empty or non existent ...mysql_upgrade_info. Assuming mysql_upgrade has to be ru
|
|||||||
# MDEV-27279: mariadb_upgrade check-if-upgrade with minor version change
|
# MDEV-27279: mariadb_upgrade check-if-upgrade with minor version change
|
||||||
#
|
#
|
||||||
Looking for 'mariadb' as: mariadb
|
Looking for 'mariadb' as: mariadb
|
||||||
This installation of MariaDB is already upgraded to MariaDB .
|
This installation of MariaDB is already upgraded to X.Y.0-MariaDB.
|
||||||
There is no need to run mysql_upgrade again for MariaDB .
|
There is no need to run mysql_upgrade again for X.Y.Z-MariaDB.
|
||||||
This installation of MariaDB is already upgraded to MariaDB .
|
This installation of MariaDB is already upgraded to X.Y.0-MariaDB.
|
||||||
There is no need to run mysql_upgrade again for MariaDB .
|
There is no need to run mysql_upgrade again for X.Y.Z-MariaDB.
|
||||||
You can use --force if you still want to run mysql_upgrade
|
You can use --force if you still want to run mysql_upgrade
|
||||||
#
|
#
|
||||||
# MDEV-27279: mariadb_upgrade check-if-upgrade with major version change
|
# MDEV-27279: mariadb_upgrade check-if-upgrade with major version change
|
||||||
#
|
#
|
||||||
Major version upgrade detected from MariaDB to MariaDB . Check required!
|
Major version upgrade detected from X.0.99 to X.Y.Z-MariaDB. Check required!
|
||||||
Looking for 'mysql' as: mysql
|
Looking for 'mysql' as: mysql
|
||||||
Major version upgrade detected from MariaDB to MariaDB . Check required!
|
Major version upgrade detected from X.0.99 to X.Y.Z-MariaDB. Check required!
|
||||||
drop table mysql.global_priv;
|
drop table mysql.global_priv;
|
||||||
rename table mysql.global_priv_bak to mysql.global_priv;
|
rename table mysql.global_priv_bak to mysql.global_priv;
|
||||||
# End of 10.2 tests
|
# End of 10.2 tests
|
||||||
|
@@ -4,6 +4,10 @@
|
|||||||
-- source include/have_partition.inc
|
-- source include/have_partition.inc
|
||||||
-- source include/no_valgrind_without_big.inc
|
-- source include/no_valgrind_without_big.inc
|
||||||
|
|
||||||
|
let majorminor=`select substring_index(version(), '.', 2)`;
|
||||||
|
# for major upgrade test, see below
|
||||||
|
let major=`select substring_index(version(), '.', 1) - (version() like '%.0.%')`;
|
||||||
|
|
||||||
set sql_mode="";
|
set sql_mode="";
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -18,7 +22,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
|
|||||||
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
|
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
|
||||||
|
|
||||||
--echo Run it again - should say already completed
|
--echo Run it again - should say already completed
|
||||||
--replace_regex /upgraded to [^\n].*/upgraded to VERSION./ /again for [^\n]*/again for VERSION./
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB
|
||||||
--exec $MYSQL_UPGRADE 2>&1
|
--exec $MYSQL_UPGRADE 2>&1
|
||||||
|
|
||||||
# It should have created a file in the MySQL Servers datadir
|
# It should have created a file in the MySQL Servers datadir
|
||||||
@@ -288,10 +292,11 @@ FLUSH PRIVILEGES;
|
|||||||
|
|
||||||
--error 1
|
--error 1
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent
|
||||||
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB
|
||||||
--error 1
|
--error 1
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed
|
||||||
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB
|
||||||
|
--replace_regex /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/
|
||||||
--error 1
|
--error 1
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
|
||||||
|
|
||||||
@@ -319,16 +324,18 @@ perl;
|
|||||||
my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set";
|
my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set";
|
||||||
$ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.$2.0$4/;
|
$ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.$2.0$4/;
|
||||||
open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file";
|
open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file";
|
||||||
|
binmode FILE;
|
||||||
print FILE "$ver\n";
|
print FILE "$ver\n";
|
||||||
close(FILE);
|
close(FILE);
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
--error 1
|
--error 1
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent
|
||||||
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $majorminor X.Y
|
||||||
|
--replace_regex /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/
|
||||||
--error 1
|
--error 1
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
|
||||||
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $majorminor X.Y
|
||||||
--exec $MYSQL_UPGRADE
|
--exec $MYSQL_UPGRADE
|
||||||
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
|
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
|
||||||
|
|
||||||
@@ -343,16 +350,18 @@ let DATADIR= $MYSQLD_DATADIR;
|
|||||||
perl;
|
perl;
|
||||||
my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set";
|
my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set";
|
||||||
my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set";
|
my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set";
|
||||||
$ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.0.$3$4/;
|
$ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.0.99/;
|
||||||
open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file";
|
open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file";
|
||||||
|
binmode FILE;
|
||||||
print FILE "$ver\n";
|
print FILE "$ver\n";
|
||||||
close(FILE);
|
close(FILE);
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent
|
||||||
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $major X
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed
|
||||||
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mysql' as: mysql/
|
--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $major X
|
||||||
|
--replace_regex /'mariadb.* as:[^\n]*/'mysql' as: mysql/
|
||||||
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
|
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
|
||||||
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
|
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
|
||||||
drop table mysql.global_priv;
|
drop table mysql.global_priv;
|
||||||
|
Reference in New Issue
Block a user