Commit abb9e703 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-14690: Assertion `page_link == &fake_link' failed in pagecache_write_part

Fix the call to correspond protocoll of pagecache call.
Fix of misleading variables names.
parent 1f18bd63
...@@ -2686,3 +2686,14 @@ select count(*) from t1; ...@@ -2686,3 +2686,14 @@ select count(*) from t1;
count(*) count(*)
13 13
drop table t1; drop table t1;
#
# MDEV-14690: Assertion `page_link == &fake_link' failed in
# pagecache_write_part
#
CREATE TABLE t1 (a CHAR(8), b CHAR(8), c CHAR(8) NOT NULL DEFAULT '', f FLOAT, KEY(f)) ENGINE=Aria;
INSERT INTO t1 (a) VALUES ('foo');
DELETE FROM t1 WHERE c < 'bar';
ALTER TABLE t1 DISABLE KEYS;
INSERT INTO t1 (b) VALUES ('');
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
...@@ -1964,6 +1964,21 @@ unlock tables; ...@@ -1964,6 +1964,21 @@ unlock tables;
select count(*) from t1; select count(*) from t1;
drop table t1; drop table t1;
--echo #
--echo # MDEV-14690: Assertion `page_link == &fake_link' failed in
--echo # pagecache_write_part
--echo #
CREATE TABLE t1 (a CHAR(8), b CHAR(8), c CHAR(8) NOT NULL DEFAULT '', f FLOAT, KEY(f)) ENGINE=Aria;
INSERT INTO t1 (a) VALUES ('foo');
DELETE FROM t1 WHERE c < 'bar';
ALTER TABLE t1 DISABLE KEYS;
INSERT INTO t1 (b) VALUES ('');
ALTER TABLE t1 ENABLE KEYS;
# Cleanup
DROP TABLE t1;
# #
# End of test # End of test
# #
......
...@@ -229,17 +229,35 @@ my_bool _ma_write_keypage(MARIA_PAGE *page, enum pagecache_page_lock lock, ...@@ -229,17 +229,35 @@ my_bool _ma_write_keypage(MARIA_PAGE *page, enum pagecache_page_lock lock,
#endif #endif
page_cleanup(share, page); page_cleanup(share, page);
res= pagecache_write(share->pagecache, {
&share->kfile, PAGECACHE_BLOCK_LINK **link;
(pgcache_page_no_t) (page->pos / block_size), enum pagecache_page_pin pin;
level, buff, share->page_type, if (lock == PAGECACHE_LOCK_LEFT_WRITELOCKED)
lock, {
lock == PAGECACHE_LOCK_LEFT_WRITELOCKED ? pin= PAGECACHE_PIN_LEFT_PINNED;
PAGECACHE_PIN_LEFT_PINNED : link= &page_link.link;
(lock == PAGECACHE_LOCK_WRITE_UNLOCK ? }
PAGECACHE_UNPIN : PAGECACHE_PIN), else if (lock == PAGECACHE_LOCK_WRITE_UNLOCK)
PAGECACHE_WRITE_DELAY, &page_link.link, {
LSN_IMPOSSIBLE); pin= PAGECACHE_UNPIN;
/*
We unlock this page so link should be 0 to prevent it usage
even accidentally
*/
link= NULL;
}
else
{
pin= PAGECACHE_PIN;
link= &page_link.link;
}
res= pagecache_write(share->pagecache,
&share->kfile,
(pgcache_page_no_t) (page->pos / block_size),
level, buff, share->page_type,
lock, pin, PAGECACHE_WRITE_DELAY, link,
LSN_IMPOSSIBLE);
}
if (lock == PAGECACHE_LOCK_WRITE) if (lock == PAGECACHE_LOCK_WRITE)
{ {
......
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