[MDEV-23308] CHECK TABLE attempts to access parent_right_page_no=FIL_NULL Created: 2020-07-28  Updated: 2020-07-28  Resolved: 2020-07-28

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.2, 10.3.0, 10.4.0, 10.5.0
Fix Version/s: 10.2.33, 10.3.24, 10.4.14, 10.5.5

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: regression-10.2, upstream


 Description   

While debugging MDEV-23304, I encountered crashes in CHECK TABLE. As a result of the bug, the parent page (root page of the clustered index) would miss many node pointers to child pages, but the child pages would be reachable from each other via the doubly linked list formed by FIL_PAGE_NEXT and FIL_PAGE_PREV. The command crashed, because it was attempting to access parent_right_page_no, which was still FIL_NULL. For parent_page_no, we do have an appropriate condition:

			} else if (parent_page_no != FIL_NULL) {
				btr_block_get(
					page_id_t(index->space,
						  parent_page_no),
					table_page_size,
					RW_SX_LATCH, index, &mtr);

The problematic code was added in the merge of WL#6326 to MySQL 5.7.2 and later imported to MariaDB 10.2.2.


Generated at Thu Feb 08 09:21:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.