Skip to content

Commit 4fe1b98

Browse files
Sunny BainsSunny Bains
authored andcommitted
WL#8619 - Follow up, add tests that went walkies.
1 parent 7152204 commit 4fe1b98

27 files changed

+3466
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
wl#8619 : This readme file is prepared for testing the functionality (portability) of the wl#8619 .
2+
Test linux --datadir and tablespaces runs on Windows platform.
3+
Note 1: The --datadir hierarchy and schema name and its hierarchy (Ex: test/tab1.ibd) should be followed
4+
5+
Note 2: For older version of --datadir (Ex: 8.0), it is users responsibility to run upgrade script against the --datadir, once the
6+
upgrade is successful, you can create a zip file (tablespace_portable_linux.zip). You can directly run portability functionality
7+
with old --datadir (Ex: mysql-8.0). Hence intentionally upgrade step is not added in this testcase.
8+
9+
Note 3: The folder names and tablspace names and my.cnf config file should same as follows, do not change anything, as testcase
10+
might fail.
11+
12+
1) Logon on to any Linux machine (you can also use laptop with ubuntu)
13+
14+
2) Build latest version of trunk
15+
16+
3) InitDB/bootstrap the datadir using the following my.cnf config file, here is the command
17+
18+
./bin/mysqld --defaults-file=./my.cnf --datadir=../Linx-DB/ --basedir=. -u root --initialize-insecure
19+
20+
log_error_verbosity=3
21+
lower_case_table_names=1
22+
innodb_log_files_in_group=4
23+
innodb_log_group_home_dir=../data_home
24+
innodb_data_home_dir=../data_home
25+
innodb_undo_directory=../undo_files
26+
innodb_undo_tablespaces=5
27+
innodb_data_file_path=data01:20M;data02:20M:autoextend
28+
29+
4) start the server with the same my.cnf file and connect with mysql client
30+
./bin/mysqld --defaults-file=./my.cnf --datadir=../Linx-DB/ --basedir=. -u root
31+
32+
5) Run following DDLs
33+
34+
Note : Do replace 'xxx' in DDL statements with target location of that machine
35+
36+
CREATE DATABASE test;
37+
use test;
38+
CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' Engine=InnoDB;
39+
CREATE TABLE tab1(c1 int, c2 varchar(10)) TABLESPACE=ts1;
40+
INSERT INTO tab1 VALUES(1, 'VISH');
41+
CREATE TABLE tab2(c1 int , c2 varchar(10)) Engine=InnoDB;
42+
INSERT INTO tab2 VALUES(2, 'VISH');
43+
CREATE INDEX ix1 ON tab1(c2) USING BTREE;
44+
CREATE INDEX ix2 ON tab2(c2) ;
45+
46+
create table tab3 (
47+
empno int,
48+
ename varchar(30),
49+
sal numeric(3))
50+
engine=InnoDB row_format=compressed
51+
partition by hash(empno) (
52+
partition P0 DATA DIRECTORY = '/xxx/xxx/datadir1',
53+
partition P1 DATA DIRECTORY = '/xxx/xxx/datadir1');
54+
55+
CREATE INDEX ix1 ON tab3(ename) USING BTREE;
56+
INSERT INTO tab3 VALUES (100,'VISWANATH',100);
57+
INSERT INTO tab3 VALUES (300,'VISWANATH',100);
58+
59+
CREATE TABLE purchase (
60+
`id` int(11) DEFAULT NULL,
61+
`purchased` date DEFAULT NULL
62+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
63+
PARTITION BY RANGE ( YEAR(purchased))
64+
SUBPARTITION BY HASH ( TO_DAYS(purchased))
65+
(PARTITION p0 VALUES LESS THAN (1990)
66+
(SUBPARTITION s0 DATA DIRECTORY = '/xxx/xxx/part0' ENGINE = InnoDB,
67+
SUBPARTITION s1 DATA DIRECTORY = '/xxx/xxx/part1' ENGINE = InnoDB),
68+
PARTITION p1 VALUES LESS THAN (2000)
69+
(SUBPARTITION s2 DATA DIRECTORY = '/xxx/xxx/part2' ENGINE = InnoDB,
70+
SUBPARTITION s3 DATA DIRECTORY = '/xxx/xxx/part3' ENGINE = InnoDB));
71+
72+
INSERT INTO purchase VALUES(1,'1980-05-31');
73+
INSERT INTO purchase VALUES(2,'1999-05-31');
74+
INSERT INTO purchase VALUES(3,'1998-05-31');
75+
INSERT INTO purchase VALUES(4,'1979-05-31');
76+
INSERT INTO purchase VALUES(5,'1978-05-31');
77+
INSERT INTO purchase VALUES(6,'1997-05-31');
78+
79+
CREATE TABLESPACE ts2 ADD DATAFILE '/xxx/xxx/undo_files/ts2.ibd' Engine=InnoDB;
80+
CREATE TABLE tab4(c1 int, c2 varchar(10)) TABLESPACE=ts2;
81+
INSERT INTO tab4 VALUES(1, 'VISH');
82+
83+
6) Shutdown the server (no crash or KILL -9)
84+
85+
7) zip entire --datadir files (following list of folders)
86+
87+
--datadir (Linx-DB)
88+
--innodb_undo_directory (undo_files)
89+
--innodb_data_home_dir (data_home)
90+
--innodb_log_group_home_dir (data_home)
91+
part0,part1,part2,part3,datadir1
92+
93+
zip -r -9 tablespace_portable_linux.zip datadir1/ Linx-DB/ undo_files/ part?
94+
95+
8) Copy that zip file into mysql-test/std_data location of MTR home DIR
96+
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
wl#8619 : This readme file is prepared for testing the functionality (portability) of the wl#8619 .
2+
Test windows --datadir and tablespaces runs on Linux platform.
3+
Note 1: The --datadir hierarchy and schema name and its hierarchy (Ex: test/tab1.ibd) should be followed
4+
5+
Note 2: For older version of --datadir (Ex: 8.0), it is users responsibility to run upgrade script against the --datadir, once the
6+
upgrade is successful, you can create a zip file (tablespace_portable_win.zip). You can directly run portability functionality
7+
with old --datadir (Ex: mysql-8.0). Hence intentionally upgrade step is not added in this testcase.
8+
9+
Note 3: The folder names and tablspace names and my.cnf config file should same as follows, do not change anything, as testcase
10+
might fail.
11+
12+
1) Logon on to any windows machine (vitro08.no.oracle.com)
13+
14+
2) Download the mysql binaries from PB2 (latest version of trunk)
15+
16+
3) InitDB/bootstrap the datadir using the following my.cnf config file, here is the command
17+
18+
E:\wl8619\portable\mysql-commercial-9.0.0-dmr-winx64\bin\mysqld.exe --defaults-file=./my.cnf --datadir=../Win-DB/ --basedir=. --initialize-insecure
19+
20+
log_error_verbosity=3
21+
lower_case_table_names=1
22+
innodb_log_files_in_group=4
23+
innodb_log_group_home_dir=../data_home
24+
innodb_data_home_dir=../data_home
25+
innodb_undo_directory=../undo_files
26+
innodb_undo_tablespaces=5
27+
innodb_data_file_path=data01:20M;data02:20M:autoextend
28+
29+
4) start the server with the same my.cnf file and connect with mysql client
30+
E:\wl8619\portable\mysql-commercial-9.0.0-dmr-winx64\bin\mysqld.exe --defaults-file=./my.cnf --datadir=../Win-DB/ --basedir=. -u root
31+
32+
5) Run following DDLs
33+
34+
Note : Do replace 'xxx' in DDL statements with target location of that machine
35+
36+
CREATE DATABASE test;
37+
use test;
38+
CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' Engine=InnoDB;
39+
CREATE TABLE tab1(c1 int, c2 varchar(10)) TABLESPACE=ts1;
40+
INSERT INTO tab1 VALUES(1, 'VISH');
41+
CREATE TABLE tab2(c1 int , c2 varchar(10)) Engine=InnoDB;
42+
INSERT INTO tab2 VALUES(2, 'VISH');
43+
CREATE INDEX ix1 ON tab1(c2) USING BTREE;
44+
CREATE INDEX ix2 ON tab2(c2) ;
45+
46+
create table tab3 (
47+
empno int,
48+
ename varchar(30),
49+
sal numeric(3))
50+
engine=InnoDB row_format=compressed
51+
partition by hash(empno) (
52+
partition P0 DATA DIRECTORY = 'E:\\xxx\\xxx\\datadir1',
53+
partition P1 DATA DIRECTORY = 'E:\\xxx\\xxx\\datadir1');
54+
55+
CREATE INDEX ix1 ON tab3(ename) USING BTREE;
56+
INSERT INTO tab3 VALUES (100,'VISWANATH',100);
57+
INSERT INTO tab3 VALUES (300,'VISWANATH',100);
58+
59+
CREATE TABLE purchase (
60+
`id` int(11) DEFAULT NULL,
61+
`purchased` date DEFAULT NULL
62+
) ENGINE=InnoDB DEFAULT CHARSET=latin1
63+
PARTITION BY RANGE ( YEAR(purchased))
64+
SUBPARTITION BY HASH ( TO_DAYS(purchased))
65+
(PARTITION p0 VALUES LESS THAN (1990)
66+
(SUBPARTITION s0 DATA DIRECTORY = 'E:\\xxx\\xxx\\part0' ENGINE = InnoDB,
67+
SUBPARTITION s1 DATA DIRECTORY = 'E:\\xxx\\xxx\\part1' ENGINE = InnoDB),
68+
PARTITION p1 VALUES LESS THAN (2000)
69+
(SUBPARTITION s2 DATA DIRECTORY = 'E:\\xxx\\xxx\\part2' ENGINE = InnoDB,
70+
SUBPARTITION s3 DATA DIRECTORY = 'E:\\xxx\\xxx\\part3' ENGINE = InnoDB));
71+
72+
INSERT INTO purchase VALUES(1,'1980-05-31');
73+
INSERT INTO purchase VALUES(2,'1999-05-31');
74+
INSERT INTO purchase VALUES(3,'1998-05-31');
75+
INSERT INTO purchase VALUES(4,'1979-05-31');
76+
INSERT INTO purchase VALUES(5,'1978-05-31');
77+
INSERT INTO purchase VALUES(6,'1997-05-31');
78+
79+
CREATE TABLESPACE ts2 ADD DATAFILE 'E:\\xxx\\xxx\\undo_files\\ts2.ibd' Engine=InnoDB;
80+
CREATE TABLE tab4(c1 int, c2 varchar(10)) TABLESPACE=ts2;
81+
INSERT INTO tab4 VALUES(1, 'VISH');
82+
83+
6) Shutdown the server (no crash or KILL -9)
84+
85+
7) zip entire --datadir files (following list of folders)
86+
87+
--datadir (Win-DB)
88+
--innodb_undo_directory (undo_files)
89+
--innodb_data_home_dir (data_home)
90+
--innodb_log_group_home_dir (data_home)
91+
part0,part1,part2,part3,datadir1
92+
93+
8) Copy that zip file into mysql-test/std_data location of MTR home DIR
4.99 MB
Binary file not shown.
5.82 MB
Binary file not shown.

0 commit comments

Comments
 (0)