Skip to content

Commit b831b57

Browse files
committed
Bug#26960215 : EXPORT/IMPORT IS CRASHING WITH TABLE CREATED IN REDUNDANT ROW
FORMAT Background: After copying ibd file from source server datadir to destination server datadir, during import, we traverse every page of ibd file and reset some information (like space_id, TRX_ID, ROLL_PTR etc.). TRX_ID and ROLL_PTR should be reset only for leaf pages where actual table records exist. Issue: In case of new row format (eg: dynamic), this is being done by checking the record status which will be REC_STATUS_NODE_PTR for a non-leaf page record. If its REC_STATUS_NODE_PTR, then this page is skipped for TRX_ID and ROLL_PTR. But in case of old format (REDUNDANT) this is not done and thus TRX_ID and ROLL_PTR are written on non-leaf page records causing correct data on page to be over written. Which leads to memory corruption. Fix: Make sure TRX_ID, ROLL_PTR are skipped for non-leaf pages irrespective of row format. Reviewed-by: [email protected] RB: 18832
1 parent 64b1cad commit b831b57

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

storage/innobase/row/row0import.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 2012, 2018, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -1827,12 +1827,6 @@ PageConverter::update_records(
18271827

18281828
rec_t* rec = m_rec_iter.current();
18291829

1830-
/* FIXME: Move out of the loop */
1831-
1832-
if (rec_get_status(rec) == REC_STATUS_NODE_PTR) {
1833-
break;
1834-
}
1835-
18361830
ibool deleted = rec_get_deleted_flag(rec, comp);
18371831

18381832
/* For the clustered index we have to adjust the BLOB
@@ -1934,6 +1928,10 @@ PageConverter::update_index_page(
19341928
return(DB_SUCCESS);
19351929
}
19361930

1931+
if (!page_is_leaf(block->frame)) {
1932+
return (DB_SUCCESS);
1933+
}
1934+
19371935
return(update_records(block));
19381936
}
19391937

0 commit comments

Comments
 (0)