Commit 4fdc5e47 authored by Alice Sherepa's avatar Alice Sherepa

innodb_zip merged with 10.2

parent 94d82267
--- /home/alice/aliska/10.0/mysql-test/suite/innodb_zip/r/4k,xtradb.result~ 2017-10-06 16:01:54.358825216 +0200
+++ /home/alice/aliska/10.0/mysql-test/suite/innodb_zip/r/4k,xtradb.reject 2017-10-06 16:01:55.186824847 +0200
@@ -10,7 +10,7 @@
SELECT variable_value FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
variable_value
-2048
+2047
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
\ No newline at end of file
......@@ -408,4 +408,4 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
SET GLOBAL innodb_file_format = `Antelope`;
SET GLOBAL innodb_file_format=Antelope;
......@@ -39,11 +39,6 @@ uncompress_ops 0
BEGIN;
COMMIT;
ALTER TABLE t DROP INDEX c;
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
FLUSH PRIVILEGES;
SELECT * FROM information_schema.innodb_cmp_per_index;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
DROP USER 'tuser01'@'localhost';
SELECT
database_name,
table_name,
......
This diff is collapsed.
# Set the environmental variables
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB;
CREATE INDEX idx1 ON tab1(c2(10));
INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1');
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
insert into t1 values(1,"i");
insert into t1 values(2,"am");
insert into t1 values(3,"compressed table");
# Shutdown the Server
# Server Default checksum = innodb
[1b]: check the innochecksum without --strict-check
[2]: check the innochecksum with full form --strict-check=crc32
[3]: check the innochecksum with short form -C crc32
[4]: check the innochecksum with --no-check ignores algorithm check, warning is expected
FOUND 1 /Error: --no-check must be associated with --write option./ in my_restart.err
[5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected
FOUND 1 /Error: --no-check must be associated with --write option./ in my_restart.err
[6]: check the innochecksum with full form strict-check & no-check , an error is expected
FOUND 1 /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[7]: check the innochecksum with short form strict-check & no-check , an error is expected
FOUND 1 /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[8]: check the innochecksum with short & full form combination
# strict-check & no-check, an error is expected
FOUND 1 /Error: --strict-check option cannot be used together with --no-check option./ in my_restart.err
[9]: check the innochecksum with full form --strict-check=innodb
[10]: check the innochecksum with full form --strict-check=none
# when server Default checksum=crc32
[11]: check the innochecksum with short form -C innodb
# when server Default checksum=crc32
[12]: check the innochecksum with short form -C none
# when server Default checksum=crc32
[13]: check strict-check with invalid values
FOUND 1 /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_crc32\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_none\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'InnoBD\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'crc\' to \'strict-check\'/ in my_restart.err
FOUND 1 /Error while setting value \'no\' to \'strict-check\'/ in my_restart.err
[14a]: when server default checksum=crc32 rewrite new checksum=crc32 with innochecksum
# Also check the long form of write option.
[14b]: when server default checksum=crc32 rewrite new checksum=innodb with innochecksum
# Also check the long form of write option.
# start the server with innodb_checksum_algorithm=InnoDB
INSERT INTO tab1 VALUES(2, 'Innochecksum CRC32');
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
# Stop the server
[15]: when server default checksum=crc32 rewrite new checksum=none with innochecksum
# Also check the short form of write option.
# Start the server with checksum algorithm=none
INSERT INTO tab1 VALUES(3, 'Innochecksum None');
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
3 Innochecksum None
DROP TABLE t1;
# Stop the server
[16]: rewrite into new checksum=crc32 with innochecksum
# Restart the DB server with innodb_checksum_algorithm=crc32
SELECT * FROM tab1;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
3 Innochecksum None
DELETE FROM tab1 where c1=3;
SELECT c1,c2 FROM tab1 order by c1,c2;
c1 c2
1 Innochecksum InnoDB1
2 Innochecksum CRC32
# Stop server
[17]: rewrite into new checksum=InnoDB
# Restart the DB server with innodb_checksum_algorithm=InnoDB
DELETE FROM tab1 where c1=2;
SELECT * FROM tab1;
c1 c2
1 Innochecksum InnoDB1
# Stop server
[18]:check Innochecksum with invalid write options
FOUND 1 /Error while setting value \'strict_crc32\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'strict_innodb\' to \'write\'/ in my_restart.err
FOUND 1 /Error while setting value \'crc23\' to \'write\'/ in my_restart.err
DROP TABLE tab1;
SET GLOBAL innodb_compression_level=0;
SELECT @@innodb_compression_level;
@@innodb_compression_level
0
CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200));
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
INSERT INTO t1 SELECT * from t1;
# stop the server
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose TRUE
debug FALSE
count FALSE
start-page 0
end-page 0
page 0
strict-check crc32
no-check FALSE
allow-mismatches 0
write crc32
page-type-summary FALSE
page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
per-page-details FALSE
log (No default value)
leaf FALSE
merge 0
[1]:# check the both short and long options for "help"
[2]:# Run the innochecksum when file isn't provided.
# It will print the innochecksum usage similar to --help option.
innochecksum Ver #.#.#
Copyright (c) YEAR, YEAR , Oracle, MariaDB Corporation Ab and others.
InnoDB offline file checksum utility.
Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-C <strict-check>] [-w <write>] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]>
-?, --help Displays this help and exits.
-I, --info Synonym for --help.
-V, --version Displays version information and exits.
-v, --verbose Verbose (prints progress every 5 seconds).
-c, --count Print the count of pages in the file and exits.
-s, --start-page=# Start on this page number (0 based).
-e, --end-page=# End at this page number (0 based).
-p, --page=# Check only this page (0 based).
-C, --strict-check=name
Specify the strict checksum algorithm by the user.. One
of: crc32, crc32, innodb, innodb, none, none
-n, --no-check Ignore the checksum verification.
-a, --allow-mismatches=#
Maximum checksum mismatch allowed.
-w, --write=name Rewrite the checksum algorithm by the user.. One of:
crc32, crc32, innodb, innodb, none, none
-S, --page-type-summary
Display a count of each page type in a tablespace.
-D, --page-type-dump=name
Dump the page type info for each page in a tablespace.
-i, --per-page-details
Print out per-page detail information.
-l, --log=name log output.
-f, --leaf Examine leaf index pages
-m, --merge=# leaf page count if merge given number of consecutive
pages
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose FALSE
count FALSE
start-page 0
end-page 0
page 0
strict-check crc32
no-check FALSE
allow-mismatches 0
write crc32
page-type-summary FALSE
page-type-dump (No default value)
per-page-details FALSE
log (No default value)
leaf FALSE
merge 0
[3]:# check the both short and long options for "count" and exit
Number of pages:#
Number of pages:#
[4]:# Print the version of innochecksum and exit
innochecksum Ver #.#.## Restart the DB server
DROP TABLE t1;
[5]:# Check the innochecksum for compressed table t1 with different key_block_size
# Test for KEY_BLOCK_SIZE=1
===> Testing size=1
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
# Test for KEY_BLOCK_SIZE=2
===> Testing size=2
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
# Test for for KEY_BLOCK_SIZE=4
===> Testing size=4
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
set innodb_strict_mode=off;
# Test for for KEY_BLOCK_SIZE=8
===> Testing size=8
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
set innodb_strict_mode=off;
# Test for KEY_BLOCK_SIZE=16
===> Testing size=16
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, msg VARCHAR(255)) ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
insert into t1 values(1,"I");
insert into t1 values(2,"AM");
insert into t1 values(3,"COMPRESSED");
select * from t1;
id msg
1 I
2 AM
3 COMPRESSED
drop table t1;
# Test[5] completed
# Set the environmental variables
call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*");
[1]: Further Test are for rewrite checksum (innodb|crc32|none) for all ibd file & start the server.
CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY,
linestring_key GEOMETRY NOT NULL,
linestring_nokey GEOMETRY NOT NULL)
ENGINE=InnoDB ;
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) '));
CREATE INDEX linestring_index ON tab1(linestring_nokey(5));
ALTER TABLE tab1 ADD KEY (linestring_key(5));
# create a compressed table
CREATE TABLE tab2(col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 int )
engine = innodb row_format=compressed key_block_size=4;
CREATE INDEX idx1 ON tab2(col_3(10));
CREATE INDEX idx2 ON tab2(col_4(10));
CREATE INDEX idx3 ON tab2(col_5(10));
SET @col_1 = repeat('a', 5);
SET @col_2 = repeat('b', 20);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,5);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,4);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,3);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,2);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,1);
SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[1(a)]: Rewrite into new checksum=InnoDB for all *.ibd file and ibdata1
: start the server with innodb_checksum_algorithm=strict_innodb
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (2, ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'));
SET @col_1 = repeat('a', 5);
SET @col_2 = repeat('b', 20);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,6);
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[1(b)]: Rewrite into new checksum=crc32 for all *.ibd file and ibdata1
# start the server with innodb_checksum_algorithm=strict_crc32
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
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))'),
ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 10))'));
SET @col_1 = repeat('g', 5);
SET @col_2 = repeat('h', 20);
SET @col_3 = repeat('i', 100);
SET @col_4 = repeat('j', 100);
SET @col_5 = repeat('k', 100);
SET @col_6 = repeat('l', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,7);
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[1(c)]: Rewrite into new checksum=none for all *.ibd file and ibdata1
INSERT INTO tab1 (pk, linestring_key, linestring_nokey)
VALUES (4, ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '));
SET @col_1 = repeat('m', 5);
SET @col_2 = repeat('n', 20);
SET @col_3 = repeat('o', 100);
SET @col_4 = repeat('p', 100);
SET @col_5 = repeat('q', 100);
SET @col_6 = repeat('r', 100);
INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,8);
SELECT pk,ST_AsText(linestring_key),ST_AsText(linestring_nokey)
FROM tab1 ORDER BY pk;
SELECT * FROM tab2 ORDER BY col_7;
# stop the server
[2]: Check the page type summary with shortform for tab1.ibd
File::tab#.ibd
================PAGE TYPE SUMMARY==============
#PAGE_COUNT PAGE_TYPE
===============================================
# Index page
# Undo log page
# Inode page
# Insert buffer free list page
# Freshly allocated page
# Insert buffer bitmap
# System page
# Transaction system page
# File Space Header
# Extent descriptor page
# BLOB page
# Compressed BLOB page
# Page compressed page
# Page compressed encrypted page
# Other type of page
===============================================
Additional information:
Undo page type: # insert, # update, # other
Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other
index_id #pages #leaf_pages #recs_per_page #bytes_per_page
# # # # #
# # # # #
# # # # #
index_id page_data_bytes_histgram(empty,...,oversized)
# # # # # # # # # # # # #
# # # # # # # # # # # # #
# # # # # # # # # # # # #
[3]: Check the page type summary with longform for tab1.ibd
File::tab#.ibd
================PAGE TYPE SUMMARY==============
#PAGE_COUNT PAGE_TYPE
===============================================
# Index page
# Undo log page
# Inode page
# Insert buffer free list page
# Freshly allocated page
# Insert buffer bitmap
# System page
# Transaction system page
# File Space Header
# Extent descriptor page
# BLOB page
# Compressed BLOB page
# Page compressed page
# Page compressed encrypted page
# Other type of page
===============================================
Additional information:
Undo page type: # insert, # update, # other
Undo page state: # active, # cached, # to_free, # to_purge, # prepared, # other
index_id #pages #leaf_pages #recs_per_page #bytes_per_page
# # # # #
# # # # #
# # # # #
index_id page_data_bytes_histgram(empty,...,oversized)
# # # # # # # # # # # # #
# # # # # # # # # # # # #
# # # # # # # # # # # # #
[4]: Page type dump for with longform for tab1.ibd
# Print the contents stored in dump.txt
Filename::tab#.ibd
==============================================================================
PAGE_NO | PAGE_TYPE | EXTRA INFO
==============================================================================
#::# | File Space Header | -
#::# | Insert Buffer Bitmap | -
#::# | Inode page | -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Freshly allocated page | -
# Variables used by page type dump for ibdata1
Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- ----------------------------------------
verbose TRUE
count FALSE
start-page 0
end-page 0
page 0
strict-check crc32
no-check FALSE
allow-mismatches 0
write crc32
page-type-summary FALSE
page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt
per-page-details FALSE
log (No default value)
leaf FALSE
merge 0
[5]: Page type dump for with shortform for tab1.ibd
Filename::tab#.ibd
==============================================================================
PAGE_NO | PAGE_TYPE | EXTRA INFO
==============================================================================
#::# | File Space Header | -
#::# | Insert Buffer Bitmap | -
#::# | Inode page | -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, -
#::# | Freshly allocated page | -
[6]: check the valid lower bound values for option
# allow-mismatches,page,start-page,end-page
[9]: check the both short and long options "page" and "start-page" when
# seek value is larger than file size.
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
FOUND 1 /Error: Unable to seek to necessary offset: Invalid argument/ in my_restart.err
[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page.
# innochecksum will fail with error code: 1
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err
DROP TABLE tab1,tab2;
#
# This tests the use of large blobs in InnoDB.
#
call mtr.add_suppression("InnoDB: Warning: a long semaphore wait");
SET GLOBAL innodb_file_per_table = OFF;
#
# System tablespace, Row Format = Redundant
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# System tablespace, Row Format = Compact
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = ON;
#
# Separate tablespace, Row Format = Redundant
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Compact
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Compressed, Key Block Size = 2k
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Compressed, Key Block Size = 1k
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# Separate tablespace, Row Format = Dynamic
#
CREATE TABLE t1 (
c1 INT DEFAULT NULL,
c2 LONGBLOB NOT NULL,
KEY k2 (c2(250), c1)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
#
# MDEV-12720 recovery fails with "Generic error"
# for ROW_FORMAT=compressed
#
CREATE TABLE a(i INT PRIMARY KEY AUTO_INCREMENT, s VARCHAR(255)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
BEGIN;
insert into a(i) select null;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
COMMIT;
SELECT COUNT(*) from a;
COUNT(*)
1010
DROP TABLE a;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SET GLOBAL Innodb_file_per_table=on;
SET @save_innodb_compression_level = @@global.innodb_compression_level;
SET global innodb_compression_level=0;
#create table with 1K block size
CREATE TABLE tab5 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
#create indexes
CREATE INDEX idx1 ON tab5(col_4(10));
CREATE INDEX idx2 ON tab5(col_5(10));
CREATE INDEX idx3 ON tab5(col_6(10));
CREATE INDEX idx4 ON tab5(col_7(10));
CREATE INDEX idx5 ON tab5(col_8(10));
CREATE INDEX idx6 ON tab5(col_11);
#load the with repeat function
SET @col_1 = repeat('a', 100);
SET @col_2 = repeat('b', 100);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
SET @col_7 = repeat('g', 100);
SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
#insert 10 records
BEGIN;
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
COMMIT;
#set the compression level=9 (High compress)
SET global innodb_compression_level=9;
#create table with 1K block size
CREATE TABLE tab6 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
#create indexes
CREATE INDEX idx1 ON tab6(col_4(10));
CREATE INDEX idx2 ON tab6(col_5(10));
CREATE INDEX idx3 ON tab6(col_6(10));
CREATE INDEX idx4 ON tab6(col_7(10));
CREATE INDEX idx5 ON tab6(col_8(10));
CREATE INDEX idx6 ON tab6(col_11);
#insert 10 records
BEGIN;
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
COMMIT;
#diff the sizes of the No compressed table and high compressed table
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test')
-
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test')
FROM DUAL);
#check the size of the table, it should not be Negative value
#The results of this query Test pass = 1 and fail=0
SELECT @size >= 0;
@size >= 0
1
DROP TABLE tab5, tab6;
SET GLOBAL innodb_compression_level = @save_innodb_compression_level;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -11,6 +11,7 @@ let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
--enable_query_log
let $innodb_file_format_orig=`select @@innodb_file_format`;
SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;
......@@ -445,4 +446,4 @@ CREATE TABLE t1(c text, PRIMARY KEY (c(438)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
DROP TABLE t1;
SET GLOBAL innodb_file_format = default;
\ No newline at end of file
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
\ No newline at end of file
......@@ -67,19 +67,19 @@ COMMIT;
ALTER TABLE t DROP INDEX c;
GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
FLUSH PRIVILEGES;
#skipping this test as in xtradb SELECT * FROM information_schema.innodb_cmp_per_index succeed
#GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq';
#FLUSH PRIVILEGES;
-- connect (con1,localhost,tuser01,cDJvI9s_Uq,)
-- connection con1
#-- connect (con1,localhost,tuser01,cDJvI9s_Uq,)
#-- connection con1
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
SELECT * FROM information_schema.innodb_cmp_per_index;
-- connection default
-- disconnect con1
#-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
#SELECT * FROM information_schema.innodb_cmp_per_index;
DROP USER 'tuser01'@'localhost';
#-- connection default
#-- disconnect con1
#DROP USER 'tuser01'@'localhost';
SELECT
database_name,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--innodb_page_size=16384
--innodb_cmp_per_index_reset
\ No newline at end of file
--max_allowed_packet=200M
--innodb_buffer_pool_size=10M
--innodb_log_buffer_size=10M
This diff is collapsed.
--source include/have_innodb.inc
--source include/have_innodb_max_16k.inc
--source include/not_embedded.inc
--disable_query_log
# This test kills the server, which could corrupt some mysql.* tables
# that are not created with ENGINE=InnoDB.
# Flush any non-InnoDB tables to prevent that from happening.
FLUSH TABLES;
--enable_query_log
--echo #
--echo # MDEV-12720 recovery fails with "Generic error"
--echo # for ROW_FORMAT=compressed
--echo #
CREATE TABLE a(i INT PRIMARY KEY AUTO_INCREMENT, s VARCHAR(255)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
BEGIN;
insert into a(i) select null;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
insert into a select null, uuid() from a a, a b, a c;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
COMMIT;
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
SELECT COUNT(*) from a;
DROP TABLE a;
--loose-innodb-sys-tables
--loose-innodb-sys-tablespaces
--loose-innodb-sys-datafiles
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# WL#6501: make truncate table atomic
#
# TC tries to hit crash point during truncate of
# compressed non-temp table residing in single tablespace
# with page-size=16k
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
--source include/have_debug.inc
--source include/big_test.inc
# Valgrind would complain about memory leaks when we crash on purpose.
--source include/not_valgrind.inc
# Embedded server does not support crashing
--source include/not_embedded.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 16;
--source suite/innodb/include/innodb_wl6501_crash.inc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment