diff --git a/mysql-test/r/maria-big.result b/mysql-test/r/maria-big.result new file mode 100644 index 00000000000..ca18d992187 --- /dev/null +++ b/mysql-test/r/maria-big.result @@ -0,0 +1,61 @@ +set storage_engine=maria; +affected rows: 0 +drop table if exists t1, t2; +affected rows: 0 +create table t1(a char(3)); +affected rows: 0 +insert into t1 values("abc"); +affected rows: 1 +insert into t1 select "def" from t1; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +insert into t1 select "ghi" from t1; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +insert into t1 select "jkl" from t1; +affected rows: 4 +info: Records: 4 Duplicates: 0 Warnings: 0 +insert into t1 select "mno" from t1; +affected rows: 8 +info: Records: 8 Duplicates: 0 Warnings: 0 +insert into t1 select "pqr" from t1; +affected rows: 16 +info: Records: 16 Duplicates: 0 Warnings: 0 +insert into t1 select "stu" from t1; +affected rows: 32 +info: Records: 32 Duplicates: 0 Warnings: 0 +insert into t1 select "vwx" from t1; +affected rows: 64 +info: Records: 64 Duplicates: 0 Warnings: 0 +insert into t1 select "yza" from t1; +affected rows: 128 +info: Records: 128 Duplicates: 0 Warnings: 0 +insert into t1 select "ceg" from t1; +affected rows: 256 +info: Records: 256 Duplicates: 0 Warnings: 0 +insert into t1 select "ikm" from t1; +affected rows: 512 +info: Records: 512 Duplicates: 0 Warnings: 0 +insert into t1 select "oqs" from t1; +affected rows: 1024 +info: Records: 1024 Duplicates: 0 Warnings: 0 +select count(*) from t1; +count(*) +2048 +affected rows: 1 +insert into t1 select "uwy" from t1; +affected rows: 2048 +info: Records: 2048 Duplicates: 0 Warnings: 0 +create table t2 select * from t1; +affected rows: 4096 +info: Records: 4096 Duplicates: 0 Warnings: 0 +select count(*) from t1; +count(*) +4096 +affected rows: 1 +select count(*) from t2; +count(*) +4096 +affected rows: 1 +drop table t1, t2; +affected rows: 0 diff --git a/mysql-test/t/maria-big.test b/mysql-test/t/maria-big.test new file mode 100644 index 00000000000..f68531c3894 --- /dev/null +++ b/mysql-test/t/maria-big.test @@ -0,0 +1,26 @@ +# Test of scenarios potentially too big for --valgrind or --mem +enable_info; +set storage_engine=maria; +disable_warnings; +drop table if exists t1, t2; +enable_warnings; +create table t1(a char(3)); +insert into t1 values("abc"); +insert into t1 select "def" from t1; +insert into t1 select "ghi" from t1; +insert into t1 select "jkl" from t1; +insert into t1 select "mno" from t1; +insert into t1 select "pqr" from t1; +insert into t1 select "stu" from t1; +insert into t1 select "vwx" from t1; +insert into t1 select "yza" from t1; +insert into t1 select "ceg" from t1; +insert into t1 select "ikm" from t1; +insert into t1 select "oqs" from t1; +select count(*) from t1; +insert into t1 select "uwy" from t1; +create table t2 select * from t1; +select count(*) from t1; +select count(*) from t2; +drop table t1, t2; +disable_info; diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 800ed8f14ac..39769507887 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -3454,7 +3454,8 @@ restart_bitmap_scan: for (data+= 6; data < info->scan.bitmap_end; data+= 6) { bits= uint6korr(data); - if (bits && ((bits & LL(04444444444444444)) != LL(04444444444444444))) + /* Skip not allocated pages and blob / full tail pages */ + if (bits && bits != LL(07777777777777777)) break; } bit_pos= 0;