Commit graph

30 commits

Author SHA1 Message Date
marko
1d1dc31a06 branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global
symbols.  Use it for all definitions of non-static variables and functions.

lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
referenced from pars0grm.c.

Actually, according to
	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
the following symbols are still global:

* The vtable for class ha_innodb
* pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs

The required changes to the Bison-generated file pars0grm.c will be addressed
in a separate commit, which will add a script similar to make_flex.sh.

The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
there will be no clash with the builtin InnoDB.  However, there will be some
overhead for invoking virtual methods of class ha_innodb.  Ideas for making
the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
2008-02-06 14:17:36 +00:00
marko
cdb5b46445 branches/zip: Implement wrappers for all operations on the buffer pool mutex.
buf_pool->mutex: Rename to buf_pool_mutex, so that the wrappers will have
to be used when changes are merged from other source trees.

buf_pool->zip_mutex: Rename to buf_pool_zip_mutex.

buf_pool_mutex_own(), buf_pool_mutex_enter(), buf_pool_mutex_exit():
Wrappers for buf_pool_mutex.
2008-01-10 09:37:13 +00:00
marko
2ddbc912e7 branches/zip: Silence most GCC 4.2.1 warnings about const pointers.
For some reason, GCC 4.2.1 ignores casts (for removing constness)
in calls to inline functions.

page_align(), ut_align_down(): Make the parameter const void*, but still
return a non-const pointer.  This is ugly, but these functions cannot be
replaced with a const-preserving macro in a portable way, given that
the pointer argument is not always pointing to bytes.

buf_block_get_page_zip(): Implement as a const-preserving macro.

buf_frame_get_page_zip(), buf_block_align(): Add const qualifiers.

lock_rec_get_prev(): Silence GCC 4.2.1 warnings.

mlog_write_initial_log_record(), mlog_write_initial_log_record_fast(),
mtr_memo_contains(): Add const qualifier to the pointer.

page_header_get_ptr(): Rewrite as page_header_get_offs(), and
implement as a macro that calls this function.
2007-10-03 12:22:29 +00:00
marko
8b40a79c64 branches/zip: Enable calls to inlined InnoDB functions in ha_innodb.cc,
now that all of InnoDB code is built from a single Makefile and it should
not be possible to build the modules with mutually incompatible options.

#define INSIDE_HA_INNOBASE_CC: Remove.

srv_sizeof_trx_t_in_ha_innodb_cc: Remove.

dict_table_get_low_noninlined(): Remove.  This function was unused.

Remove all _noninline functions.  Remove the _noninline suffix from
all function calls in ha_innodb.cc.
2007-06-20 08:26:26 +00:00
marko
88df83bb3b branches/zip: Merge revisions 1402:1493 from trunk.
Remove mysql.patch, because the configuration parameter interface has changed.
2007-05-14 09:07:15 +00:00
marko
fa4f5fcfe5 branches/zip: Fix two bugs.
mtr_commit(): Do not acquire the log mutex if no log records are to be written.

ibuf_set_free_bits_func(): Do not clear mtr.modifications, because that would
prevent the dirty insert buffer bitmap block from being moved to the flush
list.  Instead, assume that mtr_commit() will not acquire log_sys->mutex
because redo logging is disabled.

buf_page_init_for_read(): I/O-fix the block before buf_buddy_alloc(), because
the newly allocated block could otherwise be reused by the compressed page.
2007-05-07 05:53:42 +00:00
marko
4d6805f2a8 branches/zip: Merge revisions 1322:1402 from trunk. 2007-04-02 05:39:41 +00:00
marko
463aaf28ba branches/zip: Avoid memory fragmentation when adding column definitions
to tables.

dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
allocation.  Allow it and "name" to be NULL.  These parameters are NULL
when creating dummy indexes.

dict_add_col_name(): Remove calls to ut_malloc() and ut_free().

dict_table_get_col_name(): Allow table->col_names to be NULL.

dict_table_add_system_columns(), dict_table_add_to_cache():
Add the parameter "heap".
2007-01-30 09:24:18 +00:00
marko
8f65d7a661 branches/zip: Merge revisions 1165:1206 from trunk. 2007-01-18 12:58:39 +00:00
marko
fc2c6729b4 branches/zip: Remove buf_pool->frame_zero and buf_pool->high_end. 2006-10-31 09:59:15 +00:00
marko
bac65733cd branches/zip: Always call buf_block_align() while holding buf_pool->mutex.
This was forgotten from r977.
2006-10-30 16:18:23 +00:00
marko
6ee593b116 branches/zip: Add const qualifiers to read-only pointers.
rec_get_nth_field_offs_old(): Split from rec_get_nth_field_old().

rec_get_nth_field_old(): Reimplement as a constness-preserving macro.

dict_drop_index_tree(), dict_truncate_index_tree(): Note that rec is
an in/out parameter, as the B-tree root page number will be updated.
2006-10-26 08:52:14 +00:00
marko
b6e26f24d7 branches/zip: Remove some more buf_block_align() calls.
btr_cur_t: Move page_block to page_cur_t::block.

page_cur_get_block(), page_cur_get_page_zip(): New functions.

page_cur_position(): Add parameter block.

Remove many page_zip parameters, now that there is page_cur_get_page_zip().
Replace some page, page_zip parameters with block.

Add some const qualifiers to function parameters and remove casts.

PAGE_HEAP_NO_INFIMUM, PAGE_HEAP_NO_SUPREMUM, PAGE_HEAP_NO_USER_LOW:
New constants.

Replace some cursor code in low-level diagnostic functions with
direct management of rec, because buf_block_t::buf_fix_count may be 0
when the functions are called, and debug assertions would fail.
2006-10-20 12:45:53 +00:00
marko
fbe4fe6022 branches/zip: Remove the casts introduced in r920 and r925. Replace the
accessors returning pointers with macros that preserve const qualifiers.
In UNIV_DEBUG builds, retain the accessors and cast away constness there.

dfield_get_type(), dfield_get_data(), dtuple_get_nth_field(),
dict_table_get_nth_col(), dict_table_get_sys_col(): Implement as macro
unless #ifdef UNIV_DEBUG.

rec_get_nth_field(): Replace with rec_get_nth_field_offs() that does not
do pointer arithmetics.  Implement rec_get_nth_field() as a macro.
2006-10-19 07:27:26 +00:00
marko
334b002c5c branches/zip: Add function mtr_memo_contains_page() #ifdef UNIV_DEBUG.
Replace ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr), ...))
with ut_ad(mtr_memo_contains_page(mtr, ptr, ...)) in order to reduce the
number of buf_block_align() calls.
2006-10-09 19:36:58 +00:00
marko
469a27ac2a branches/zip: Replace buf_frame_align() with page_align(), page_offset(),
ut_align_down(), or ut_align_offset().
2006-10-09 16:22:47 +00:00
marko
a75409406d branches/zip: Merge revisions 861:869 from trunk. 2006-09-29 12:12:47 +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
68a65c142c branches/zip: Merge revisions 804:838 from trunk. 2006-09-19 10:14:07 +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
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
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
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
49d252397a branches/zip: Remove remaining occurrences of XDES_DESCRIBED_PER_PAGE.
mlog_parse_string(): Remove an off-by-one error in an assertion.

fil_extend_space_to_desired_size(): fsp_header_get_free_limit(),
fsp_try_extend_data_file(): Replace UNIV_PAGE_SIZE with the actual page size.

PAGE_ZIP_MIN_SIZE: New constant, to be used in assertions.

FSP_SEG_INODES_PER_PAGE: Add parameter zip_size.

fsp_seg_inode_page_get_nth_inode(), fsp_seg_inode_page_find_used(),
fsp_seg_inode_page_find_free(): Add parameter zip_size.
2006-06-07 10:41:58 +00:00
marko
1dd4d56863 branches/zip: Write compressed pages to disk.
os_aio_simulated_handle(): Temporarily disable os_file_check_page_trailers(),
which cannot be invoked on compressed pages.

dict_table_add_system_columns(): New function, split from
dict_table_add_to_cache().

mlog_parse_index(): Add system columns to the dummy table and identify
DB_TRX_ID and DB_ROLL_PTR in the dummy index.

buf_LRU_get_free_block(): Note that page_zip->data should be allocated from
an aligned memory pool.

buf_flush_buffered_writes(): Write compressed pages to disk.

buf_flush_post_to_doublewrite_buf(): Copy compressed pages to the
doublewrite buffer.  Zero fill any excess space.

buf_flush_init_for_writing(): Treat all compressed pages the same.

buf_read_page_low(): Read compressed pages from disk.

buf_page_io_complete(): Process compressed pages.

trx_sys_doublewrite_init_or_restore_page(): Process compressed pages.

mlog_write_initial_log_record_fast(): Enable a debug printout
#ifdef UNIV_LOG_DEBUG.

fsp_header_init(), fsp_fill_free_list(): Pass the compressed page size
to buf_page_create().

page_zip_compress_write_log(): Flatten the if-else if-else logic.

page_zip_parse_write_blob_ptr(): Do not test page_zip if page==NULL.

page_zip_parse_write_node_ptr(): Do not test page_zip if page==NULL.
Invoke mlog_close() correctly.

row_sel_store_row_id_to_prebuilt(): Add UNIV_UNLIKELY hint to an
assertion-like test.
2006-05-30 09:04:57 +00:00
marko
40b0bf7807 branches/zip: Merge revisions 236:247 from trunk. 2006-02-27 09:33:26 +00:00
marko
747c8fad44 branches/zip: Merge revisions 200:236 from trunk. 2006-02-23 19:25:29 +00:00
marko
47da8abc14 branches/zip: Try to synchronize the updates of uncompressed and
compressed pages.

btr_root_raise_and_insert(): Distinguish root_page_zip and new_page_zip.

btr_cur_set_ownership_of_extern_field(): Do not log the write on the
uncompressed page if it will be logged for page_zip.

lock_rec_insert_check_and_lock(), lock_sec_rec_modify_check_and_lock():
Update the max_trx_id field also on the compressed page.

mlog_write_ulint(): Add UNIV_UNLIKELY hints.  Remove trailing white space.

mlog_log_string(): Remove trailing white space.

rec_set_field_extern_bits(): Remove parameter mtr, as the write will either
occur in the heap, or it will be logged at a higher level.

recv_parse_or_apply_log_rec_body(),
page_zip_write_header(): Add log record type MLOG_ZIP_WRITE_HEADER.

page_header_set_field(): Pass mtr=NULL to page_zip_write_header().

page_header_reset_last_insert(): Pass mtr to page_zip_write_header().

btr_page_set_index_id(), btr_page_set_level(),
btr_page_set_next(), btr_page_set_prev(): Pass mtr to page_zip_write_header().

row_upd_rec_sys_fields(): Pass mtr=NULL to page_zip_write_trx_id() and
page_zip_write_roll_ptr(), since the write will be logged at a higher level.

page_zip_write_header(): Add parameter mtr.
page_zip_write_header_log(): New function.

Remove rec_set_nth_field_extern_bit().
Make rec_set_nth_field_extern_bit_old() static.
Rename rec_set_nth_field_extern_bit_new()
to rec_set_field_extern_bits_new() and make it static.

row_ins_index_entry_low(): Remove bogus TODO comment.
2006-02-22 13:02:40 +00:00
marko
1b7710af93 branches/zip: Implement the compression of BLOB columns.
This has not been extensively tested yet, because some other part of the
code breaks in "ibtestblob".

btr_free_page_low(): Add parameters "space" and "page_no", because they
are omitted from compressed BLOB pages.

btr0cur.c: Implement the compression and decompression of BLOB columns,
enabled at compile-time (#define ZIP_BLOB TRUE) for now.

btr_rec_free_externally_stored_fields(),
btr_copy_externally_stored_field(): Made static

mlog_log_string(): New function, split from mlog_write_string(), allows
to avoid a dummy memcpy() of compressed BLOB pages.
2006-02-16 12:58:18 +00:00
osku
2903c72469 Import 5.0 code. 2005-10-27 07:29:40 +00:00