Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
07de38bf
Commit
07de38bf
authored
Sep 17, 2012
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.1 to mysql-5.5.
parents
3b48d80b
dc80dcac
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
164 additions
and
90 deletions
+164
-90
storage/innobase/btr/btr0btr.c
storage/innobase/btr/btr0btr.c
+17
-15
storage/innobase/btr/btr0cur.c
storage/innobase/btr/btr0cur.c
+13
-11
storage/innobase/buf/buf0lru.c
storage/innobase/buf/buf0lru.c
+3
-1
storage/innobase/ibuf/ibuf0ibuf.c
storage/innobase/ibuf/ibuf0ibuf.c
+2
-2
storage/innobase/include/page0zip.h
storage/innobase/include/page0zip.h
+5
-3
storage/innobase/log/log0recv.c
storage/innobase/log/log0recv.c
+2
-3
storage/innobase/page/page0cur.c
storage/innobase/page/page0cur.c
+3
-3
storage/innobase/page/page0page.c
storage/innobase/page/page0page.c
+8
-6
storage/innobase/page/page0zip.c
storage/innobase/page/page0zip.c
+111
-46
No files found.
storage/innobase/btr/btr0btr.c
View file @
07de38bf
...
...
@@ -1594,7 +1594,7 @@ btr_page_reorganize_low(
ut_ad
(
mtr_memo_contains
(
mtr
,
block
,
MTR_MEMO_PAGE_X_FIX
));
btr_assert_not_corrupted
(
block
,
index
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
data_size1
=
page_get_data_size
(
page
);
max_ins_size1
=
page_get_max_insert_size_after_reorganize
(
page
,
1
);
...
...
@@ -1713,7 +1713,7 @@ btr_page_reorganize_low(
func_exit:
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
#ifndef UNIV_HOTBACKUP
buf_block_free
(
temp_block
);
...
...
@@ -1788,7 +1788,7 @@ btr_page_empty(
ut_ad
(
mtr_memo_contains
(
mtr
,
block
,
MTR_MEMO_PAGE_X_FIX
));
ut_ad
(
page_zip
==
buf_block_get_page_zip
(
block
));
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
btr_search_drop_page_hash_index
(
block
);
...
...
@@ -1845,10 +1845,10 @@ btr_root_raise_and_insert(
root_block
=
btr_cur_get_block
(
cursor
);
root_page_zip
=
buf_block_get_page_zip
(
root_block
);
ut_ad
(
page_get_n_recs
(
root
)
>
0
);
index
=
btr_cur_get_index
(
cursor
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
root_page_zip
||
page_zip_validate
(
root_page_zip
,
root
));
ut_a
(
!
root_page_zip
||
page_zip_validate
(
root_page_zip
,
root
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
index
=
btr_cur_get_index
(
cursor
);
#ifdef UNIV_BTR_DEBUG
if
(
!
dict_index_is_ibuf
(
index
))
{
ulint
space
=
dict_index_get_space
(
index
);
...
...
@@ -2778,8 +2778,8 @@ insert_empty:
#ifdef UNIV_ZIP_DEBUG
if
(
UNIV_LIKELY_NULL
(
page_zip
))
{
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
new_page_zip
,
new_page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
cursor
->
index
));
ut_a
(
page_zip_validate
(
new_page_zip
,
new_page
,
cursor
->
index
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
@@ -2813,7 +2813,8 @@ insert_empty:
=
buf_block_get_page_zip
(
insert_block
);
ut_a
(
!
insert_page_zip
||
page_zip_validate
(
insert_page_zip
,
insert_page
));
||
page_zip_validate
(
insert_page_zip
,
insert_page
,
cursor
->
index
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
@@ -3178,7 +3179,7 @@ btr_lift_page_up(
btr_page_set_level
(
page
,
page_zip
,
page_level
,
mtr
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -3354,8 +3355,8 @@ err_exit:
const
page_zip_des_t
*
page_zip
=
buf_block_get_page_zip
(
block
);
ut_a
(
page_zip
);
ut_a
(
page_zip_validate
(
merge_page_zip
,
merge_page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
merge_page_zip
,
merge_page
,
index
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
@@ -3488,7 +3489,8 @@ err_exit:
ut_ad
(
page_validate
(
merge_page
,
index
));
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
merge_page_zip
||
page_zip_validate
(
merge_page_zip
,
merge_page
));
ut_a
(
!
merge_page_zip
||
page_zip_validate
(
merge_page_zip
,
merge_page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
/* Free the file page */
...
...
@@ -3671,7 +3673,7 @@ btr_discard_page(
page_zip_des_t
*
merge_page_zip
=
buf_block_get_page_zip
(
merge_block
);
ut_a
(
!
merge_page_zip
||
page_zip_validate
(
merge_page_zip
,
merge_page
));
||
page_zip_validate
(
merge_page_zip
,
merge_page
,
index
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
@@ -4149,7 +4151,7 @@ btr_validate_level(
ut_a
(
space
==
page_get_space_id
(
page
));
#ifdef UNIV_ZIP_DEBUG
page_zip
=
buf_block_get_page_zip
(
block
);
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
ut_a
(
!
page_is_leaf
(
page
));
...
...
@@ -4177,7 +4179,7 @@ loop:
#ifdef UNIV_ZIP_DEBUG
page_zip
=
buf_block_get_page_zip
(
block
);
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
/* Check ordering etc. of records */
...
...
storage/innobase/btr/btr0cur.c
View file @
07de38bf
...
...
@@ -673,7 +673,7 @@ retry_page_get:
#ifdef UNIV_ZIP_DEBUG
const
page_zip_des_t
*
page_zip
=
buf_block_get_page_zip
(
block
);
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
buf_block_dbg_add_level
(
...
...
@@ -2042,7 +2042,7 @@ any_extern:
page_zip
=
buf_block_get_page_zip
(
block
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
page_zip
...
...
@@ -2253,7 +2253,7 @@ btr_cur_pessimistic_update(
MTR_MEMO_X_LOCK
));
ut_ad
(
mtr_memo_contains
(
mtr
,
block
,
MTR_MEMO_PAGE_X_FIX
));
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
/* The insert buffer tree should never be updated in place. */
ut_ad
(
!
dict_index_is_ibuf
(
index
));
...
...
@@ -2391,7 +2391,7 @@ make_external:
btr_search_update_hash_on_delete
(
cursor
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
page_cursor
=
btr_cur_get_page_cur
(
cursor
);
...
...
@@ -2498,7 +2498,7 @@ make_external:
buf_block_t
*
rec_block
=
btr_cur_get_block
(
cursor
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
page
=
buf_block_get_frame
(
rec_block
);
#endif
/* UNIV_ZIP_DEBUG */
page_zip
=
buf_block_get_page_zip
(
rec_block
);
...
...
@@ -2524,7 +2524,7 @@ make_external:
return_after_reservations:
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
n_extents
>
0
)
{
...
...
@@ -2986,12 +2986,14 @@ btr_cur_optimistic_delete(
page
,
1
);
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
cursor
->
index
));
#endif
/* UNIV_ZIP_DEBUG */
page_cur_delete_rec
(
btr_cur_get_page_cur
(
cursor
),
cursor
->
index
,
offsets
,
mtr
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
cursor
->
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
dict_index_is_clust
(
cursor
->
index
)
...
...
@@ -3086,7 +3088,7 @@ btr_cur_pessimistic_delete(
rec
=
btr_cur_get_rec
(
cursor
);
page_zip
=
buf_block_get_page_zip
(
block
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
offsets
=
rec_get_offsets
(
rec
,
index
,
NULL
,
ULINT_UNDEFINED
,
&
heap
);
...
...
@@ -3096,7 +3098,7 @@ btr_cur_pessimistic_delete(
rec
,
offsets
,
page_zip
,
rb_ctx
,
mtr
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -3157,7 +3159,7 @@ btr_cur_pessimistic_delete(
page_cur_delete_rec
(
btr_cur_get_page_cur
(
cursor
),
index
,
offsets
,
mtr
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
ut_ad
(
btr_check_node_ptr
(
index
,
block
,
mtr
));
...
...
storage/innobase/buf/buf0lru.c
View file @
07de38bf
...
...
@@ -1998,7 +1998,9 @@ buf_LRU_block_remove_hashed_page(
break
;
case
FIL_PAGE_INDEX
:
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
&
bpage
->
zip
,
page
));
ut_a
(
page_zip_validate
(
&
bpage
->
zip
,
page
,
((
buf_block_t
*
)
bpage
)
->
index
));
#endif
/* UNIV_ZIP_DEBUG */
break
;
default:
...
...
storage/innobase/ibuf/ibuf0ibuf.c
View file @
07de38bf
...
...
@@ -4176,11 +4176,11 @@ ibuf_delete(
page
,
1
);
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
page_cur_delete_rec
(
&
page_cur
,
index
,
offsets
,
mtr
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
page_zip
)
{
...
...
storage/innobase/include/page0zip.h
View file @
07de38bf
...
...
@@ -156,9 +156,10 @@ page_zip_validate_low(
/*==================*/
const
page_zip_des_t
*
page_zip
,
/*!< in: compressed page */
const
page_t
*
page
,
/*!< in: uncompressed page */
const
dict_index_t
*
index
,
/*!< in: index of the page, if known */
ibool
sloppy
)
/*!< in: FALSE=strict,
TRUE=ignore the MIN_REC_FLAG */
__attribute__
((
nonnull
));
__attribute__
((
nonnull
(
1
,
2
)
));
/**********************************************************************//**
Check that the compressed and decompressed pages match. */
UNIV_INTERN
...
...
@@ -166,8 +167,9 @@ ibool
page_zip_validate
(
/*==============*/
const
page_zip_des_t
*
page_zip
,
/*!< in: compressed page */
const
page_t
*
page
)
/*!< in: uncompressed page */
__attribute__
((
nonnull
));
const
page_t
*
page
,
/*!< in: uncompressed page */
const
dict_index_t
*
index
)
/*!< in: index of the page, if known */
__attribute__
((
nonnull
(
1
,
2
)));
#endif
/* UNIV_ZIP_DEBUG */
/**********************************************************************//**
...
...
storage/innobase/log/log0recv.c
View file @
07de38bf
...
...
@@ -1636,9 +1636,8 @@ recv_recover_page_func(
if
(
fil_page_get_type
(
page
)
==
FIL_PAGE_INDEX
)
{
page_zip_des_t
*
page_zip
=
buf_block_get_page_zip
(
block
);
if
(
page_zip
)
{
ut_a
(
page_zip_validate_low
(
page_zip
,
page
,
FALSE
));
}
ut_a
(
!
page_zip
||
page_zip_validate_low
(
page_zip
,
page
,
NULL
,
FALSE
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
storage/innobase/page/page0cur.c
View file @
07de38bf
...
...
@@ -310,7 +310,7 @@ page_cur_search_with_match(
#endif
/* UNIV_DEBUG */
page
=
buf_block_get_frame
(
block
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
page_check_dir
(
page
);
...
...
@@ -1248,7 +1248,7 @@ page_cur_insert_rec_zip(
ut_ad
(
!
page_rec_is_supremum
(
*
current_rec
));
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
/* 1. Get the size of the physical record in the page */
...
...
@@ -1973,7 +1973,7 @@ page_cur_delete_rec(
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
storage/innobase/page/page0page.c
View file @
07de38bf
...
...
@@ -626,7 +626,7 @@ page_copy_rec_list_end(
Furthermore, btr_compress() may set FIL_PAGE_PREV to
FIL_NULL on new_page while leaving it intact on
new_page_zip. So, we cannot validate new_page_zip. */
ut_a
(
page_zip_validate_low
(
page_zip
,
page
,
TRUE
));
ut_a
(
page_zip_validate_low
(
page_zip
,
page
,
index
,
TRUE
));
}
#endif
/* UNIV_ZIP_DEBUG */
ut_ad
(
buf_block_get_frame
(
block
)
==
page
);
...
...
@@ -946,7 +946,7 @@ page_delete_rec_list_end(
ut_ad
(
size
==
ULINT_UNDEFINED
||
size
<
UNIV_PAGE_SIZE
);
ut_ad
(
!
page_zip
||
page_rec_is_comp
(
rec
));
#ifdef UNIV_ZIP_DEBUG
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
page_rec_is_infimum
(
rec
))
{
...
...
@@ -988,7 +988,7 @@ page_delete_rec_list_end(
ULINT_UNDEFINED
,
&
heap
);
rec
=
rec_get_next_ptr
(
rec
,
TRUE
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
page_cur_delete_rec
(
&
cur
,
index
,
offsets
,
mtr
);
}
while
(
page_offset
(
rec
)
!=
PAGE_NEW_SUPREMUM
);
...
...
@@ -1128,7 +1128,8 @@ page_delete_rec_list_start(
between btr_attach_half_pages() and insert_page = ...
when btr_page_get_split_rec_to_left() holds
(direction == FSP_DOWN). */
ut_a
(
!
page_zip
||
page_zip_validate_low
(
page_zip
,
page
,
TRUE
));
ut_a
(
!
page_zip
||
page_zip_validate_low
(
page_zip
,
page
,
index
,
TRUE
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
@@ -1199,9 +1200,10 @@ page_move_rec_list_end(
=
buf_block_get_page_zip
(
block
);
ut_a
(
!
new_page_zip
==
!
page_zip
);
ut_a
(
!
new_page_zip
||
page_zip_validate
(
new_page_zip
,
new_page
));
||
page_zip_validate
(
new_page_zip
,
new_page
,
index
));
ut_a
(
!
page_zip
||
page_zip_validate
(
page_zip
,
page_align
(
split_rec
)));
||
page_zip_validate
(
page_zip
,
page_align
(
split_rec
),
index
));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
storage/innobase/page/page0zip.c
View file @
07de38bf
...
...
@@ -1433,7 +1433,7 @@ err_exit:
page_zip_get_size
(
page_zip
)
-
PAGE_DATA
);
mem_heap_free
(
heap
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
mtr
)
{
...
...
@@ -3119,6 +3119,7 @@ page_zip_validate_low(
/*==================*/
const
page_zip_des_t
*
page_zip
,
/*!< in: compressed page */
const
page_t
*
page
,
/*!< in: uncompressed page */
const
dict_index_t
*
index
,
/*!< in: index of the page, if known */
ibool
sloppy
)
/*!< in: FALSE=strict,
TRUE=ignore the MIN_REC_FLAG */
{
...
...
@@ -3206,39 +3207,102 @@ page_zip_validate_low(
committed. Let us tolerate that difference when we
are performing a sloppy validation. */
if
(
sloppy
)
{
byte
info_bits_diff
;
ulint
offset
=
rec_get_next_offs
(
page
+
PAGE_NEW_INFIMUM
,
TRUE
);
ut_a
(
offset
>=
PAGE_NEW_SUPREMUM
);
offset
-=
5
/* REC_NEW_INFO_BITS */
;
info_bits_diff
=
page
[
offset
]
^
temp_page
[
offset
];
if
(
info_bits_diff
==
REC_INFO_MIN_REC_FLAG
)
{
temp_page
[
offset
]
=
page
[
offset
];
if
(
!
memcmp
(
page
+
PAGE_HEADER
,
temp_page
+
PAGE_HEADER
,
UNIV_PAGE_SIZE
-
PAGE_HEADER
-
FIL_PAGE_DATA_END
))
{
/* Only the minimum record flag
differed. Let us ignore it. */
page_zip_fail
((
"page_zip_validate: "
"min_rec_flag "
"(ignored, "
"%lu,%lu,0x%02lx)
\n
"
,
page_get_space_id
(
page
),
page_get_page_no
(
page
),
(
ulong
)
page
[
offset
]));
goto
func_exit
;
ulint
*
offsets
;
mem_heap_t
*
heap
;
const
rec_t
*
rec
;
const
rec_t
*
trec
;
byte
info_bits_diff
;
ulint
offset
=
rec_get_next_offs
(
page
+
PAGE_NEW_INFIMUM
,
TRUE
);
ut_a
(
offset
>=
PAGE_NEW_SUPREMUM
);
offset
-=
5
/*REC_NEW_INFO_BITS*/
;
info_bits_diff
=
page
[
offset
]
^
temp_page
[
offset
];
if
(
info_bits_diff
==
REC_INFO_MIN_REC_FLAG
)
{
temp_page
[
offset
]
=
page
[
offset
];
if
(
!
memcmp
(
page
+
PAGE_HEADER
,
temp_page
+
PAGE_HEADER
,
UNIV_PAGE_SIZE
-
PAGE_HEADER
-
FIL_PAGE_DATA_END
))
{
/* Only the minimum record flag
differed. Let us ignore it. */
page_zip_fail
((
"page_zip_validate: "
"min_rec_flag "
"(%s"
"%lu,%lu,0x%02lx)
\n
"
,
sloppy
?
"ignored, "
:
""
,
page_get_space_id
(
page
),
page_get_page_no
(
page
),
(
ulong
)
page
[
offset
]));
valid
=
sloppy
;
goto
func_exit
;
}
}
/* Compare the pointers in the PAGE_FREE list. */
rec
=
page_header_get_ptr
(
page
,
PAGE_FREE
);
trec
=
page_header_get_ptr
(
temp_page
,
PAGE_FREE
);
while
(
rec
||
trec
)
{
if
(
page_offset
(
rec
)
!=
page_offset
(
trec
))
{
page_zip_fail
((
"page_zip_validate: "
"PAGE_FREE list: %u!=%u
\n
"
,
(
unsigned
)
page_offset
(
rec
),
(
unsigned
)
page_offset
(
trec
)));
valid
=
FALSE
;
goto
func_exit
;
}
rec
=
page_rec_get_next_low
(
rec
,
TRUE
);
trec
=
page_rec_get_next_low
(
trec
,
TRUE
);
}
/* Compare the records. */
heap
=
NULL
;
offsets
=
NULL
;
rec
=
page_rec_get_next_low
(
page
+
PAGE_NEW_INFIMUM
,
TRUE
);
trec
=
page_rec_get_next_low
(
temp_page
+
PAGE_NEW_INFIMUM
,
TRUE
);
do
{
if
(
page_offset
(
rec
)
!=
page_offset
(
trec
))
{
page_zip_fail
((
"page_zip_validate: "
"record list: 0x%02x!=0x%02x
\n
"
,
(
unsigned
)
page_offset
(
rec
),
(
unsigned
)
page_offset
(
trec
)));
valid
=
FALSE
;
break
;
}
if
(
index
)
{
/* Compare the data. */
offsets
=
rec_get_offsets
(
rec
,
index
,
offsets
,
ULINT_UNDEFINED
,
&
heap
);
if
(
memcmp
(
rec
-
rec_offs_extra_size
(
offsets
),
trec
-
rec_offs_extra_size
(
offsets
),
rec_offs_size
(
offsets
)))
{
page_zip_fail
(
(
"page_zip_validate: "
"record content: 0x%02x"
,
(
unsigned
)
page_offset
(
rec
)));
valid
=
FALSE
;
break
;
}
}
rec
=
page_rec_get_next_low
(
rec
,
TRUE
);
trec
=
page_rec_get_next_low
(
trec
,
TRUE
);
}
while
(
rec
||
trec
);
if
(
heap
)
{
mem_heap_free
(
heap
);
}
page_zip_fail
((
"page_zip_validate: content
\n
"
));
valid
=
FALSE
;
}
func_exit:
...
...
@@ -3260,9 +3324,10 @@ ibool
page_zip_validate
(
/*==============*/
const
page_zip_des_t
*
page_zip
,
/*!< in: compressed page */
const
page_t
*
page
)
/*!< in: uncompressed page */
const
page_t
*
page
,
/*!< in: uncompressed page */
const
dict_index_t
*
index
)
/*!< in: index of the page, if known */
{
return
(
page_zip_validate_low
(
page_zip
,
page
,
return
(
page_zip_validate_low
(
page_zip
,
page
,
index
,
recv_recovery_is_on
()));
}
#endif
/* UNIV_ZIP_DEBUG */
...
...
@@ -3593,7 +3658,7 @@ page_zip_write_rec(
page_zip
->
m_nonempty
=
TRUE
;
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page_align
(
rec
)));
ut_a
(
page_zip_validate
(
page_zip
,
page_align
(
rec
)
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -3640,7 +3705,7 @@ corrupt:
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
memcpy
(
page
+
offset
,
...
...
@@ -3649,7 +3714,7 @@ corrupt:
ptr
+
4
,
BTR_EXTERN_FIELD_REF_SIZE
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -3716,7 +3781,7 @@ page_zip_write_blob_ptr(
memcpy
(
externs
,
field
,
BTR_EXTERN_FIELD_REF_SIZE
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
if
(
mtr
)
{
...
...
@@ -3787,7 +3852,7 @@ corrupt:
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
field
=
page
+
offset
;
...
...
@@ -3808,7 +3873,7 @@ corrupt:
memcpy
(
storage
,
ptr
+
4
,
REC_NODE_PTR_SIZE
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -4035,7 +4100,7 @@ page_zip_clear_rec(
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -4059,7 +4124,7 @@ page_zip_rec_set_deleted(
*
slot
&=
~
(
PAGE_ZIP_DIR_SLOT_DEL
>>
8
);
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page_align
(
rec
)));
ut_a
(
page_zip_validate
(
page_zip
,
page_align
(
rec
)
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -4360,14 +4425,14 @@ corrupt:
goto
corrupt
;
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
memcpy
(
page
+
offset
,
ptr
,
len
);
memcpy
(
page_zip
->
data
+
offset
,
ptr
,
len
);
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
NULL
));
#endif
/* UNIV_ZIP_DEBUG */
}
...
...
@@ -4445,7 +4510,7 @@ page_zip_reorganize(
ut_ad
(
mtr_memo_contains
(
mtr
,
block
,
MTR_MEMO_PAGE_X_FIX
));
ut_ad
(
page_is_comp
(
page
));
ut_ad
(
!
dict_index_is_ibuf
(
index
));
/* Note that page_zip_validate(page_zip, page) may fail here. */
/* Note that page_zip_validate(page_zip, page
, index
) may fail here. */
UNIV_MEM_ASSERT_RW
(
page
,
UNIV_PAGE_SIZE
);
UNIV_MEM_ASSERT_RW
(
page_zip
->
data
,
page_zip_get_size
(
page_zip
));
...
...
@@ -4532,7 +4597,7 @@ page_zip_copy_recs(
FIL_PAGE_PREV or PAGE_LEVEL, causing a temporary min_rec_flag
mismatch. A strict page_zip_validate() will be executed later
during the B-tree operations. */
ut_a
(
page_zip_validate_low
(
src_zip
,
src
,
TRUE
));
ut_a
(
page_zip_validate_low
(
src_zip
,
src
,
index
,
TRUE
));
#endif
/* UNIV_ZIP_DEBUG */
ut_a
(
page_zip_get_size
(
page_zip
)
==
page_zip_get_size
(
src_zip
));
if
(
UNIV_UNLIKELY
(
src_zip
->
n_blobs
))
{
...
...
@@ -4593,7 +4658,7 @@ page_zip_copy_recs(
}
#ifdef UNIV_ZIP_DEBUG
ut_a
(
page_zip_validate
(
page_zip
,
page
));
ut_a
(
page_zip_validate
(
page_zip
,
page
,
index
));
#endif
/* UNIV_ZIP_DEBUG */
btr_blob_dbg_add
(
page
,
index
,
"page_zip_copy_recs"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment