Commit graph

246 commits

Author SHA1 Message Date
marko
732d2f3219 branches/zip: dtuple_convert_big_rec(): Reduce the locally stored part
of externally stored columns to REC_1BYTE_OFFS_LIMIT (128) bytes.
TODO: only store BTR_EXTERN_FIELD_REF_SIZE (20) bytes with the record,
and store the entire column externally.  (Bug #22496)

dict_col_t::min_prefix: Remove.
2006-09-26 19:50:21 +00:00
marko
16a5b78833 branches/zip: row_build_index_entry(): Fix errors introduced in r870.
Do not augment clustered index records.  When computing the prefix,
use dfield (where the prefix was copied), not dfield2 (the record in
the clustered index).
2006-09-26 14:26:19 +00:00
marko
72e836a85e branches/zip: fil_create_new_single_table_tablespace(): Remove the
unnecessary memset() introduced in r852.  When zip_size != 0,
write the compressed page to disk, not the uncompressed one.
2006-09-26 14:21:28 +00:00
marko
1f510066f4 branches/zip: Allow the locally stored part of externally stored columns
in the clustered index to be smaller than the indexed prefix in secondary
indexes.

row_ext_lookup(): Return NULL if the column is not stored externally.

trx_undo_rec_get_partial_row(): row_build(): Add parameter row_ext_t** ext.

row_build_index_entry(): Add the parameter row_ext_t* ext.
Invoke row_ext_lookup() to fetch prefixes of externally stored columns.

upd_node_t, undo_node_t, purge_node_t: Add the field row_ext_t* ext.
2006-09-26 11:50:54 +00:00
marko
7edc6be45b branches/zip: Add const qualifiers to the pointer parameters of
mach_read_...() functions.  Remove unnecessary casts.
2006-09-26 07:39:02 +00:00
marko
c4e548cec0 branches/zip: Add row_ext_t for caching prefixes of externally stored columns.
This will be needed for fixing Bug #22496.

REC_MAX_INDEX_COL_LEN: New constant, copied from DICT_MAX_INDEX_COL_LEN.

row_ext_create(), row_ext_lookup(), row_ext_lookup_low(): New functions.
2006-09-26 07:28:23 +00:00
marko
c66a0754b9 branches/zip: Implement the ability to fetch a prefix of an externally
stored column.  This is the first part of fixing Bug #22496.

btr_copy_externally_stored_field_prefix(): New function.

btr_copy_externally_stored_field(): Split to
btr_copy_externally_stored_field_prefix_low().

row_sel_sec_rec_is_for_blob(): New function, used by
row_sel_sec_rec_is_for_clust_rec() in selects via
a secondary index.
2006-09-26 06:22:16 +00:00
marko
8e59e994ac branches/zip: Minor cleanup in update related code.
btr_push_update_extern_fields(): Instead of iterating all upd_get_n_fields(),
stop at the first match.

row_search_index_entry(): Simplify the return statements.

row_upd_sec_step(): Eliminate the local variable "err".

row_upd_clust_step(): Add a UNIV_UNLIKELY hint.
2006-09-25 12:17:33 +00:00
marko
e4690b1d9e branches/zip: ibuf_merge_or_delete_for_page(): Check for
ibuf_fixed_addr_page() and fsp_descr_page() before invoking
fil_inc_pending_ibuf_merges().  That function call should
always be paired with a call to fil_decr_pending_ibuf_merges().
2006-09-22 11:30:03 +00:00
marko
9c6947fd4d branches/zip: Merge revisions 838:861 from trunk. 2006-09-22 10:22:03 +00:00
marko
841f288a3b branches/zip: srv_master_thread(): Remove unnecessary assignments to
n_pages_purged.
2006-09-22 06:56:50 +00:00
marko
81a283f883 branches/zip: page_zip_decompress(): Split into
page_zip_decompress_node_ptrs(), page_zip_decompress_sec(), and
page_zip_decompress_clust().  See also r856.
2006-09-21 19:09:25 +00:00
marko
edb0f042e5 branches/zip: ibuf_merge_or_delete_for_page(): Do not invoke
fil_space_get_zip_size() unless zip_size is really needed
(update_ibuf_bitmap || page).  This avoids an assertion failure
when discarding ibuf entries for a deleted tablespace, for which
fil_space_get_zip_size() would return ULINT_UNDEFINED.

Also, reindent ibuf0ibuf.c.
2006-09-21 08:01:50 +00:00
marko
e966a2f13e branches/zip: page_zip_compress(): Split into page_zip_compress_node_ptrs(),
page_zip_compress_sec(), and page_zip_compress_clust().
2006-09-21 07:27:35 +00:00
marko
5a21753bcb branches/zip: page_zip_empty_size(): New function to compute the
guaranteed free space available for inserting one record.

btr_page_get_sure_split_rec(), btr_cur_pessimistic_insert():
Use page_zip_empty_size().

btr_page_split_and_insert(): Relax a debug assertion that there should
be at least two user records on the page.  On compressed pages, we may
be able to write only one record.
2006-09-20 14:26:53 +00:00
marko
ff0acd76af branches/zip: Instrument the buffer pool allocator and deallocator
for more accurate Valgrind debugging.

univ.i: Introduce UNIV_DEBUG_VALGRIND, UNIV_MEM_VALID, and UNIV_MEM_INVALID.

buf_LRU_block_free_non_file_page(): Invalidate the buffer frame
with UNIV_MEM_INVALID().

buf_LRU_get_free_block(): Declare the buffer frame valid
with UNIV_MEM_VALID().

Other memory is allocated and deallocated via malloc() and free(),
which are already overridden by Valgrind.  Without the added
instrumentation, accesses to free pages in the buffer pool cannot
be caught.

The diagnostics could probably be improved further by declaring all
non-latched buffer frames invalid.
2006-09-20 12:42:08 +00:00
marko
3b03315f94 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
a169d0ec32 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
2af802d820 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
660880218b 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
68a65c142c branches/zip: Merge revisions 804:838 from trunk. 2006-09-19 10:14:07 +00:00
marko
48dd1ece29 branches/zip: Merge revisions 789:804 from trunk. 2006-09-12 07:29:57 +00:00
marko
090a1db9ad 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
50e286c04d branches/zip: btr_copy_externally_stored_field(): Add diagnostics for
unexpected end of compressed BLOB.
2006-09-06 09:51:00 +00:00
marko
0c26b8f1a4 branches/zip: btr_copy_externally_stored_field(): Correct the
reporting and handling of inflate() errors.
2006-09-05 19:41:05 +00:00
marko
23128a45c1 branches/zip: Split lines before operators, not after them. 2006-09-05 19:37:43 +00:00
marko
78357aa7c3 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
d4d321ad85 branches/zip: Merge revisions 767:789 from trunk. 2006-09-04 19:47:47 +00:00
marko
da79b9060c 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
c3e2a8d45f 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
ff61ba46d9 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
d8aa49be04 branches/zip: Merge revisions 765:767 from trunk. 2006-08-29 12:17:50 +00:00
marko
38e09b2fea 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
4b252f248c 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
1180ce9805 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
fb8ce59909 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
2f08aceba7 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
2998a01230 branches/zip: page_zip_dir_insert(): Remove unused parameters index, offsets. 2006-08-21 09:27:44 +00:00
marko
3a27b5c8c7 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
a9e75e633a 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
7e1076c716 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
244c9715f0 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
7b36a0aaaa branches/zip: Correct the description of DB_TOO_BIG_RECORD. 2006-08-18 10:02:50 +00:00
marko
4858179f05 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
800047591a 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
4fb0e5e762 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
41468be960 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
3d085927ba branches/zip: Disable unused function ut_dulint_sort(). 2006-08-15 14:28:09 +00:00
marko
79c2ea8582 branches/zip: buf_LRU_print(): Terminate every displayed entry with a newline. 2006-08-15 14:27:19 +00:00
marko
ec6213a7c4 branches/zip: Merge revisions 713:720 from trunk. 2006-08-15 11:55:06 +00:00