From 76d68c814bb07e67de0453631ac836ff572dfeeb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= <marko.makela@oracle.com>
Date: Thu, 9 Sep 2010 13:48:00 +0300
Subject: [PATCH] ibuf_insert_to_index_page(): Remove bogus code added for
 delete buffering. In early development of delete buffering, we did allow
 B-tree pages to become empty as a result of buffered deletes. That caused
 fundamental problems. The fix was to refuse buffering purge operations unless
 the page can be guaranteed to be nonempty. Remove an attempt to cope with
 empty pages when merging inserts.

---
 storage/innobase/ibuf/ibuf0ibuf.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c
index a048de0e88..b77390ab03 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.c
+++ b/storage/innobase/ibuf/ibuf0ibuf.c
@@ -3779,17 +3779,11 @@ ibuf_insert_to_index_page(
 	rec = page_rec_get_next(page_get_infimum_rec(page));
 
 	if (page_rec_is_supremum(rec)) {
-		/* Empty pages can result from buffered delete operations.
-		The first record from the free list can be used to find the
-		father node. */
-		rec = page_header_get_ptr(page, PAGE_FREE);
-		if (UNIV_UNLIKELY(rec == NULL)) {
-			fputs("InnoDB: Trying to insert a record from"
-			      " the insert buffer to an index page\n"
-			      "InnoDB: but the index page is empty!\n",
-			      stderr);
-			goto dump;
-		}
+		fputs("InnoDB: Trying to insert a record from"
+		      " the insert buffer to an index page\n"
+		      "InnoDB: but the index page is empty!\n",
+		      stderr);
+		goto dump;
 	}
 
 	if (UNIV_UNLIKELY(rec_get_n_fields(rec, index)
-- 
2.30.9