diff options
author | Michael Widenius <monty@askmonty.org> | 2011-07-24 01:25:28 -0700 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-07-24 01:25:28 -0700 |
commit | 10065404eae16de02aa843a52d1d1f48dd23e9ac (patch) | |
tree | f4fb6c0dfe883042482babbcb98df5f0a4d25788 /mysql-test | |
parent | 3c97c9c9cc3dde2249846c35020d2eaf2af1bcd0 (diff) | |
download | mariadb-git-10065404eae16de02aa843a52d1d1f48dd23e9ac.tar.gz |
Fixes lp:805930 Sysbench breaks on multiple table test with MariaDB 5.2.7 + Aria
The bug happens when one uses MAX_ROWS=# with Aria & row_format=page and one insert more than # rows.
mysql-test/mysql-test-run.pl:
Ignore table is full error messages
mysql-test/suite/maria/r/max_length.result:
Test case for 'Table is full'
mysql-test/suite/maria/t/max_length.test:
Test case for 'Table is full'
storage/maria/ma_bitmap.c:
Ensure that we don't allocate bits outside of max_data_file_size.
Adjust max_data_file_size based on bitmap alignments.
Backport fix to adjust wrong first_bitmap_with_space.
storage/maria/ma_blockrec.c:
Calculate value of max_data_file_length
storage/maria/ma_blockrec.h:
Updated prototype for _ma_bitmap_init()
storage/maria/ma_check.c:
Give warnings if file sizes are above max file sizes.
Give more warnings in case of errors.
Have maria_chk write if table is recreated.
storage/maria/ma_create.c:
Better calculation of max_data_file_length and thus data pointer length.
Fixes some wrong pointer lengths when using MAX_ROWS=#
storage/maria/ma_open.c:
Removed duplicate assigment.
Use block size from file instead of global variable.
storage/maria/maria_chk.c:
Remove -1 from printed file length
storage/maria/maria_def.h:
Update struct st_maria_file_bitmap
Diffstat (limited to 'mysql-test')
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 1 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/max_length.result | 56 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/max_length.test | 52 |
3 files changed, 109 insertions, 0 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f10f5e4fcba..6545812cc25 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4435,6 +4435,7 @@ sub extract_warning_lines ($) { qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|, qr|mysqld: Table '\./mtr/test_suppressions' is marked as crashed and should be repaired|, qr|InnoDB: Error: table 'test/bug39438'|, + qr|table.*is full|, ); my $matched_lines= []; diff --git a/mysql-test/suite/maria/r/max_length.result b/mysql-test/suite/maria/r/max_length.result new file mode 100644 index 00000000000..668ba01bba5 --- /dev/null +++ b/mysql-test/suite/maria/r/max_length.result @@ -0,0 +1,56 @@ +drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=2 engine=aria; +create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria; +lock tables t1 write,t2 write; +show table status like "t_"; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MARIA 10 Page 0 0 8192 268320768 8192 0 1 # # # latin1_swedish_ci NULL max_rows=2 row_format=PAGE +t2 MARIA 10 Page 0 0 8192 17592186011648 8192 0 1 # # # latin1_swedish_ci NULL max_rows=20000000 row_format=PAGE +insert into t1 values(null, repeat("ab",100),repeat("def",1000)); +insert into t1 values(null, repeat("de",200),repeat("ghi",2000)); +insert into t1 values(null, repeat("fe",300),repeat("ghi",3000)); +insert into t1 values(null, repeat("gh",400),repeat("jkl",10000)); +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +unlock tables; +insert into t1 (v,b) select v,b from t2; +ERROR HY000: The table 't1' is full +check table t1; +Table Op Msg_type Msg_text +test.t1 check warning Datafile is almost full, 268230656 of 268320768 used +test.t1 check status OK +insert into t1 values(null, repeat("gh",400),repeat("jkl",10000)); +ERROR HY000: The table 't1' is full +check table t1; +Table Op Msg_type Msg_text +test.t1 check warning Datafile is almost full, 268230656 of 268320768 used +test.t1 check status OK +truncate table t1; +insert into t1 (v,b) select v,b from t2; +ERROR HY000: The table 't1' is full +check table t1; +Table Op Msg_type Msg_text +test.t1 check warning Datafile is almost full, 268230656 of 268320768 used +test.t1 check status OK +drop table t1,t2; diff --git a/mysql-test/suite/maria/t/max_length.test b/mysql-test/suite/maria/t/max_length.test new file mode 100644 index 00000000000..68ad1e22aa9 --- /dev/null +++ b/mysql-test/suite/maria/t/max_length.test @@ -0,0 +1,52 @@ +# Test max data length +# This test will use around 1.3G of disk space! + +--source include/have_maria.inc +--source include/big_test.inc + +drop table if exists t1,t2; + +create table t1 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=2 engine=aria; +create table t2 (id int(10) unsigned not null auto_increment primary key, v varchar(1000), b blob) row_format=page max_rows=20000000 engine=aria; +lock tables t1 write,t2 write; +--replace_column 12 # 13 # 14 # +show table status like "t_"; +insert into t1 values(null, repeat("ab",100),repeat("def",1000)); +insert into t1 values(null, repeat("de",200),repeat("ghi",2000)); +insert into t1 values(null, repeat("fe",300),repeat("ghi",3000)); +insert into t1 values(null, repeat("gh",400),repeat("jkl",10000)); +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +insert into t1 (v,b) select v,b from t2; +insert into t2 (v,b) select v,b from t1; +unlock tables; + +--error ER_RECORD_FILE_FULL +insert into t1 (v,b) select v,b from t2; +check table t1; +--error ER_RECORD_FILE_FULL +insert into t1 values(null, repeat("gh",400),repeat("jkl",10000)); +check table t1; +# Test also with inserting into empty table (different code) +truncate table t1; +--error ER_RECORD_FILE_FULL +insert into t1 (v,b) select v,b from t2; +check table t1; + +drop table t1,t2; |