Commit 57ba2a85 authored by Michael Widenius's avatar Michael Widenius

Fixed bug in Aria that caused REPAIR to find old deleted rows.

BUILD/compile-pentium64:
  Added --with-zlib-dir=bundled when doing static build.
mysql-test/suite/maria/r/maria.result:
  Added test case
mysql-test/suite/maria/t/maria.test:
  Added test case
storage/maria/ma_blockrec.c:
  We need to flush blob pages to disk to ensure they overwrite any reused head/tail pages.
  If not, REPAIR will find rows that was previously deleted.
parent 91bdcb20
......@@ -4,7 +4,10 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags"
extra_configs="$pentium_configs $static_link"
# On CentOS/Fedora Core 10 amd64, there is system libz.so but not
# libz.a, so need to use bundled zlib when building static
# binary. Hence we use --with-zlib-dir=bundled
extra_configs="$pentium_configs $static_link --with-zlib-dir=bundled"
CC="$CC --pipe"
strip=yes
......
......@@ -2624,3 +2624,19 @@ KEY (v3)
INSERT INTO t1 ( f1 , f2 , f3 , f4 ) SELECT f1 , f4 , f1 , f4 FROM t1;
DELETE FROM t1;
drop table t1;
create table t1 (a int not null primary key, b blob) engine=maria transactional=1;
insert into t1 values(1,repeat('a',8000));
insert into t1 values(2,repeat('b',8000));
insert into t1 values(3,repeat('c',8000));
flush tables;
delete from t1 where a>1;
insert into t1 values(1,repeat('d',8000*3));
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
flush tables;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
repair table t1 extended;
Table Op Msg_type Msg_text
test.t1 repair status OK
drop table t1;
......@@ -1910,6 +1910,24 @@ INSERT INTO t1 ( f1 , f2 , f3 , f4 ) SELECT f1 , f4 , f1 , f4 FROM t1;
DELETE FROM t1;
drop table t1;
#
# Test of problem where REPAIR finds old deleted rows.
#
create table t1 (a int not null primary key, b blob) engine=maria transactional=1;
insert into t1 values(1,repeat('a',8000));
insert into t1 values(2,repeat('b',8000));
insert into t1 values(3,repeat('c',8000));
flush tables;
delete from t1 where a>1;
--error 1062
insert into t1 values(1,repeat('d',8000*3));
flush tables;
check table t1;
# This failed by finding 2 extra rows.
repair table t1 extended;
drop table t1;
#
# End of test
#
......
......@@ -2506,7 +2506,7 @@ static my_bool free_full_page_range(MARIA_HA *info, pgcache_page_no_t page,
}
if (delete_count &&
pagecache_delete_pages(share->pagecache, &info->dfile,
page, delete_count, PAGECACHE_LOCK_WRITE, 0))
page, delete_count, PAGECACHE_LOCK_WRITE, 1))
res= 1;
if (share->now_transactional)
......
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