Commit graph

230 commits

Author SHA1 Message Date
marko
9b59bd8575 branches/zip: Fix bugs #ifdef UNIV_DEBUG.
rec_convert_dtuple_to_rec_old(): Initialize the record in order to avoid
bogus Valgrind warnings about the ut_ad() in mach_write_to_1() and
mach_write_to_2().

page_zip_compress(), page_zip_write_rec(), page_zip_write_blob_ptr():
Replace ut_ad(page_validate(...)) with ut_ad(page_simple_validate_new(...)),
because otherwise crash recovery would fail.
2006-09-20 12:23:25 +00:00
marko
3b14ab95d3 branches/zip: fil_create_new_single_table_tablespace():
Make page_zip->data point to an address different from page,
to avoid calling memcpy() with overlapping source and destination.
2006-09-20 11:14:54 +00:00
marko
7f057a4b18 branches/zip: mlog_parse_index(): After merge fix (r841):
Identify DB_TRX_ID and DB_ROLL_PTR in the index.
2006-09-20 05:05:58 +00:00
marko
a1bca48c85 branches/zip: Remove page_zip_decompress_low(). Do not call page_validate()
on the ZIP_DUMMY index.  Because it does not contain valid collation
information, the ordering check in page_validate() may fail on pages
containing non-binary data.

Instead, let the callers of page_zip_decompress() invoke page_validate()
when the index information is available.
2006-09-19 13:56:56 +00:00
marko
9a16aac783 branches/zip: Merge revisions 804:838 from trunk. 2006-09-19 10:14:07 +00:00
marko
e4dc19ba38 branches/zip: Merge revisions 789:804 from trunk. 2006-09-12 07:29:57 +00:00
marko
425bcadf3c branches/zip: btr_store_big_rec_extern_fields(): When adjusting the
"next BLOB page" pointer, write it also to the compressed page,
which is the one that will be flushed to disk.
2006-09-06 14:17:20 +00:00
marko
49a0fbd018 branches/zip: btr_copy_externally_stored_field(): Add diagnostics for
unexpected end of compressed BLOB.
2006-09-06 09:51:00 +00:00
marko
eb4e17a4a6 branches/zip: btr_copy_externally_stored_field(): Correct the
reporting and handling of inflate() errors.
2006-09-05 19:41:05 +00:00
marko
de5b892a99 branches/zip: Split lines before operators, not after them. 2006-09-05 19:37:43 +00:00
marko
d92cdad1fa branches/zip: btr_cur_optimistic_insert(): When returning DB_FAIL,
always convert back big_rec_vec.
2006-09-05 12:49:35 +00:00
marko
78d1dd326c branches/zip: Merge revisions 767:789 from trunk. 2006-09-04 19:47:47 +00:00
marko
587dea824c branches/zip: btr_cur_optimistic_insert(): Add a closing parenthesis that
was accidentally omitted in r766.
2006-09-04 19:06:58 +00:00
marko
6429e2e682 branches/zip: dtuple_convert_big_rec(): Shorten the locally stored part
of externally stored columns to 108 bytes when possible.

This will unmask a bug in the handling of BLOBs on compressed tablespaces,
especially of small page sizes.  Apparently, the locally stored part must
be less than 235 bytes in size for the bug to occur.

dict_col_struct: Add field min_prefix.

dict_index_build_internal_non_clust(): Adjust min_prefix.
2006-08-31 11:00:02 +00:00
marko
08b58a7c01 branches/zip: Avoid overwriting an existing big_rec when calling
dtuple_convert_big_rec().  This should never happen, though.
2006-08-31 10:53:00 +00:00
marko
6c932eefb7 branches/zip: Merge revisions 765:767 from trunk. 2006-08-29 12:17:50 +00:00
marko
64f3cee67f branches/zip: Merge revisions 720:765 from trunk and reindent the code
as per revisions r763:765.
2006-08-29 09:30:31 +00:00
marko
fa451ede6e branches/zip: page_zip_dir_insert(): When looking for slot_rec, use the
old value of PAGE_N_RECS.

page_zip_dir_find_free_low(): Rename to page_zip_dir_find_low().

page_zip_dir_find(): Make use of page_zip_dir_find_low().
2006-08-22 08:34:14 +00:00
marko
cd3956a584 branches/zip: Speed up the compression and decompression of leaf pages
of non-clustered indexes.  On these pages, only the bytes rec[-5..-1]
will be omitted from the compressed data stream.  Save time by not looking
for trx_id or externally stored columns.
2006-08-21 18:36:00 +00:00
marko
20de0a2ad7 branches/zip: Assert that only leaf pages of clustered indexes may contain
externally stored columns.  Make some use of the fact in compression and
decompression.

rec_init_offsets(): Add ut_ad(dict_index_is_clust(index)) before flagging
external columns.

page_zip_get_trailer_len(): Assert ut_ad(!page_zip->n_blobs) unless
dict_index_is_clust(index).

page_zip_get_n_prev_extern(): Add ut_ad(dict_index_is_clust(index)).

page_zip_compress(), page_zip_decompress_low(): Add dict_index_is_clust()
assertions.  Allow completely external storage of columns.  Simplify
the computation of "externs".

page_zip_write_rec(): Store leaf node records of non-clustered indexes
with one memcpy(), avoiding rec_offs_n_extern() and the for loop.

page_zip_write_blob_ptr(): Add ut_ad(dict_index_is_clust(index)).
Simplify the computation of "externs".

page_zip_clear_rec(): Only attempt to zero out BLOB pointers when
the record belongs to a leaf page of a clustered index.

page_zip_dir_delete(): Take a fast path when the record is
not on a leaf page of a clustered index.
Simplify the computation of "externs".

page_zip_copy(): Assert that n_blobs is zero on anything else than
leaf pages of clustered indexes.
2006-08-21 10:27:15 +00:00
marko
63879526d8 branches/zip: page_zip_fields_decode(): Set index->type to DICT_CLUSTERED
if and only if the records on the page contain a trx_id column.
(Dummy indexes of non-leaf pages will always show up as non-clustered.)
2006-08-21 09:30:48 +00:00
marko
98b296946f branches/zip: page_zip_dir_insert(): Remove unused parameters index, offsets. 2006-08-21 09:27:44 +00:00
marko
3ce5d06e66 branches/zip: page_zip_decompress(): Initialize page_zip->n_blobs before
referencing it, to prevent a ut_ad() assertion on page_zip_get_trailer_len()
from failing.  Promote that assertion to ut_a().
2006-08-21 09:08:47 +00:00
marko
7291e6579e branches/zip: dtuple_convert_big_rec(): Do not attempt to shorten records
of secondary indexes.  (This is just an optimization; the logic in the
search loop would never store such records externally.)
2006-08-21 08:41:05 +00:00
marko
2c3b9102f8 branches/zip: page_cur_insert_rec_low(): Replace page_zip_dir_rewrite()
with page_zip_dir_insert().  Pass page_zip to rec_set_n_owned_new()
and page_dir_slot_set_n_owned().

page_zip_dir_insert(): New function.  Shift the dense page directory and
write the inserted record there.
2006-08-18 19:30:55 +00:00
marko
49c9bbd81e branches/zip: Bug fixes.
data0data.c: Add #include "page0zip.h" that was forgotten from r739.

page_cur_insert_rec_low(): Remove a memory leak when preventing
extra_size to grow.
2006-08-18 14:34:30 +00:00
marko
0ebbc851b1 branches/zip: Correct the description of DB_TOO_BIG_RECORD. 2006-08-18 10:02:50 +00:00
marko
ea4572cecf branches/zip: btr_cur_pessimistic_insert(): Prior to splitting, ensure that
the record will fit on an empty compressed page.

buf_block_alloc(), buf_block_free(), buf_frame_alloc(), buf_frame_free():
Make inlined.
2006-08-17 11:57:51 +00:00
marko
11a8b1e153 branches/zip: btr_page_get_sure_split_rec(): Align the variable declarations
according to InnoDB formatting rules.
2006-08-17 08:28:05 +00:00
marko
ae8901c8c9 branches/zip: Account for the compressed page size when checking if a
record will fit or need external storage.

btr_page_get_sure_split_rec(): Estimate the free space of an empty
compressed page.

page_zip_rec_needs_ext(): New function, to replace existing tests whether
external storage is needed.
2006-08-17 08:14:38 +00:00
marko
5e19de2b95 branches/zip: Clean up debug code.
struct mtr_struct: Omit unused field "state" unless #ifdef UNIV_DEBUG.

buf_block_buf_fix_inc_debug(): Remove redundant __attribute__((unused))
and #ifdef UNIV_SYNC_DEBUG.
2006-08-16 09:35:36 +00:00
marko
2a70318e38 branches/zip: Disable unused function ut_dulint_sort(). 2006-08-15 14:28:09 +00:00
marko
6942bfe031 branches/zip: buf_LRU_print(): Terminate every displayed entry with a newline. 2006-08-15 14:27:19 +00:00
marko
cbb6e0ca14 branches/zip: Merge revisions 713:720 from trunk. 2006-08-15 11:55:06 +00:00
marko
37f03d23d4 branches/zip: Introduce the symbol UNIV_DEBUG_PRINT for enabling debug
print functions.

buf_LRU_print(), buf_print(): Replace #ifdef UNIV_DEBUG
with #ifdef UNIV_DEBUG_PRINT.
2006-08-15 11:54:20 +00:00
marko
df74f57e24 branches/zip: btr0btr.ic: Add #include "page0zip.h" so that the code
will compile with inlining disabled.
2006-08-15 08:37:54 +00:00
marko
a013fd9c49 branches/zip: Allow the code to be built with function inlining enabled.
page0page.h: Add #include "page0zip.h"

page_dir_slot_get_rec(): Avoid void* arithmetics.

trx0undo.ic, trx0sys.ic: Remove unnecessary #include "page0zip.h"

page_zip_write_header(): Move prototype from page0types.h to page0zip.h
2006-08-14 08:25:46 +00:00
marko
36ed778816 branches/zip: Merge revisions 634:713 from trunk. 2006-08-11 11:49:38 +00:00
marko
760b46ede0 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
12acdca520 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
be44b82273 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
44ed6dc9de 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
5e0d677f0b 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
7181f05870 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
413f8ab0c1 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
cc3f8b2136 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
f5458ef6dc 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
766fb4d1c7 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
441c29e94f 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
e4077d5651 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