Commit graph

293 commits

Author SHA1 Message Date
marko
f4f5606fb6 branches/zip: Merge revisions 634:713 from trunk. 2006-08-11 11:49:38 +00:00
marko
a150cf7ef1 branches/zip: page_copy_rec_list_start(): Replace the local variable
"old_end" with "ret".  Otherwise, a page_zip_reorganize() would make
lock_move_rec_list_start() fail.
2006-08-10 11:14:00 +00:00
marko
7255b3fdc5 branches/zip: page_zip_decompress_low(): Clear the node_ptr during
initial decompression, in case the record will be deleted and the
space will be reused by a smaller record.

page_zip_clear_rec_disable: Note the possibility of a page_zip_validate()
failure when the space of a deleted record is reused by a smaller record.
2006-08-09 11:17:59 +00:00
marko
e148206ae2 branches/zip: Improve diagnostics.
buf_LRU_get_free_block(): When zip_size changes, initialize all fields
of page_zip.  This avoids an assertion failure in page_create_zip() when
a block with an originally larger zip_size is reallocated.

fsp_get_space_header(): Assert that the stored space id matches.

xdes_get_state(): Assert that the state is valid.
2006-08-09 08:55:00 +00:00
marko
8dd095e7bb branches/zip: recv_parse_or_apply_log_rec_body(): Note that
MLOG_COMP_REC_MIN_MARK is allowed on a compressed page.
2006-08-07 11:35:03 +00:00
marko
00ddce117d branches/zip: Minor cleanup.
row_upd_sec_index_entry(): Remove redundant goto.  Replace duplicated
cleanup code with goto func_exit.

mtr_memo_slot_release(): Eliminate the #else branch of #ifdef UNIV_DEBUG
by reorganizing the code.
2006-08-07 08:12:39 +00:00
marko
09e017ca70 branches/zip: btr_cur_search_to_nth_level(): Do not invoke page_zip_validate()
if rw_latch == RW_NO_LATCH.
2006-08-07 08:07:47 +00:00
marko
d97b448b22 branches/zip: dict_check_tablespaces_and_store_max_id():
Determine zip_size in kilobytes, pass on in bytes.
2006-08-04 12:35:43 +00:00
marko
bbcdac2c13 branches/zip: Fix the decompression of deleted records containing externally
stored columns.

page_zip_decompress(): We indeed need to clear the BLOB pointers of deleted
records twice.  This implies that we also need to invoke rec_get_offsets()
twice for each record on a leaf page.  Add clarifying comments.

page_zip_clear_rec(): Add the flag page_zip_clear_rec_disable for
disabling the clearing of deleted records.
2006-08-04 11:46:20 +00:00
marko
8ebc271948 branches/zip: Minor cleanup after r690. One test case still fails.
page_zip_compress_write_log(): Do not invoke page_zip_validate(), since
this is a static function and the callers already invoke page_zip_validate().

page_zip_decompress_low(): Clear the page #ifdef UNIV_ZIP_DEBUG.
Optimizations: Remove local variable "last".  Do not clear the BLOB
pointer until the modification log has been applied.  (Since r690,
it will be cleared after applying the modification log.)
Avoid calling rec_get_offsets() a second time if there are no
uncompressed columns to be restored.
2006-08-04 08:25:39 +00:00
marko
b152ee5655 branches/zip: Zero out the BLOB pointers when decoding deleted records.
Improve diagnostics.

btr_cur_pessimistic_update(): Add page_zip_validate() assertion.

page_zip_decompress(): Initialize all BLOB pointers.

page_zip_clear_rec(): Add page_zip_header_cmp() assertion.

page_delete_rec_list_end(): Add page_zip_validate() assertion.
2006-08-03 08:06:45 +00:00
marko
b355bd0fbc branches/zip: Fix some crash recovery bugs.
dict_load_table(): Initialize table->flags with zip_size.

mlog_parse_nbytes(), mlog_parse_string(): Add parameter page_zip and
write the changes also to the compressed page if one is specified.
Assert that these functions are not called on FIL_PAGE_INDEX pages.

buf_page_io_complete(): Replace block->frame with frame where appropriate.

recv_parse_or_apply_log_rec_body(): Add ut_a(!page_zip) where appropriate.

page_parse_delete_rec_list(): Add parameter page_zip.
2006-08-02 05:49:15 +00:00
marko
fbce3ef82e branches/zip: buf_flush_init_for_writing(): Invoke page_zip_calc_checksum()
on page_zip->data, so that the freshly written fields will be included.

page_cur_delete_rec(): Add a page_zip_validate() assertion to the end.
2006-08-01 12:05:04 +00:00
marko
b6b5f3bb12 branches/zip: Properly merge records to compressed pages. 2006-08-01 10:11:04 +00:00
marko
81f7884d52 branches/zip: Improve debugging.
page_zip_decompress(): Move the function body to page_zip_decompress_low(),
add the parameter do_validate() to enable page_validate() assertion.  Wrap
page_zip_decompress_low() with do_validate=TRUE.

page_zip_validate(): Invoke page_zip_decompress_low() with do_validate=FALSE,
as page_validate() may fail when the compressed page is being updated
in-place.

page_dir_slot_check(): Replace buf_frame_align() with ut_align_down()
in order to avoid an assertion failure in page_zip_validate(), which
will now invoke page_validate() via page_zip_decompress().
2006-08-01 08:53:55 +00:00
marko
a9792eeb08 branches/zip: Bug fixes.
buf_page_io_complete(): On FIL_PAGE_TYPE_ZBLOB (compressed BLOB pages),
read the space_id from a different location.

page_zip_compress(), page_zip_write_rec(), page_zip_write_blob_ptr():
Replace page_simple_validate_new() with page_validate().

page_zip_clear_rec(): When running out of log space, do not attempt to
recompress the page, because the directory slots might be unbalanced and
the page_validate() assertion in page_zip_compress() would fail.
Instead, clear the BLOB pointers of the deleted record on the
uncompressed page, so that page_zip_validate() will succeed.

page_zip_validate(): Remove the comment about page_zip_clear_rec().
A mismatch always indicates a serious inconsistency.
2006-08-01 07:58:38 +00:00
marko
6e2fa8bc85 branches/zip: Stamp some header fields to compressed BLOB pages.
buf_flush_init_for_writing(): On FIL_PAGE_TYPE_ZBLOB, write to
page_zip->data instead of page.

page_zip_write_rec(), page_zip_write_blob_ptr(), page_zip_write_node_ptr():
Add ut_ad(page_simple_validate_new()).
2006-07-31 18:27:17 +00:00
marko
011035566a branches/zip: Fix a bug in consistent reads of rows containing BLOB data.
btr_rec_copy_externally_stored_field(): Add parameter zip_size.
Do not call buf_block_align(rec), because rec can also be in
dynamically allocated memory.  buf_block_align() can only be invoked
on addresses inside the buffer pool.

page_zip_clear_rec(): Improve formatting.
2006-07-31 06:43:25 +00:00
marko
a2121234a7 branches/zip: page_zip_validate(): Replace buf_frame_alloc() with
ut_malloc() to avoid breaking the latching order.

page_rec_check(), page_dir_slot_get_rec(): Replace buf_frame_align()
with ut_align_down() to avoid assertion failures in page_zip_validate().
2006-07-28 07:34:33 +00:00
marko
a201d0c159 branches/zip: btr_store_big_rec_extern_fields(),
btr_free_externally_stored_field(): Replace mlog_write_ulint()
with mach_write_to_4() when page_zip != NULL.  The operation is
logged by page_zip_write_blob_ptr().
2006-07-27 12:32:12 +00:00
marko
12ccbd8ae0 branches/zip: Remove a bogus page_zip_validate() assertion failure found
by running index_merge_ror_cpk on 1-kilobyte compressed pages.

page_delete_rec_list_start(): Remove the page_zip_validate() assertion.

btr_page_split_and_insert(): Add page_zip_validate() assertions about
page and new_page after moving the records.
2006-07-07 10:42:41 +00:00
marko
143aa19a1b branches/zip: dict_build_table_def_step(): Refuse to create a compressed
table in the system tablespace.
2006-07-06 19:24:53 +00:00
marko
6c7431b2f7 branches/zip: page_zip_fields_encode(): Fuse fixed-length fields to a maximum
of DICT_MAX_INDEX_COL_LEN (768 bytes).
2006-07-06 11:40:28 +00:00
marko
d234ea1ea5 branches/zip: page_zip_fields_encode(): Assign to trx_id_col after
encoding any pending data.
2006-07-06 10:39:09 +00:00
marko
86ec3c6053 branches/zip: page_zip_fields_encode(): Do not increment "col" without
encoding a column.
2006-07-06 08:31:26 +00:00
marko
508c578ce4 mlog_parse_index(): Remove an off-by-one error in the bounds check that
would cause the crash recovery of MLOG_COMP_PAGE_REORGANIZE to fail.
(Bug #20855)
2006-07-04 21:34:25 +00:00
marko
3e670d86c7 branches/zip: btr_parse_page_reorganize(): Add parameter page_zip. 2006-07-04 21:15:30 +00:00
marko
8460bf3fab branches/zip: Eliminate some duplicated code to release btr_search_latch
that was found while investigating Bug #19081.
2006-07-04 11:55:26 +00:00
marko
2a8f49bf68 branches/zip: page_cur_insert_rec_low(): Replace page_zip_alloc()
with page_zip_available() in order to avoid an extra page_zip_compress().

page_zip_available(): Make the function public.

page0zip.ic: Sort the inline function declarations in order to avoid
forward references, which do not work on some compilers.
2006-07-03 19:12:21 +00:00
marko
03760f4c2a branches/zip: page_zip_dir_size(): Remove bogus debug assertion.
The function will be invoked in page_zip_decompress() before setting
page_zip->m_start or page_zip->m_end.
2006-06-30 11:59:28 +00:00
marko
cafaf715b7 branches/zip: Improve assertions related to the linked lists of records
on B-tree index pages.

page_rec_set_next(): Assert that rec != next.

rec_get_next_ptr(), rec_get_next_offs(): On compact pages, assert that
there are at least REC_N_NEW_EXTRA_BYTES + 1 between records.

page_cur_insert_rec_write_log(): Replace a buf_frame_align() call
with ut_align_offset().

page_cur_insert_rec_low(): Assert that current_rec != insert_rec.
2006-06-30 09:49:32 +00:00
marko
6b077aa8e3 branches/zip: Eliminate page corruption in btr_compress() when
page_zip_reorganize() was invoked.

btr_compress(): Obtain orig_pred and orig_succ after copying the records.
Add a debug assertion about FIL_PAGE_PREV.

page_copy_rec_list_end(), page_copy_rec_list_start(): Change the return
type from ibool to rec_t.  Adjust the return value after invoking
page_zip_reorganize().
2006-06-28 12:01:29 +00:00
marko
0c0e7b92d8 branches/zip: buf_page_io_complete(): Copy also uninitialized pages to
uncompressed storage, to avoid bogus warnings about page number mismatch.
2006-06-21 12:38:42 +00:00
marko
fe5213b39e branches/zip: Tighten the assertions about page_zip->m_end. 2006-06-21 11:24:47 +00:00
marko
0a5b956f9d branches/zip: fsp_fill_free_list(): Replace % with ut_2pow_remainder(). 2006-06-21 11:14:11 +00:00
marko
3055b6b9aa branches/zip: Add debug assertions about page_zip->m_end < paeg_zip->m_size. 2006-06-21 09:15:09 +00:00
marko
44175381a5 branches/zip: Make page_zip_validate() independent of UNIV_DEBUG.
Replace most occurrences of #if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
with #ifdef UNIV_ZIP_DEBUG.
2006-06-20 19:35:59 +00:00
marko
4b00336eba branches/zip: fil_space_truncate_start(): Fix an incorrect assertion,
disable unless #ifdef UNIV_LOG_ARCHIVE.
2006-06-20 11:35:41 +00:00
marko
83a96d3453 branches/zip: fsp_fill_free_list(): Compute "init_xdes" properly. 2006-06-20 11:32:26 +00:00
marko
b43effdd9c branches/zip: Add assertions.
btr_compress(): Invoke page_zip_validate() on the page being compressed.

recv_parse_or_apply_log_rec_body(): Assert that MLOG_WRITE_STRING is
never used on compressed B-tree pages.
2006-06-19 11:08:46 +00:00
marko
b857a02b7d branches/zip: page_zip_reorganize(): On success, write to the redo log. 2006-06-19 11:07:21 +00:00
marko
97c781308a branches/zip: Add parameter zip_size to fil_io().
fil_read(), fil_write(): Make these inlined functions in fil0fil.c.

fil_write_lsn_and_arch_no_to_file(): Remove the parameter space_id and
note that this function is to be called on the system tablespace, which
is uncompressed.
2006-06-15 07:27:13 +00:00
marko
11fefe4d56 branches/zip: Improve some assertions.
recv_parse_or_apply_log_rec_body(): Assert that mlog_parse_nbytes() is
never called on compressed B-tree pages.

page_zip_simple_validate(): Correct a typo in a debug assertion.

xdes_calc_descriptor_page(): Fix an incorrect debug assertion.
2006-06-14 11:19:08 +00:00
marko
4fe0b06613 branches/zip: page_zip_validate(): First compare the page headers
and obey the added flag page_zip_validate_header_only.
2006-06-14 08:15:44 +00:00
marko
1f2483ee1d branches/zip: buf_flush_init_for_writing(): Determine zip_size from
page_zip instead of calling fil_space_get_zip_size().  In
fil_create_new_single_table_tablespace(), the table space has not yet
been created.  Handle also FIL_PAGE_TYPE_ALLOCATED.
2006-06-14 07:47:32 +00:00
marko
137cf961e4 branches/zip: Fix some bugs in the crash recovery of compressed tablespaces.
fil_node_open_file(): Set node->size correctly for compressed tablespaces.

fsp_header_write_space_id(): Rename to fsp_header_write_fields(),
add parameter zip_size.

fil_io(): Add UNIV_UNLIKELY hints to assertion-like tests.
2006-06-14 06:29:41 +00:00
marko
7f8cb7aab9 branches/zip: Merge revisions 583:634 from trunk. 2006-06-13 20:23:26 +00:00
marko
af445f4b77 branches/zip: fsp_try_extend_data_file(): Extend the data file by
one megabyte at a time, no matter what the compressed page size is.
2006-06-13 19:27:40 +00:00
marko
2117ec5a96 branches/zip: Add page_zip_validate() assertions and remove a bogus
page_zip_assertion() failure in page_copy_rec_list_end().

btr_root_raise_and_insert(), btr_lift_page_up(), btr_compress():
Add page_zip_validate() assertions.

btr_compress(): Only copy FIL_PAGE_PREV when UNIV_BTR_DEBUG is defined.

page_cur_delete_rec(): Document why the page_zip_validate() assertion
was removed.

page_copy_rec_list_end(): Remove the page_zip_validate() assertion and
document why.

page_move_rec_list_end(): Add page_zip_validate() assertion.
2006-06-13 08:24:26 +00:00
marko
8f6de3bba2 branches/zip: Add page_zip_validate() checks.
page_cur_delete_rec(): Do not call page_zip_validate() in the beginning,
because btr_set_min_rec_mark() in btr_cur_pessimistic_delete() will
cause a temporary mismatch.

Document temporary mismatches caused by btr_set_min_rec_mark() calls
and explain why they will not cause any problems.
2006-06-12 12:37:54 +00:00