Server IP : 172.67.216.182 / Your IP : 172.70.188.163 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 : |
################################################################################ # Test case to test deprecation warning message to be thrown when a partition # # of a partitioned table is found in a shared tablespace. # # # # This test case will test # # - Partitioned Table create/alter with different combination of tablespace # # at table level and partition level. # ################################################################################ --source include/no_valgrind_without_big.inc CREATE TABLESPACE ts add datafile 'ts.ibd'; --echo ######################################################################### --echo # Partitioned Table # --echo ######################################################################### --echo --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings --echo # Create table without explicit tablespace name CREATE TABLE t1 (id INT, name VARCHAR(50)) PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30)); --echo # Try to ALTER TABLE to have general tablespace at table level ALTER TABLE t1 TABLESPACE=ts; DROP TABLE t1; --echo # Create table with general tablespace at table level CREATE TABLE t1 (id INT, name VARCHAR(50)) TABLESPACE=ts PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30)); DROP TABLE t1; --echo # Create table with system tablespace at table level CREATE TABLE t1 (id INT, name VARCHAR(50)) TABLESPACE=innodb_system PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30)); DROP TABLE t1; --echo # Create table with innodb_file_per_table tablespace at table level CREATE TABLE t1 (id INT, name VARCHAR(50)) TABLESPACE=innodb_file_per_table PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30)); DROP TABLE t1; --echo # Create table with general tablespace at partition level CREATE TABLE t1 (id INT, name VARCHAR(50)) PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30) TABLESPACE=ts); DROP TABLE t1; --echo # Create table with system tablespace at partition level CREATE TABLE t1 (id INT, name VARCHAR(50)) PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30) TABLESPACE=innodb_system); DROP TABLE t1; --echo # Create table with innodb_file_per_table tablespace at partition level CREATE TABLE t1 (id INT, name VARCHAR(50)) PARTITION BY RANGE(id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN (40) TABLESPACE=innodb_file_per_table); --echo # Alter table to move a partition to general tablespace. ALTER TABLE t1 REORGANIZE PARTITION P0 INTO ( PARTITION P0 VALUES LESS THAN (10) TABLESPACE=ts); --echo # Alter table to move a partition to system tablespace. ALTER TABLE t1 REORGANIZE PARTITION P1 INTO ( PARTITION P1 VALUES LESS THAN (20) TABLESPACE=innodb_system); --echo # Alter table to move a partition to file_per_table tablespace. ALTER TABLE t1 REORGANIZE PARTITION P2 INTO ( PARTITION P2 VALUES LESS THAN (30) TABLESPACE=innodb_file_per_table); SHOW CREATE TABLE t1; --echo # Alter table to add a new partition in general tablespace ALTER TABLE t1 ADD PARTITION ( PARTITION p4 VALUES LESS THAN (50) tablespace=ts); --echo # Alter table to add a new partition in innodb_system tablespace ALTER TABLE t1 ADD PARTITION ( PARTITION p5 VALUES LESS THAN (60) tablespace=innodb_system); --echo # Alter table to add a new partition in innodb_file_per_table tablespace ALTER TABLE t1 ADD PARTITION ( PARTITION p6 VALUES LESS THAN (70) tablespace=innodb_file_per_table); --echo # Alter table to add a new partition without giving tablespace ALTER TABLE t1 ADD PARTITION ( PARTITION p7 VALUES LESS THAN (80)); SHOW CREATE TABLE t1; --echo ########### --echo # Cleanup # --echo ########### DROP TABLE t1; DROP TABLESPACE ts;