diff options
author | Michael Widenius <monty@askmonty.org> | 2011-08-15 16:39:53 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-08-15 16:39:53 +0300 |
commit | b95d2778aa9d4abe5331f9e6f593fd05e1cb2de6 (patch) | |
tree | 40153c18c10f129f5f0042c67ef32c6f16bb33b8 /mysql-test | |
parent | eeb04a339f2bf6eb64e87cf98869a03340bbd7c6 (diff) | |
download | mariadb-git-b95d2778aa9d4abe5331f9e6f593fd05e1cb2de6.tar.gz |
Fixes bugs found by testcase for lp:815022 and lp:726374 "ma_blockrec.c:3000: write_block_record: Assertion `cur_block[1].page_count == 0' failed with a multi-index Aria workload"
The issues was:
- For some tables with a lot of not packed fields, we didn't allocate enough memory in head page which caused DBUG_ASSERT's
- Removed wrong DBUG_ASSERT()
- Fixed a problem with underflow() where it generates a key page where all keys didn't fit.
- Max key length is now limited by block_size/3 (was block_size /2). This is required for underflow() to work with packed keys.
mysql-test/lib/v1/mysql-test-run.pl:
Remove --alignment=8 as this doesn't work on 64 bit systems
mysql-test/suite/maria/r/small_blocksize.result:
Test case for Aria bug
mysql-test/suite/maria/t/small_blocksize-master.opt:
Test case for Aria bug
mysql-test/suite/maria/t/small_blocksize.test:
Test case for Aria bug
storage/maria/ha_maria.cc:
Fixed comment
storage/maria/ma_bitmap.c:
Fixed wrong variable usage in find_where_to_split_row() where we allocated too little memory for head page.
We did not take into account space for head extents (long VARCHAR) when trying to split row on head page. This caused us to allocate too little space from bitmap which lead to ASSERT failures later.
storage/maria/ma_blockrec.c:
Made some argument const (to ensure they was not accidently changed)
Removed wrong DBUG_ASSERT()
storage/maria/ma_blockrec.h:
Removed not used variable
storage/maria/ma_delete.c:
Added my_afree() in case of error
More comments and DBUG_ASSERT() for underflow()
storage/maria/ma_open.c:
Make keyinfo->underflow_block_length smaller for packed keys. This has to be done as for long packed keys, underflow() otherwise generates a key page where all keys didn't fit.
storage/maria/ma_page.c:
New DBUG_ASSERT()
storage/maria/ma_write.c:
Fixed comment
storage/maria/maria_def.h:
We have to have space for at least 3 keys on a key page.
(Otherwise the underflow() code doesn't work for packed keys, even when we have an underflow() for an empty key page)
Diffstat (limited to 'mysql-test')
-rwxr-xr-x | mysql-test/lib/v1/mysql-test-run.pl | 1 | ||||
-rw-r--r-- | mysql-test/suite/maria/r/small_blocksize.result | 75 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/small_blocksize-master.opt | 1 | ||||
-rw-r--r-- | mysql-test/suite/maria/t/small_blocksize.test | 35 |
4 files changed, 111 insertions, 1 deletions
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 5671f58bbfe..a47d58a5180 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -5285,7 +5285,6 @@ sub valgrind_arguments { else { mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option - mtr_add_arg($args, "--alignment=8"); mtr_add_arg($args, "--leak-check=yes"); mtr_add_arg($args, "--num-callers=16"); mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) diff --git a/mysql-test/suite/maria/r/small_blocksize.result b/mysql-test/suite/maria/r/small_blocksize.result new file mode 100644 index 00000000000..41d9a561a4d --- /dev/null +++ b/mysql-test/suite/maria/r/small_blocksize.result @@ -0,0 +1,75 @@ +DROP TABLE if exists t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1 (col_longtext_ucs2 longtext, col_longtext_utf8 longtext, col_varchar_255_ucs2_key varchar(255), col_set_utf8 set ('a','b'), col_char_255_ucs2 char(255), col_char_255_ucs2_key char(255), col_enum_ucs2 enum ('a','b'), col_varchar_255_ucs2 varchar(255), col_longtext_ucs2_key longtext, col_longtext_utf8_key longtext, col_enum_utf8 enum ('a','b'), col_varchar_255_utf8_key varchar(1024), col_varchar_255_utf8 varchar(255), col_enum_ucs2_key enum ('a','b'), col_enum_utf8_key enum ('a','b'), col_set_utf8_key set ('a','b'), col_char_255_utf8 char(255), pk integer auto_increment, col_set_ucs2_key set ('a','b'), col_char_255_utf8_key char(255), col_set_ucs2 set ('a','b'), primary key (pk)) ENGINE=aria; +INSERT INTO t1 ( col_char_255_utf8, col_varchar_255_utf8_key, col_longtext_utf8_key ) VALUES ( 'lggnqojgqectqlkvskffihliqcwoakzzzjvhkqlwjybkngdbubskflpmzegdrk', REPEAT( 'a', 627 ), 'mlggnqojgqectqlkvskffihliqcwoakzzzjvhkqlwjybkngdbubskflpmzegdrklnipcmzbtwdqfnyinqfohgtiwmvfpbuslgobjhslxnaybcyebhsrlipnuvalhmvhlwbwujtvjsdrbyapfzprnxfgtrukwhywtkaoupsaogxsjxhqjkidvnpeytjgndtnrrbm' ); +UPDATE t1 SET col_varchar_255_utf8 = REPEAT('a', 197 ); +UPDATE t1 SET col_char_255_utf8 = 'bmjihzjtxegprqfvmczyzbavjuozkyxrlxvqyzcfvsjrhcccqnecyohzhzbgsbqkqvzmtlhtlcgzheirkyfwczoolilkrfimfnuoapyylbghdhdgfebjjajfoigagozypqtrflrvdiwfgqalsqbmlllsanvtuuutiaastqtbzeoaawl'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a int primary key auto_increment, e1 enum('a','b'), e2 enum('a','b'), vl int, bl int, c char(10), v1 varchar(10000), v2 varchar(10000), b1 blob, b2 blob) engine=aria; +insert into t1 (vl,bl) values (10,10),(100,100),(1000,1000),(5000,5000),(8000,12000); +update t1 set c="test", v1=repeat('a',vl),v2=repeat('b',vl/2),b1=repeat('c',bl),b2=repeat('d',bl); +insert into t1 (vl,bl) values (10,10),(100,100),(1000,1000),(1000,5000); +update t1 set c="test", v1=repeat(vl/4,'a'),v2=repeat(vl/5,'b'),b1=repeat(b1*2,'c'),b2=repeat(bl/2,'d'); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'b' +Warning 1292 Truncated incorrect INTEGER value: 'c' +Warning 1292 Truncated incorrect INTEGER value: 'd' +update t1 set c="test", v1=repeat('a',vl/4),v2=repeat('b',vl/5),b1=repeat('c',bl*2),b2=repeat('d',bl/2); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',vl),v2=repeat('b',vl),b1=repeat('c',bl*2),b2=repeat('d',bl/2); +update t1 set c="test", v1=repeat('a',vl/2),v2=repeat('b',vl/2),b1=repeat('c',bl/2),b2=repeat('d',bl/2); +update t1 set c="test", v1=repeat('a',vl/4),v2=repeat('b',vl/4),b1=repeat('c',bl/4),b2=repeat('d',bl/4); +update t1 set c="test", v1=repeat('a',vl/20),v2=repeat('b',vl),b1=repeat('c',bl/20),b2=repeat('d',bl/20); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',vl/100),b1=repeat('c',bl/100); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',vl),b1=repeat('c',bl); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',10),v2=repeat('b',10); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',2000),v2=repeat('b',2000); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/suite/maria/t/small_blocksize-master.opt b/mysql-test/suite/maria/t/small_blocksize-master.opt new file mode 100644 index 00000000000..59fd35a7846 --- /dev/null +++ b/mysql-test/suite/maria/t/small_blocksize-master.opt @@ -0,0 +1 @@ +--aria-block-size=1024 diff --git a/mysql-test/suite/maria/t/small_blocksize.test b/mysql-test/suite/maria/t/small_blocksize.test new file mode 100644 index 00000000000..673558e6b20 --- /dev/null +++ b/mysql-test/suite/maria/t/small_blocksize.test @@ -0,0 +1,35 @@ +DROP TABLE if exists t1; + +# +# Test of extending updated rows. +# This caused failures in lp:815022 +# +CREATE TABLE t1 (col_longtext_ucs2 longtext, col_longtext_utf8 longtext, col_varchar_255_ucs2_key varchar(255), col_set_utf8 set ('a','b'), col_char_255_ucs2 char(255), col_char_255_ucs2_key char(255), col_enum_ucs2 enum ('a','b'), col_varchar_255_ucs2 varchar(255), col_longtext_ucs2_key longtext, col_longtext_utf8_key longtext, col_enum_utf8 enum ('a','b'), col_varchar_255_utf8_key varchar(1024), col_varchar_255_utf8 varchar(255), col_enum_ucs2_key enum ('a','b'), col_enum_utf8_key enum ('a','b'), col_set_utf8_key set ('a','b'), col_char_255_utf8 char(255), pk integer auto_increment, col_set_ucs2_key set ('a','b'), col_char_255_utf8_key char(255), col_set_ucs2 set ('a','b'), primary key (pk)) ENGINE=aria; +INSERT INTO t1 ( col_char_255_utf8, col_varchar_255_utf8_key, col_longtext_utf8_key ) VALUES ( 'lggnqojgqectqlkvskffihliqcwoakzzzjvhkqlwjybkngdbubskflpmzegdrk', REPEAT( 'a', 627 ), 'mlggnqojgqectqlkvskffihliqcwoakzzzjvhkqlwjybkngdbubskflpmzegdrklnipcmzbtwdqfnyinqfohgtiwmvfpbuslgobjhslxnaybcyebhsrlipnuvalhmvhlwbwujtvjsdrbyapfzprnxfgtrukwhywtkaoupsaogxsjxhqjkidvnpeytjgndtnrrbm' ); +UPDATE t1 SET col_varchar_255_utf8 = REPEAT('a', 197 ); +UPDATE t1 SET col_char_255_utf8 = 'bmjihzjtxegprqfvmczyzbavjuozkyxrlxvqyzcfvsjrhcccqnecyohzhzbgsbqkqvzmtlhtlcgzheirkyfwczoolilkrfimfnuoapyylbghdhdgfebjjajfoigagozypqtrflrvdiwfgqalsqbmlllsanvtuuutiaastqtbzeoaawl'; +check table t1; +drop table t1; + +create table t1 (a int primary key auto_increment, e1 enum('a','b'), e2 enum('a','b'), vl int, bl int, c char(10), v1 varchar(10000), v2 varchar(10000), b1 blob, b2 blob) engine=aria; + +insert into t1 (vl,bl) values (10,10),(100,100),(1000,1000),(5000,5000),(8000,12000); +update t1 set c="test", v1=repeat('a',vl),v2=repeat('b',vl/2),b1=repeat('c',bl),b2=repeat('d',bl); +insert into t1 (vl,bl) values (10,10),(100,100),(1000,1000),(1000,5000); +update t1 set c="test", v1=repeat(vl/4,'a'),v2=repeat(vl/5,'b'),b1=repeat(b1*2,'c'),b2=repeat(bl/2,'d'); +update t1 set c="test", v1=repeat('a',vl/4),v2=repeat('b',vl/5),b1=repeat('c',bl*2),b2=repeat('d',bl/2); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',vl),v2=repeat('b',vl),b1=repeat('c',bl*2),b2=repeat('d',bl/2); +update t1 set c="test", v1=repeat('a',vl/2),v2=repeat('b',vl/2),b1=repeat('c',bl/2),b2=repeat('d',bl/2); +update t1 set c="test", v1=repeat('a',vl/4),v2=repeat('b',vl/4),b1=repeat('c',bl/4),b2=repeat('d',bl/4); +update t1 set c="test", v1=repeat('a',vl/20),v2=repeat('b',vl),b1=repeat('c',bl/20),b2=repeat('d',bl/20); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',vl/100),b1=repeat('c',bl/100); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',vl),b1=repeat('c',bl); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',10),v2=repeat('b',10); +insert into t1 (vl,bl) values (100,100); +update t1 set c="test", v1=repeat('a',2000),v2=repeat('b',2000); +check table t1; +drop table t1; |