Below is the list of changes that have just been committed into a local
5.0 repository of marko. When marko does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1851 05/04/18 15:12:30 marko@stripped +5 -0
InnoDB: Replace the redo log entry type
MLOG_COMP_REC_SEC_DELETE_MARK with MLOG_REC_SEC_DELETE_MARK
in order to reduce the space occupied by the redo log.
innobase/log/log0recv.c
1.47 05/04/18 15:12:21 marko@stripped +18 -6
recv_parse_or_apply_log_rec_body():
Ignore the index information in MLOG_COMP_REC_SEC_DELETE_MARK.
Add assertions about page_is_comp().
innobase/include/mtr0mtr.h
1.12 05/04/18 15:12:21 marko@stripped +5 -1
Note that MLOG_COMP_REC_SEC_DELETE_MARK is obsolete
innobase/include/btr0cur.h
1.15 05/04/18 15:12:21 marko@stripped +0 -2
Remove unnecessary dict_index_t* parameters
innobase/ibuf/ibuf0ibuf.c
1.37 05/04/18 15:12:21 marko@stripped +1 -1
Remove unnecessary parameter to btr_cur_del_unmark_for_ibuf()
innobase/btr/btr0cur.c
1.45 05/04/18 15:12:21 marko@stripped +12 -13
Replace MLOG_COMP_REC_SEC_DELETE_MARK with MLOG_REC_SEC_DELETE_MARK
and eliminate redundant dict_index_t* parameters.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: marko
# Host: hundin.mysql.fi
# Root: /home/marko/mysql-5.0
--- 1.44/innobase/btr/btr0cur.c Thu Mar 10 15:15:59 2005
+++ 1.45/innobase/btr/btr0cur.c Mon Apr 18 15:12:21 2005
@@ -2189,17 +2189,13 @@
btr_cur_del_mark_set_sec_rec_log(
/*=============================*/
rec_t* rec, /* in: record */
- dict_index_t* index, /* in: record descriptor */
ibool val, /* in: value to set */
mtr_t* mtr) /* in: mtr */
{
byte* log_ptr;
ut_ad(val <= 1);
- log_ptr = mlog_open_and_write_index(mtr, rec, index, index->table->comp
- ? MLOG_COMP_REC_SEC_DELETE_MARK
- : MLOG_REC_SEC_DELETE_MARK,
- 1 + 2);
+ log_ptr = mlog_open(mtr, 11 + 1 + 2);
if (!log_ptr) {
/* Logging in mtr is switched off during crash recovery:
@@ -2207,10 +2203,12 @@
return;
}
+ log_ptr = mlog_write_initial_log_record_fast(
+ rec, MLOG_REC_SEC_DELETE_MARK, log_ptr, mtr);
mach_write_to_1(log_ptr, val);
log_ptr++;
- mach_write_to_2(log_ptr, rec - buf_frame_align(rec));
+ mach_write_to_2(log_ptr, ut_align_offset(rec, UNIV_PAGE_SIZE));
log_ptr += 2;
mlog_close(mtr, log_ptr);
@@ -2226,7 +2224,6 @@
/* out: end of log record or NULL */
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
- dict_index_t* index, /* in: record descriptor */
page_t* page) /* in: page or NULL */
{
ibool val;
@@ -2253,7 +2250,7 @@
is only being recovered, and there cannot be a hash index to
it. */
- rec_set_deleted_flag(rec, index->table->comp, val);
+ rec_set_deleted_flag(rec, page_is_comp(page), val);
}
return(ptr);
@@ -2293,18 +2290,21 @@
}
block = buf_block_align(rec);
+ ut_ad(!!page_is_comp(buf_block_get_frame(block))
+ == cursor->index->table->comp);
if (block->is_hashed) {
rw_lock_x_lock(&btr_search_latch);
}
- rec_set_deleted_flag(rec, cursor->index->table->comp, val);
+ rec_set_deleted_flag(rec, page_is_comp(buf_block_get_frame(block)),
+ val);
if (block->is_hashed) {
rw_lock_x_unlock(&btr_search_latch);
}
- btr_cur_del_mark_set_sec_rec_log(rec, cursor->index, val, mtr);
+ btr_cur_del_mark_set_sec_rec_log(rec, val, mtr);
return(DB_SUCCESS);
}
@@ -2317,15 +2317,14 @@
btr_cur_del_unmark_for_ibuf(
/*========================*/
rec_t* rec, /* in: record to delete unmark */
- dict_index_t* index, /* in: record descriptor */
mtr_t* mtr) /* in: mtr */
{
/* We do not need to reserve btr_search_latch, as the page has just
been read to the buffer pool and there cannot be a hash index to it. */
- rec_set_deleted_flag(rec, index->table->comp, FALSE);
+ rec_set_deleted_flag(rec, page_is_comp(buf_frame_align(rec)), FALSE);
- btr_cur_del_mark_set_sec_rec_log(rec, index, FALSE, mtr);
+ btr_cur_del_mark_set_sec_rec_log(rec, FALSE, mtr);
}
/*==================== B-TREE RECORD REMOVE =========================*/
--- 1.36/innobase/ibuf/ibuf0ibuf.c Fri Jan 14 13:54:14 2005
+++ 1.37/innobase/ibuf/ibuf0ibuf.c Mon Apr 18 15:12:21 2005
@@ -2848,7 +2848,7 @@
if (low_match == dtuple_get_n_fields(entry)) {
rec = page_cur_get_rec(&page_cur);
- btr_cur_del_unmark_for_ibuf(rec, index, mtr);
+ btr_cur_del_unmark_for_ibuf(rec, mtr);
} else {
rec = page_cur_tuple_insert(&page_cur, entry, index, mtr);
--- 1.14/innobase/include/btr0cur.h Thu Dec 2 19:42:31 2004
+++ 1.15/innobase/include/btr0cur.h Mon Apr 18 15:12:21 2005
@@ -284,7 +284,6 @@
btr_cur_del_unmark_for_ibuf(
/*========================*/
rec_t* rec, /* in: record to delete unmark */
- dict_index_t* index, /* in: record descriptor */
mtr_t* mtr); /* in: mtr */
/*****************************************************************
Tries to compress a page of the tree on the leaf level. It is assumed
@@ -389,7 +388,6 @@
/* out: end of log record or NULL */
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
- dict_index_t* index, /* in: index corresponding to page */
page_t* page); /* in: page or NULL */
/***********************************************************************
Estimates the number of rows in a given index range. */
--- 1.11/innobase/include/mtr0mtr.h Thu Dec 2 19:42:31 2004
+++ 1.12/innobase/include/mtr0mtr.h Mon Apr 18 15:12:21 2005
@@ -112,7 +112,11 @@
/* mark compact clustered index
record deleted */
#define MLOG_COMP_REC_SEC_DELETE_MARK ((byte)40)/* mark compact secondary index
- record deleted */
+ record deleted; this log
+ record type is redundant, as
+ MLOG_REC_SEC_DELETE_MARK is
+ independent of the record
+ format. */
#define MLOG_COMP_REC_UPDATE_IN_PLACE ((byte)41)/* update of a compact record,
preserves record field sizes */
#define MLOG_COMP_REC_DELETE ((byte)42) /* delete a compact record
--- 1.46/innobase/log/log0recv.c Thu Mar 10 09:07:31 2005
+++ 1.47/innobase/log/log0recv.c Mon Apr 18 15:12:21 2005
@@ -765,6 +765,7 @@
case MLOG_REC_INSERT: case MLOG_COMP_REC_INSERT:
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_REC_INSERT, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = page_cur_parse_insert_rec(FALSE, ptr, end_ptr,
index, page, mtr);
}
@@ -772,20 +773,27 @@
case MLOG_REC_CLUST_DELETE_MARK: case MLOG_COMP_REC_CLUST_DELETE_MARK:
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_REC_CLUST_DELETE_MARK, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = btr_cur_parse_del_mark_set_clust_rec(ptr,
end_ptr, index, page);
}
break;
- case MLOG_REC_SEC_DELETE_MARK: case MLOG_COMP_REC_SEC_DELETE_MARK:
- if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
- type == MLOG_COMP_REC_SEC_DELETE_MARK, &index))) {
- ptr = btr_cur_parse_del_mark_set_sec_rec(ptr, end_ptr,
- index, page);
- }
+ case MLOG_COMP_REC_SEC_DELETE_MARK:
+ /* This log record type is obsolete, but we process it for
+ backward compatibility with MySQL 5.0.3 and 5.0.4. */
+ ut_a(!page || page_is_comp(page));
+ ptr = mlog_parse_index(ptr, end_ptr, TRUE, &index);
+ if (!ptr) {
+ break;
+ }
+ /* Fall through */
+ case MLOG_REC_SEC_DELETE_MARK:
+ ptr = btr_cur_parse_del_mark_set_sec_rec(ptr, end_ptr, page);
break;
case MLOG_REC_UPDATE_IN_PLACE: case MLOG_COMP_REC_UPDATE_IN_PLACE:
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_REC_UPDATE_IN_PLACE, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = btr_cur_parse_update_in_place(ptr, end_ptr,
page, index);
}
@@ -795,6 +803,7 @@
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_LIST_END_DELETE
|| type == MLOG_COMP_LIST_START_DELETE, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = page_parse_delete_rec_list(type, ptr, end_ptr,
index, page, mtr);
}
@@ -802,6 +811,7 @@
case MLOG_LIST_END_COPY_CREATED: case MLOG_COMP_LIST_END_COPY_CREATED:
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_LIST_END_COPY_CREATED, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = page_parse_copy_rec_list_to_created_page(ptr,
end_ptr, index, page, mtr);
}
@@ -809,6 +819,7 @@
case MLOG_PAGE_REORGANIZE: case MLOG_COMP_PAGE_REORGANIZE:
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_PAGE_REORGANIZE, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = btr_parse_page_reorganize(ptr, end_ptr, index,
page, mtr);
}
@@ -841,6 +852,7 @@
case MLOG_REC_DELETE: case MLOG_COMP_REC_DELETE:
if (NULL != (ptr = mlog_parse_index(ptr, end_ptr,
type == MLOG_COMP_REC_DELETE, &index))) {
+ ut_a(!page||!!page_is_comp(page)==index->table->comp);
ptr = page_cur_parse_delete_rec(ptr, end_ptr,
index, page, mtr);
}
| Thread |
|---|
| • bk commit into 5.0 tree (marko:1.1851) | Marko Mäkelä | 18 Apr |