|
| 1 | +SET GLOBAL innodb_file_format = `Barracuda`; |
| 2 | +SET GLOBAL innodb_file_per_table = ON; |
| 3 | +set global innodb_compression_algorithm = 1; |
| 4 | +create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; |
| 5 | +create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1; |
| 6 | +create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1; |
| 7 | +create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed page_compressed=1; |
| 8 | +ERROR HY000: Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options") |
| 9 | +show warnings; |
| 10 | +Level Code Message |
| 11 | +Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=COMPRESSED |
| 12 | +Error 1005 Can't create table `test`.`innodb_compressed` (errno: 140 "Wrong create options") |
| 13 | +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB |
| 14 | +show create table innodb_compact; |
| 15 | +Table Create Table |
| 16 | +innodb_compact CREATE TABLE `innodb_compact` ( |
| 17 | + `c1` bigint(20) NOT NULL, |
| 18 | + `b` char(200) DEFAULT NULL |
| 19 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1 |
| 20 | +show create table innodb_dynamic; |
| 21 | +Table Create Table |
| 22 | +innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 23 | + `c1` bigint(20) NOT NULL, |
| 24 | + `b` char(200) DEFAULT NULL |
| 25 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `page_compressed`=1 |
| 26 | +create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant page_compressed=1; |
| 27 | +ERROR HY000: Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options") |
| 28 | +show warnings; |
| 29 | +Level Code Message |
| 30 | +Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT |
| 31 | +Error 1005 Can't create table `test`.`innodb_redundant` (errno: 140 "Wrong create options") |
| 32 | +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB |
| 33 | +create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant; |
| 34 | +show create table innodb_redundant; |
| 35 | +Table Create Table |
| 36 | +innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 37 | + `c1` bigint(20) NOT NULL, |
| 38 | + `b` char(200) DEFAULT NULL |
| 39 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT |
| 40 | +alter table innodb_redundant page_compressed=1; |
| 41 | +ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") |
| 42 | +show warnings; |
| 43 | +Level Code Message |
| 44 | +Warning 140 InnoDB: PAGE_COMPRESSED table can't have ROW_TYPE=REDUNDANT |
| 45 | +Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") |
| 46 | +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB |
| 47 | +show create table innodb_redundant; |
| 48 | +Table Create Table |
| 49 | +innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 50 | + `c1` bigint(20) NOT NULL, |
| 51 | + `b` char(200) DEFAULT NULL |
| 52 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT |
| 53 | +alter table innodb_redundant row_format=compact page_compressed=1; |
| 54 | +show create table innodb_redundant; |
| 55 | +Table Create Table |
| 56 | +innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 57 | + `c1` bigint(20) NOT NULL, |
| 58 | + `b` char(200) DEFAULT NULL |
| 59 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1 |
| 60 | +drop table innodb_redundant; |
| 61 | +create procedure innodb_insert_proc (repeat_count int) |
| 62 | +begin |
| 63 | +declare current_num int; |
| 64 | +set current_num = 0; |
| 65 | +while current_num < repeat_count do |
| 66 | +insert into innodb_normal values(current_num, substring(MD5(RAND()), -64)); |
| 67 | +set current_num = current_num + 1; |
| 68 | +end while; |
| 69 | +end// |
| 70 | +commit; |
| 71 | +set autocommit=0; |
| 72 | +call innodb_insert_proc(5000); |
| 73 | +commit; |
| 74 | +set autocommit=1; |
| 75 | +insert into innodb_compact select * from innodb_normal; |
| 76 | +insert into innodb_dynamic select * from innodb_normal; |
| 77 | +update innodb_compact set c1 = c1 + 1; |
| 78 | +update innodb_dynamic set c1 = c1 + 1; |
| 79 | +select count(*) from innodb_compact where c1 < 1500000; |
| 80 | +count(*) |
| 81 | +5000 |
| 82 | +select count(*) from innodb_dynamic where c1 < 1500000; |
| 83 | +count(*) |
| 84 | +5000 |
| 85 | +update innodb_compact set c1 = c1 + 1; |
| 86 | +update innodb_dynamic set c1 = c1 + 1; |
| 87 | +select count(*) from innodb_compact where c1 < 1500000; |
| 88 | +count(*) |
| 89 | +5000 |
| 90 | +select count(*) from innodb_dynamic where c1 < 1500000; |
| 91 | +count(*) |
| 92 | +5000 |
| 93 | +SET GLOBAL innodb_file_format = `Barracuda`; |
| 94 | +SET GLOBAL innodb_file_per_table = ON; |
| 95 | +set global innodb_compression_algorithm = 0; |
| 96 | +alter table innodb_compact engine=innodb page_compressed=DEFAULT; |
| 97 | +alter table innodb_dynamic engine=innodb page_compressed=DEFAULT; |
| 98 | +show create table innodb_compact; |
| 99 | +Table Create Table |
| 100 | +innodb_compact CREATE TABLE `innodb_compact` ( |
| 101 | + `c1` bigint(20) NOT NULL, |
| 102 | + `b` char(200) DEFAULT NULL |
| 103 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT |
| 104 | +show create table innodb_dynamic; |
| 105 | +Table Create Table |
| 106 | +innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 107 | + `c1` bigint(20) NOT NULL, |
| 108 | + `b` char(200) DEFAULT NULL |
| 109 | +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
| 110 | +update innodb_compact set c1 = c1 + 1; |
| 111 | +update innodb_dynamic set c1 = c1 + 1; |
| 112 | +select count(*) from innodb_compact where c1 < 1500000; |
| 113 | +count(*) |
| 114 | +5000 |
| 115 | +select count(*) from innodb_dynamic where c1 < 1500000; |
| 116 | +count(*) |
| 117 | +5000 |
| 118 | +drop procedure innodb_insert_proc; |
| 119 | +drop table innodb_normal; |
| 120 | +drop table innodb_compact; |
| 121 | +drop table innodb_dynamic; |
0 commit comments