polardbxengine/mysql-test/t/deprecation_56.test

123 lines
3.7 KiB
Plaintext

# The test needs myisam as innodb does not support system tables
--source include/force_myisam_default.inc
--source include/have_myisam.inc
--source include/no_valgrind_without_big.inc
--source include/have_profiling.inc
--source include/have_validate_password_plugin.inc
--source include/mysql_upgrade_preparation.inc
# Warning is generated when default file (NULL) is used
CALL mtr.add_suppression("Dictionary file not specified");
--echo #
--echo # Tests for deprecation warnings introduced by wl#6443
--echo #
--echo # System variables
select @@global.profiling;
select @@local.profiling;
select @@global.profiling_history_size;
select @@local.profiling_history_size;
select @@global.have_profiling;
set @@local.profiling= @@global.profiling;
set @@local.profiling_history_size= @@global.profiling_history_size;
set @wl6443_have_profiling= @@global.have_profiling;
--echo # SHOW PROFILE and SHOW PROFILES
SHOW PROFILE;
SHOW PROFILE ALL;
SHOW PROFILE IPC;
SHOW PROFILES;
--echo # --plugin-xyz
--replace_regex /\.dll/.so/
eval INSTALL PLUGIN validate_password SONAME '$VALIDATE_PASSWORD';
--echo # restarting the server
# Write file to make mysql-test-run.pl wait for the server to stop
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Request shutdown
-- send_shutdown
# Call script that will poll the server waiting for it to disapear
-- source include/wait_until_disconnected.inc
--echo # Restart server.
--exec echo "restart:--plugin-validate-password-length=8" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Turn on reconnect
--enable_reconnect
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
# Turn off reconnect again
--disable_reconnect
UNINSTALL PLUGIN validate_password;
--echo # Search for deprecation warnings in error log.
--echo # YMMDD HH:MM:SS [Warning] The syntax 'plugin-validate-password-length' is deprecated and will be removed in a future release. Please use validate-password-length instead.
--let $log_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
--let LOGF= $log_file
perl;
use strict;
my $logf= $ENV{'LOGF'} or die "LOGF not set";
open(FILE, "$logf") or die("Unable to open $logf: $!\n");
my $count_warnings= grep(/\[Warning\] \[[^]]*\] \[[^]]*\] The syntax 'plugin-validate-password-length' is deprecated and will be removed in a future release\. Please use validate-password-length instead\./gi,<FILE>);
my $count_warnings= $count_warnings;
print "Deprecation warning count : $count_warnings\n";
close(FILE);
# Truncate the log file so that repititions of the test don't pick up deprecation warnings from previous runs
open(FILE,">$logf") or die("Unable to open $logf for truncation $!\n");
close(FILE);
EOF
--echo # Host table deprecation
select count(*) from information_schema.tables where table_name like 'host' and table_schema like 'mysql' and table_type like 'BASE TABLE';
create table mysql.host(c1 int) engine MyISAM;
insert into mysql.host values(1);
--let $restart_parameters = restart: --upgrade=FORCE
--let $wait_counter= 10000
--source include/restart_mysqld.inc
drop table mysql.host;
create view mysql.host as select HOST from mysql.db;
create user 'wl6443_u1'@'10.10.10.1' identified by 'sql';
select count(*) from mysql.host;
--let $restart_parameters = restart: --upgrade=FORCE
--let $wait_counter= 10000
--source include/restart_mysqld.inc
# Clean Up
drop view mysql.host;
drop user 'wl6443_u1'@'10.10.10.1';
--let $restart_parameters = restart: --upgrade=FORCE
--let $wait_counter= 10000
--source include/restart_mysqld.inc
--echo # End of 5.6 tests
--echo #
--echo # WL#6802: Deprecate the INFORMATION_SCHEMA.PROFILING table
--echo #
SELECT * FROM INFORMATION_SCHEMA.profiling;
--source include/mysql_upgrade_cleanup.inc
--echo # End of 5.7 tests