Commit graph

240 commits

Author SHA1 Message Date
marko
6e269ddf34 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
ee923f5cbe 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
d8d03e6b1e 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
35905f6266 branches/zip: Merge revisions 838:861 from trunk. 2006-09-22 10:22:03 +00:00
marko
8c6526d6d2 branches/zip: srv_master_thread(): Remove unnecessary assignments to
n_pages_purged.
2006-09-22 06:56:50 +00:00
marko
1d2380cbcc 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
62a0a8bfee 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
caba470265 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
75e478a01b 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
c12e237a09 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
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