mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / t / partition_myisam.test
blob51f46aa71beff7042dc4bf3e76468da9973af3bc
1 -- source include/have_partition.inc
2 --disable_warnings
3 DROP TABLE IF EXISTS t1, t2;
4 --enable_warnings
5 let $MYSQLD_DATADIR= `SELECT @@datadir`;
8 # Bug#30102: rename table does corrupt tables with partition files on failure
10 --echo # Bug#30102 test
11 CREATE TABLE t1 (a INT)
12 PARTITION BY RANGE (a)
13 (PARTITION p0 VALUES LESS THAN (6),
14  PARTITION `p1....................` VALUES LESS THAN (9),
15  PARTITION p2 VALUES LESS THAN MAXVALUE);
16 # partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
17 # total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
18 --echo # List of files in database `test`, all original t1-files here
19 --list_files $MYSQLD_DATADIR/test t1*
20 INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
21 --echo # Renaming to a file name where the first partition is 250 chars
22 --echo # and the second partition is 350 chars
23 # 7,7 avoids the error message, which is not deterministic.
24 --error 7,7
25 RENAME TABLE t1 TO `t2_new..............................................end`;
26 #                         1234567890123456789012345678901234567890123456
27 --echo # List of files in database `test`, should not be any t2-files here
28 --list_files $MYSQLD_DATADIR/test t2*
29 --echo # List of files in database `test`, should be all t1-files here
30 --list_files $MYSQLD_DATADIR/test t1*
31 --sorted_result
32 SELECT * FROM t1;
33 --echo # List of files in database `test`, should be all t1-files here
34 --list_files $MYSQLD_DATADIR/test t1*
35 --echo # Renaming to a file name where the first partition is 156 chars
36 --echo # and the second partition is 256 chars
37 # 7,7 avoids the error message, which is not deterministic.
38 --error 7,7
39 RENAME TABLE t1 TO `t2_............................_end`;
40 #                      1234567890123456789012345678
41 # 7 + 4 + 5 + 28 * 5 = 16 + 140 = 156
42 --echo # List of files in database `test`, should not be any t2-files here
43 --list_files $MYSQLD_DATADIR/test t2*
44 --echo # List of files in database `test`, should be all t1-files here
45 --list_files $MYSQLD_DATADIR/test t1*
46 --sorted_result
47 SELECT * FROM t1;
48 DROP TABLE t1;
49 --echo # Should not be any files left here
50 --list_files $MYSQLD_DATADIR/test t1*
51 --list_files $MYSQLD_DATADIR/test t2*
52 --echo # End of bug#30102 test.
54 --echo # Test of post-push fix for bug#11766249/59316
55 CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a))
56 ENGINE = MyISAM
57 PARTITION BY RANGE (a)
58 (PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100,
59  PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100,
60  PARTITION pMax VALUES LESS THAN MAXVALUE);
61 INSERT INTO t1 VALUES (1, "Partition p1, first row");
62 DROP TABLE t1;