mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
143f5d9172
Merged 615dd07d90
from https://github.com/facebook/mysql-5.6/
authored by rongrong. Removed C++11 requirement by using
std::map instead of std::unordered_set.
Add analysis to leaf pages to estimate how fragmented an index is
and how much benefit we can get out of defragmentation.
22 lines
952 B
Text
22 lines
952 B
Text
# Create and populate a table
|
|
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
|
|
INSERT INTO t1 (b) VALUES ('corrupt me');
|
|
INSERT INTO t1 (b) VALUES ('corrupt me');
|
|
CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT)
|
|
ROW_FORMAT=COMPRESSED ENGINE=InnoDB ;
|
|
INSERT INTO t2(b) SELECT b from t1;
|
|
CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT)
|
|
ROW_FORMAT=COMPRESSED ENGINE=InnoDB KEY_BLOCK_SIZE=16;
|
|
INSERT INTO t3(b) SELECT b from t1;
|
|
# Write file to make mysql-test-run.pl expect the "crash", but don't
|
|
# start it until it's told to
|
|
# We give 30 seconds to do a clean shutdown because we do not want
|
|
# to redo apply the pages of t1.ibd at the time of recovery.
|
|
# We want SQL to initiate the first access to t1.ibd.
|
|
# Wait until disconnected.
|
|
# Run innochecksum on t1
|
|
# Run innochecksum on t2
|
|
# Run innochecksum on t3
|
|
# Write file to make mysql-test-run.pl start up the server again
|
|
# Cleanup
|
|
DROP TABLE t1, t2, t3;
|