Commit b0847443 authored by Monty's avatar Monty

Fix compression tests for s390x

The problem is that s390x is not using the default bzip library we use
on other platforms, which causes compressed string lengths to be differnt
than what mtr tests expects.

Fixed by:
- Added have_normal_bzip.inc, which checks if compress() returns the
  expected length.
- Adjust the results to match the expected one
  - main.func_compress.test & archive.archive
- Don't print lengths that depends on compression library
  - mysqlbinlog compress tests & connect.zip
- Don't print DATA_LENGTH for SET column_compression_zlib_level=1
  - main.column_compression
parent 68a925b3
--source include/have_compress.inc
# Test that the system is using the default/standard bzip library.
# If not, we have to skip the test as the compression lengths displayed
# in the test will not match the results from used compression library.
if (`select length(COMPRESS(space(5000))) != 33`) {
skip Test skipped as standard bzip is needed;
}
......@@ -70,7 +70,8 @@ TRUNCATE TABLE t1;
SET column_compression_zlib_level= 1;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_compressions', 'Column_decompressions');
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
# This is is using < as DATA_LENGTH produces different results on s390x-ubuntu-2004
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
......
......@@ -133,9 +133,9 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_c
VARIABLE_NAME VARIABLE_VALUE
COLUMN_COMPRESSIONS 3
COLUMN_DECOMPRESSIONS 12
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH
40
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH < 100
1
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
......@@ -348,9 +348,9 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_c
VARIABLE_NAME VARIABLE_VALUE
COLUMN_COMPRESSIONS 3
COLUMN_DECOMPRESSIONS 12
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH
40
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH < 100
1
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
......@@ -563,9 +563,9 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_c
VARIABLE_NAME VARIABLE_VALUE
COLUMN_COMPRESSIONS 3
COLUMN_DECOMPRESSIONS 12
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH
40
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH < 100
1
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
......@@ -778,9 +778,9 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_c
VARIABLE_NAME VARIABLE_VALUE
COLUMN_COMPRESSIONS 3
COLUMN_DECOMPRESSIONS 12
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH
40
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH < 100
1
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
......@@ -993,9 +993,9 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_c
VARIABLE_NAME VARIABLE_VALUE
COLUMN_COMPRESSIONS 3
COLUMN_DECOMPRESSIONS 12
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH
60
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH < 100
1
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
......@@ -1209,9 +1209,9 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME IN('Column_c
VARIABLE_NAME VARIABLE_VALUE
COLUMN_COMPRESSIONS 3
COLUMN_DECOMPRESSIONS 12
SELECT DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH
36
SELECT DATA_LENGTH < 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DATA_LENGTH < 100
1
TRUNCATE TABLE t1;
SET column_compression_zlib_level= 9;
INSERT INTO t1 VALUES(REPEAT('ab', 1000));
......
--source include/have_innodb.inc
--source include/have_csv.inc
--source include/have_normal_bzip.inc
let $MYSQLD_DATADIR= `select @@datadir`;
......
--source include/have_innodb.inc
--source include/master-slave.inc
--source include/have_normal_bzip.inc
--let $engine_type= myisam
--let $engine_type2= innodb
......
-- source include/have_compress.inc
-- source include/have_normal_bzip.inc
#
# Test for compress and uncompress functions:
#
......
......@@ -4,6 +4,7 @@
--source include/have_log_bin.inc
--source include/have_binlog_format_row.inc
--source include/have_normal_bzip.inc
#
#
......
......@@ -4,7 +4,7 @@
--source include/have_log_bin.inc
--source include/have_binlog_format_statement.inc
--source include/have_normal_bzip.inc
#
#
# mysqlbinlog: compressed query event
......
......@@ -1612,6 +1612,8 @@ CREATE TABLE t1(a INT, b BLOB) ENGINE=archive;
SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
INSERT INTO t1 VALUES(1, 'sampleblob1'),(2, 'sampleblob2');
# Compression length depends on zip library
--replace_result 583 584 291 292
SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
DROP TABLE t1;
......
--source include/have_innodb.inc
--source include/have_csv.inc
--source include/have_normal_bzip.inc
SET sql_mode=ORACLE;
......
--source include/have_innodb.inc
--source include/have_sequence.inc
--source include/innodb_page_size_small.inc
--source include/have_normal_bzip.inc
call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page.");
......
......@@ -70,10 +70,10 @@ cmpsize BIGINT NOT NULL FLAG=1,
uncsize BIGINT NOT NULL FLAG=2,
method INT NOT NULL FLAG=3)
ENGINE=CONNECT TABLE_TYPE=ZIP FILE_NAME='newdos.zip';
SELECT * FROM t4;
fn cmpsize uncsize method
new1.dos 67 79 8
new2.dos 77 112 8
SELECT fn, uncsize, method FROM t4;
fn uncsize method
new1.dos 79 8
new2.dos 112 8
DROP TABLE t1,t2,t3,t4;
#
# Testing zipped CSV tables
......@@ -161,10 +161,10 @@ cmpsize BIGINT NOT NULL FLAG=1,
uncsize BIGINT NOT NULL FLAG=2,
method INT NOT NULL FLAG=3)
ENGINE=CONNECT TABLE_TYPE=ZIP FILE_NAME='newcsv.zip';
SELECT * FROM t4;
fn cmpsize uncsize method
new1.csv 79 83 8
new2.csv 94 125 8
SELECT fn,uncsize,method FROM t4;
fn uncsize method
new1.csv 83 8
new2.csv 125 8
DROP TABLE t1,t2,t3,t4;
#
# Testing zipped JSON tables
......@@ -234,7 +234,7 @@ cmpsize BIGINT NOT NULL FLAG=1,
uncsize BIGINT NOT NULL FLAG=2,
method INT NOT NULL FLAG=3)
ENGINE=CONNECT TABLE_TYPE=ZIP FILE_NAME='bios.zip';
SELECT * FROM t4;
fn cmpsize uncsize method
bios.json 1096 6848 8
SELECT fn,uncsize,method FROM t4;
fn uncsize method
bios.json 6848 8
DROP TABLE t1,t2,t3,t4;
......@@ -35,7 +35,7 @@ cmpsize BIGINT NOT NULL FLAG=1,
uncsize BIGINT NOT NULL FLAG=2,
method INT NOT NULL FLAG=3)
ENGINE=CONNECT TABLE_TYPE=ZIP FILE_NAME='newdos.zip';
SELECT * FROM t4;
SELECT fn, uncsize, method FROM t4;
DROP TABLE t1,t2,t3,t4;
--echo #
......@@ -75,7 +75,7 @@ cmpsize BIGINT NOT NULL FLAG=1,
uncsize BIGINT NOT NULL FLAG=2,
method INT NOT NULL FLAG=3)
ENGINE=CONNECT TABLE_TYPE=ZIP FILE_NAME='newcsv.zip';
SELECT * FROM t4;
SELECT fn,uncsize,method FROM t4;
DROP TABLE t1,t2,t3,t4;
--echo #
......@@ -123,7 +123,7 @@ cmpsize BIGINT NOT NULL FLAG=1,
uncsize BIGINT NOT NULL FLAG=2,
method INT NOT NULL FLAG=3)
ENGINE=CONNECT TABLE_TYPE=ZIP FILE_NAME='bios.zip';
SELECT * FROM t4;
SELECT fn,uncsize,method FROM t4;
DROP TABLE t1,t2,t3,t4;
#
......@@ -133,4 +133,3 @@ DROP TABLE t1,t2,t3,t4;
--remove_file $MYSQLD_DATADIR/test/newcsv.zip
--remove_file $MYSQLD_DATADIR/test/bios.zip
--remove_file $MYSQLD_DATADIR/test/bios.json
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