mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
BUG#29203 - archive tables have weird values in show table status
Archive engine returns wrong values for average record length and max data length. With this fix they're calculated as following: - max data length is 2 ^ 63 where large files are supported and INT_MAX32 where this is not supported; - average record length is data length / records in data file. mysql-test/r/archive.result: A test case for BUG#29203. mysql-test/t/archive.test: A test case for BUG#29203. storage/archive/ha_archive.cc: Better estimation for average row length and maximal data file length.
This commit is contained in:
@ -12695,3 +12695,14 @@ a b
|
||||
1 NULL
|
||||
2 NULL
|
||||
DROP TABLE t1;
|
||||
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';
|
||||
DATA_LENGTH AVG_ROW_LENGTH
|
||||
8666 15
|
||||
INSERT INTO t1 VALUES(1, 'sampleblob1'),(2, 'sampleblob2');
|
||||
SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
|
||||
INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
|
||||
DATA_LENGTH AVG_ROW_LENGTH
|
||||
8700 4350
|
||||
DROP TABLE t1;
|
||||
|
@ -1599,3 +1599,14 @@ INSERT INTO t1 VALUES (NULL, NULL),(NULL, NULL);
|
||||
FLUSH TABLE t1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#29203 - archive tables have weird values in show table status
|
||||
#
|
||||
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');
|
||||
SELECT DATA_LENGTH, AVG_ROW_LENGTH FROM
|
||||
INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user