| 1 |
# Set the environmental variables |
| 2 |
call mtr.add_suppression("Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); |
| 3 |
call mtr.add_suppression("innodb_checksum_algorithm is set to"); |
| 4 |
SET GLOBAL innodb_file_per_table=on; |
| 5 |
[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server. |
| 6 |
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY, |
| 7 |
linestring_key GEOMETRY NOT NULL, |
| 8 |
linestring_nokey GEOMETRY NOT NULL) |
| 9 |
ENGINE=InnoDB ; |
| 10 |
INSERT INTO tab1 (pk, linestring_key, linestring_nokey) |
| 11 |
VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) ')); |
| 12 |
CREATE INDEX linestring_index ON tab1(linestring_nokey(5)); |
| 13 |
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys |
| 14 |
ALTER TABLE tab1 ADD KEY (linestring_key(5)); |
| 15 |
ERROR HY000: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys |
| 16 |
# create a compressed table |
| 17 |
CREATE TABLE tab2(col_1 CHAR (255) , |
| 18 |
col_2 VARCHAR (255), col_3 longtext, |
| 19 |
col_4 longtext,col_5 longtext, |
| 20 |
col_6 longtext , col_7 int ) |
| 21 |
engine = innodb row_format=compressed key_block_size=4; |
| 22 |
CREATE INDEX idx1 ON tab2(col_3(10)); |
| 23 |
CREATE INDEX idx2 ON tab2(col_4(10)); |
| 24 |
CREATE INDEX idx3 ON tab2(col_5(10)); |
| 25 |
SET @col_1 = repeat('a', 5); |
| 26 |
SET @col_2 = repeat('b', 20); |
| 27 |
SET @col_3 = repeat('c', 100); |
| 28 |
SET @col_4 = repeat('d', 100); |
| 29 |
SET @col_5 = repeat('e', 100); |
| 30 |
SET @col_6 = repeat('f', 100); |
| 31 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 32 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,5); |
| 33 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 34 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,4); |
| 35 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 36 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,3); |
| 37 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 38 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,2); |
| 39 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 40 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,1); |
| 41 |
SELECT * FROM tab2 ORDER BY col_7; |
| 42 |
# stop the server |
| 43 |
[1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1 |
| 44 |
: start the server with innodb_checksum_algorithm=strict_innodb |
| 45 |
# restart: --innodb_checksum_algorithm=strict_innodb --default_storage_engine=InnoDB |
| 46 |
INSERT INTO tab1 (pk, linestring_key, linestring_nokey) |
| 47 |
VALUES (2, ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 10,20 20,30 30)')); |
| 48 |
SET @col_1 = repeat('a', 5); |
| 49 |
SET @col_2 = repeat('b', 20); |
| 50 |
SET @col_3 = repeat('c', 100); |
| 51 |
SET @col_4 = repeat('d', 100); |
| 52 |
SET @col_5 = repeat('e', 100); |
| 53 |
SET @col_6 = repeat('f', 100); |
| 54 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 55 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,6); |
| 56 |
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey) |
| 57 |
FROM tab1 ORDER BY pk; |
| 58 |
SELECT * FROM tab2 ORDER BY col_7; |
| 59 |
# stop the server |
| 60 |
[1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1 |
| 61 |
# start the server with innodb_checksum_algorithm=strict_crc32 |
| 62 |
# restart: --innodb_checksum_algorithm=strict_crc32 --default_storage_engine=InnoDB |
| 63 |
INSERT INTO tab1 (pk, linestring_key, linestring_nokey) |
| 64 |
VALUES (3, ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'), |
| 65 |
ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))')); |
| 66 |
SET @col_1 = repeat('g', 5); |
| 67 |
SET @col_2 = repeat('h', 20); |
| 68 |
SET @col_3 = repeat('i', 100); |
| 69 |
SET @col_4 = repeat('j', 100); |
| 70 |
SET @col_5 = repeat('k', 100); |
| 71 |
SET @col_6 = repeat('l', 100); |
| 72 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 73 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,7); |
| 74 |
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey) |
| 75 |
FROM tab1 ORDER BY pk; |
| 76 |
SELECT * FROM tab2 ORDER BY col_7; |
| 77 |
# stop the server |
| 78 |
[1(c)]: Rewrite into new checksum=none for all *.ibd file, ibdata1 and mysql.ibd |
| 79 |
# restart: --innodb_checksum_algorithm=strict_none --default_storage_engine=InnoDB |
| 80 |
INSERT INTO tab1 (pk, linestring_key, linestring_nokey) |
| 81 |
VALUES (4, ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) ')); |
| 82 |
SET @col_1 = repeat('m', 5); |
| 83 |
SET @col_2 = repeat('n', 20); |
| 84 |
SET @col_3 = repeat('o', 100); |
| 85 |
SET @col_4 = repeat('p', 100); |
| 86 |
SET @col_5 = repeat('q', 100); |
| 87 |
SET @col_6 = repeat('r', 100); |
| 88 |
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) |
| 89 |
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,8); |
| 90 |
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey) |
| 91 |
FROM tab1 ORDER BY pk; |
| 92 |
SELECT * FROM tab2 ORDER BY col_7; |
| 93 |
# stop the server |
| 94 |
[2]: Check the page type summary with shortform for tab1.ibd |
| 95 |
|
| 96 |
File::tab#.ibd |
| 97 |
================PAGE TYPE SUMMARY============== |
| 98 |
#PAGE_COUNT PAGE_TYPE |
| 99 |
=============================================== |
| 100 |
# Index page |
| 101 |
# SDI Index page |
| 102 |
# Undo log page |
| 103 |
# Inode page |
| 104 |
# Insert buffer free list page |
| 105 |
# Freshly allocated page |
| 106 |
# Insert buffer bitmap |
| 107 |
# System page |
| 108 |
# Transaction system page |
| 109 |
# File Space Header |
| 110 |
# Extent descriptor page |
| 111 |
# BLOB page |
| 112 |
# Compressed BLOB page |
| 113 |
# Subsequent Compressed BLOB page |
| 114 |
# SDI BLOB page |
| 115 |
# Compressed SDI BLOB page |
| 116 |
# Other type of page |
| 117 |
=============================================== |
| 118 |
Additional information: |
| 119 |
Undo page type: # insert, # update, # other |
| 120 |
Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other |
| 121 |
[3]: Check the page type summary with longform for tab1.ibd |
| 122 |
|
| 123 |
File::tab#.ibd |
| 124 |
================PAGE TYPE SUMMARY============== |
| 125 |
#PAGE_COUNT PAGE_TYPE |
| 126 |
=============================================== |
| 127 |
# Index page |
| 128 |
# SDI Index page |
| 129 |
# Undo log page |
| 130 |
# Inode page |
| 131 |
# Insert buffer free list page |
| 132 |
# Freshly allocated page |
| 133 |
# Insert buffer bitmap |
| 134 |
# System page |
| 135 |
# Transaction system page |
| 136 |
# File Space Header |
| 137 |
# Extent descriptor page |
| 138 |
# BLOB page |
| 139 |
# Compressed BLOB page |
| 140 |
# Subsequent Compressed BLOB page |
| 141 |
# SDI BLOB page |
| 142 |
# Compressed SDI BLOB page |
| 143 |
# Other type of page |
| 144 |
=============================================== |
| 145 |
Additional information: |
| 146 |
Undo page type: # insert, # update, # other |
| 147 |
Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other |
| 148 |
[4]: Page type dump for with longform for tab1.ibd |
| 149 |
# Print the contents stored in dump.txt |
| 150 |
|
| 151 |
|
| 152 |
Filename::MYSQLD_DATADIR/test/tab#.ibd |
| 153 |
============================================================================== |
| 154 |
PAGE_NO | PAGE_TYPE | EXTRA INFO |
| 155 |
============================================================================== |
| 156 |
#::0| File Space Header | - |
| 157 |
#::#| Insert Buffer Bitmap | - |
| 158 |
#::#| SDI Index page | index id=#, page level=0, No. of records=#, garbage=0, - |
| 159 |
#::#| Index page | index id=#, page level=0, No. of records=#, garbage=0, - |
| 160 |
#::#| Freshly allocated page | - |
| 161 |
#::#| Freshly allocated page | - |
| 162 |
[5]: Page type dump for with shortform for tab1.ibd |
| 163 |
|
| 164 |
|
| 165 |
Filename::MYSQLD_DATADIR/test/tab#.ibd |
| 166 |
============================================================================== |
| 167 |
PAGE_NO | PAGE_TYPE | EXTRA INFO |
| 168 |
============================================================================== |
| 169 |
#::0| File Space Header | - |
| 170 |
#::#| Insert Buffer Bitmap | - |
| 171 |
#::#| SDI Index page | index id=#, page level=0, No. of records=#, garbage=0, - |
| 172 |
#::#| Index page | index id=#, page level=0, No. of records=#, garbage=0, - |
| 173 |
#::#| Freshly allocated page | - |
| 174 |
#::#| Freshly allocated page | - |
| 175 |
[6]: check the valid lower bound values for option |
| 176 |
# allow-mismatches,page,start-page,end-page |
| 177 |
[7]: check the negative values for option |
| 178 |
# allow-mismatches,page,start-page,end-page. |
| 179 |
# They will reset to zero for negative values. |
| 180 |
# check the invalid lower bound values |
| 181 |
[8]: check the valid upper bound values for |
| 182 |
# both short and long options "allow-mismatches" and "end-page" |
| 183 |
[9]: check the both short and long options "page" and "start-page" when |
| 184 |
# seek value is larger than file size. |
| 185 |
Pattern "Error: Unable to seek to necessary offset: Invalid argument" found |
| 186 |
Pattern "Error: Unable to seek to necessary offset: Invalid argument" found |
| 187 |
Pattern "Error: Unable to seek to necessary offset: Invalid argument" found |
| 188 |
Pattern "Error: Unable to seek to necessary offset: Invalid argument" found |
| 189 |
[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page. |
| 190 |
# innochecksum will fail with error code: 1 |
| 191 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 192 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 193 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 194 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 195 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 196 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 197 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 198 |
Pattern "Incorrect unsigned integer value: '18446744073709551616'" found |
| 199 |
# Restart the server |
| 200 |
# restart: --innodb_checksum_algorithm=crc32 |
| 201 |
DROP TABLE tab1; |
| 202 |
DROP TABLE tab2; |
| 203 |
SET GLOBAL innodb_file_per_table=default; |