AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/t/mysql_upgrade_slave_master_info.test
 # === Purpose ===
 #
 # This test case will verify that the mysql_upgrade script
 # corrects the order of the columns Channel_name and Tls_version
 # in the table mysql.slave_master_info if their order was wrong.
 # In case of mysql_upgrade happening from a release where the above
 # two columns are not present in the table, the test case certifies
 # that the upgrade script adds them in the correct order.
 #
 # ==== Related Bugs and Worklogs ====
 #
 # Bug #24384561: 5.7.14 COMPLAINS ABOUT WRONG
 #                SLAVE_MASTER_INFO AFTER UPGRADE FROM 5.7.13
 #

--source include/mysql_upgrade_preparation.inc

USE test;

# Preserve the original state of the table so that it can be restored at the end of the test.
CREATE TABLE test.slave_master_info_backup LIKE mysql.slave_master_info;
INSERT INTO test.slave_master_info_backup SELECT * FROM mysql.slave_master_info;

CREATE TABLE test.original
SELECT COLUMN_NAME, ORDINAL_POSITION
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_NAME = "slave_master_info"
  AND TABLE_SCHEMA = "mysql";

--echo # Scenario 1:
--echo # Verify that the upgrade script works correctly when upgrading from the same version
--echo # i.e. when both the columns Channel_name and Tls_version are in the correct order.
--disable_result_log
--exec $MYSQL_UPGRADE --skip-verbose --skip-sys-schema --force 2>&1
--enable_result_log

CREATE TABLE test.upgraded
SELECT COLUMN_NAME, ORDINAL_POSITION
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_NAME = "slave_master_info"
  AND TABLE_SCHEMA = "mysql";
--let $diff_tables= test.upgraded, test.original
--source include/diff_tables.inc
DROP TABLE test.upgraded;

--echo # Scenario 2:
--echo # Verify that the upgrade script corrects the order of columns Channel_name
--echo # and Tls_version in mysql.slave_master_info if the order is found to be wrong.

ALTER TABLE mysql.slave_master_info
  MODIFY COLUMN Channel_name char(64) NOT NULL COMMENT
  'The channel on which the slave is connected to a source. Used in Multisource Replication'
  AFTER Tls_version;

--echo # Running mysql_upgrade to update slave_master_info table
--disable_result_log
--exec $MYSQL_UPGRADE --skip-verbose --skip-sys-schema --force 2>&1
--enable_result_log

--echo # Verify that the columns Channel_name and Tls_version are now in correct order.
CREATE TABLE test.upgraded
SELECT COLUMN_NAME, ORDINAL_POSITION
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_NAME = "slave_master_info"
  AND TABLE_SCHEMA = "mysql";
--let $diff_tables= test.upgraded, test.original
--source include/diff_tables.inc
DROP TABLE test.upgraded;

--echo # Scenario 3:
--echo # DROP slave_master_info table and re-create it as of MySQL 5.6.21

DROP table mysql.slave_master_info;

CREATE TABLE `mysql`.`slave_master_info` (
  `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file.',
  `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.',
  `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last read event.',
  `Host` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'The host name of the master.',
  `User_name` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The user name used to connect to the master.',
  `User_password` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The password used to connect to the master.',
  `Port` int(10) unsigned NOT NULL COMMENT 'The network port used to connect to the master.',
  `Connect_retry` int(10) unsigned NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.',
  `Enabled_ssl` tinyint(1) NOT NULL COMMENT 'Indicates whether the server supports SSL connections.',
  `Ssl_ca` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.',
  `Ssl_capath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path to the Certificate Authority (CA) certificates.',
  `Ssl_cert` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL certificate file.',
  `Ssl_cipher` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the cipher in use for the SSL connection.',
  `Ssl_key` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL key file.',
  `Ssl_verify_server_cert` tinyint(1) NOT NULL COMMENT 'Whether to verify the server certificate.',
  `Heartbeat` float NOT NULL,
  `Bind` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server',
  `Ignored_server_ids` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The number of server IDs to be ignored, followed by the actual server IDs',
  `Uuid` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The master server uuid.',
  `Retry_count` bigint(20) unsigned NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.',
  `Ssl_crl` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Revocation List (CRL)',
  `Ssl_crlpath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path used for Certificate Revocation List (CRL) files',
  `Enabled_auto_position` tinyint(1) NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.',
  PRIMARY KEY (`Host`,`Port`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Master Information';

--echo #Running mysql_upgrade to update slave_master_info table
--disable_result_log
--exec $MYSQL_UPGRADE --skip-verbose --skip-sys-schema --force 2>&1
--enable_result_log

--echo #Verify that the columns Channel_name and Tls_version are added and are in correct order.
CREATE TABLE test.upgraded
SELECT COLUMN_NAME, ORDINAL_POSITION
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_NAME = "slave_master_info"
  AND TABLE_SCHEMA = "mysql";
--let $diff_tables= test.upgraded, test.original
--source include/diff_tables.inc
DROP TABLE test.upgraded;

# Cleanup:
TRUNCATE TABLE mysql.slave_master_info;
INSERT INTO mysql.slave_master_info SELECT * FROM test.slave_master_info_backup;

ALTER TABLE mysql.slave_master_info
  MODIFY Host CHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NULL COMMENT 'The host name of the master.',
  ALTER COLUMN Channel_name DROP DEFAULT;

DROP TABLE test.slave_master_info_backup;
DROP TABLE test.original;

--source include/mysql_upgrade_cleanup.inc

--echo #Restart the server
--source include/restart_mysqld.inc

Anon7 - 2022
AnonSec Team