Commit graph

81 commits

Author SHA1 Message Date
marko
a1e57e698b branches/zip: Merge 1862:1894 from trunk, except 1866. 2007-09-27 11:17:45 +00:00
marko
f44bec1917 branches/zip: Minor cleanup.
dict_find_index_by_max_id(): Rename this static function to its
only caller, dict_table_get_index_by_max_id().

dict_table_get_index_by_max_id(): Copy the function comment from
dict_find_index_by_max_id().
2007-09-26 09:59:17 +00:00
marko
1595953ae9 branches/zip: Add some const qualifiers or in/out comments to the
dict_index_t* and dict_table_t* parameters of some functions.
2007-09-24 13:29:18 +00:00
marko
84ff578142 branches/zip: Simplify crash recovery in fast index creation.
trx_t: Remove dict_undo_list and dict_redo_list.

innobase_create_temporary_tablename(): Replace TEMP_TABLE_PREFIX with
a table name suffix "#1" or "#2".  In this way, the user can restore
precious data, should anything go wrong.  It is possible to reach an
inconsistent state, because the creation, deletion and renaming of
single-table tablespaces are not transactional.

ut_print_namel(), fil_make_ibd_name(), innobase_rename_table(): Remove
the special treatment of TEMP_TABLE_PREFIX.

Introduce TEMP_INDEX_PREFIX == 0xff for temporary indexes.  This byte
cannot occur in index names since MySQL 4.1.  However, it might have
been possible to use this byte in MySQL 4.0.

recv_recovery_from_checkpoint_finish(): Call the new function
row_merge_drop_temp_indexes(), to drop all indexes whose name starts
with the byte 0xff.

row_merge_rename_indexes(): Renamed from row_merge_rename_index().
Remove the parameter "index".

row_drop_table_for_mysql(): Unconditionally call trx_commit_for_mysql().

row_drop_table_for_mysql_no_commit(): Correct the function commit,
based on the corrected comment of row_drop_table_for_mysql().  Rely on
table->to_be_dropped instead of TEMP_TABLE_PREFIX.

ha_innobase::add_index(): Simplify the control flow.
2007-09-05 10:18:03 +00:00
marko
a2943ec761 branches/zip: Enclose the definition of dict_index_t::trx_id in
#ifdef ROW_MERGE_IS_INDEX_USABLE, to avoid growing the memory
footprint until MySQL implements and calls the virtual method
handler::is_index_available() or something equivalent.
2007-09-03 07:13:59 +00:00
marko
c13f191357 branches/zip: Remove some checks if an index or a table is a temporary one
created in fast index creation.

dict_load_indexes(): Always complain if the first index is not clustered.

lock_table_enqueue_waiting(): Always complain about lock waits in
a dictionary operation.

row_merge_rename_tables(): Add an assertion that dict_sys->mutex is
being held.

row_undo_mod_del_unmark_sec_and_undo_update(): Make the test about
temporary indexes more readable.

row_create_table_for_mysql(): Do not retry creating a temporary table
in fast index creation.  Orphaned temporary tables will have to be dropped
in crash recovery.
2007-08-29 08:45:34 +00:00
marko
e7d302e786 branches/zip: Remove trx->sync_cb. Call dict_rename_indexes() directly
from ha_innobase::add_index().

dict_rename_indexes(): Remove the redundant parameter commit_flag.
2007-08-21 12:36:13 +00:00
marko
b59ce25d1e branches/zip: dict_foreign_eval_sql(): Print foreign->id as a table name
(in the database.id format).  This should have been changed in r1570.
2007-08-21 08:34:50 +00:00
marko
2be769710c branches/zip: dict_table_rename_in_cache(): Improve the diagnostic printout
for the error cases.  Avoid copying the old table->name; the string will
remain valid in table->heap.
2007-08-20 09:43:30 +00:00
marko
1e7b92f844 branches/zip: Use mem_heap_zalloc() when initializing
dict_table_t, dict_index_t, and dict_foreign_t.
2007-08-20 06:58:37 +00:00
marko
8634d343f7 branches/zip: Rename mem_heap_calloc() and mem_calloc() to
mem_heap_zalloc() and mem_zalloc(), because calloc() in the C runtime
library takes two size parameters, not one.

mem_heap_zalloc(): Add debug assertions.  Document that the return value
is never NULL.
2007-08-16 13:25:56 +00:00
marko
2c7f6f6a26 branches/zip: Remove redundant type casts. Change the parameter type
of ut_strcmp() from const void* to const char*.
2007-08-16 09:09:08 +00:00
marko
60c44c3a5f branches/zip: Ensure that the dictionary updates are atomic by keeping
the data dictionary locked across the operations.

dict_table_decrement_handle_count(), row_prebuilt_free(): Add the flag
dict_locked, to prevent the acquisition of dict_sys->mutex.

innobase_rename_table(): Rename commit_flag to lock_and_commit,
and do not acquire dict_sys->mutex or flush the log unless the flag is set.
Remove bogus comment about utility threads, because the threads will
be waken up by the upper-level function ha_innobase::rename_table().

ha_innobase::add_index(): After creating a primary key, hold dict_sys->mutex
across all dictionary operations.
2007-08-02 10:55:25 +00:00
marko
0a780db994 branches/zip: Merge 1575:1664 from trunk. 2007-08-01 11:18:43 +00:00
marko
08c1fc7aa7 branches/zip: HASH_SEARCH(): Add the parameter TYPE, for the type of DATA.
C++ requires explicit type casts when converting from void*, and *.ic files
are now inlined in ha_innodb.cc.

fil_space_get_by_id(), fil_space_get_by_name(): New inline functions, to
replace occurrences of the HASH_SEARCH() macro in fil0fil.c.  This should
improve readability.
2007-08-01 08:13:22 +00:00
marko
632ec54002 branches/zip: Make merge sort handle externally stored columns.
Some things still fail in innodb-index.test, and there seems to be
a race condition (data dictionary lock wait) when running with --valgrind.

dfield_t: Add an "external storage" flag, dfield->ext.

dfield_is_null(), dfield_is_ext(), dfield_set_ext(), dfield_set_null():
New functions.

dfield_copy(), dfield_copy_data(): Add const qualifiers, fix in/out comments.

data_write_sql_null(): Use memset().

big_rec_field_t: Replace byte* data with const void* data.

ut_ulint_sort(): Remove.

upd_field_t: Remove extern_storage.

upd_node_t: Replace ext_vec, n_ext_vec with n_ext.

row_merge_copy_blobs(): New function.

row_ins_index_entry(): Add the parameter "ibool foreign" for suppressing
foreign key checks during fast index creation or when inserting into
secondary indexes.

btr_page_insert_fits(): Add const qualifiers.

btr_cur_add_ext(), upd_ext_vec_contains(): Remove.

dfield_print_also_hex(), dfield_print(): Replace if...else if with switch.
Observe dfield_is_ext().
2007-06-21 09:43:15 +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
f24fa9e6b0 branches/zip: Define mem_heap_calloc() and mem_calloc(). Use them
when allocating zero-filled memory.
2007-06-19 09:39:27 +00:00
marko
99efc2aeff branches/zip: Initialize some uninitialized variables in order to avoid
comparing uninitialized values.

dict_mem_table_create(): Initialize table->version_number.

ins_node_create(): Initialize node->table_version_number.

row_create_prebuilt(): Initialize all fields.  Initialize most fields
by memset(), so that any fields that are added will be initialized
automatically.
2007-06-11 14:39:04 +00:00
marko
0e14cb5579 branches/zip: Document dict_rename_indexes() better. 2007-06-07 09:47:59 +00:00
marko
ab2f114ad9 branches/zip: Merge 1533:1553 from trunk. 2007-06-06 11:07:37 +00:00
marko
8a294fa351 branches/zip: Merge 1493:1533 from trunk.
Make use of UT_BITS_IN_BYTES().
2007-05-29 08:48:16 +00:00
marko
3f3a0c5334 branches/zip: Use ut_dulint_zero and ut_dulint_is_zero whenever possible. 2007-05-18 11:01:58 +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
a294481681 branches/zip: Make use of the function dict_index_is_unique(). 2007-04-16 09:21:39 +00:00
marko
fc65b08f53 branches/zip: Merge branches/fast-index-creation -r1413.
Fix some bugs.  The tests innodb and innodb-index fail, but that might
be due to an old MySQL source tree being used.
2007-04-04 11:05:33 +00:00
marko
4d6805f2a8 branches/zip: Merge revisions 1322:1402 from trunk. 2007-04-02 05:39:41 +00:00
marko
d753d3e83c branches/zip: Make TRUNCATE TABLE recreate single-table tablespaces.
dict_truncate_index_tree(): Add the parameter space for specifying the
new tablespace identifier of a single-table tablespace that has been
recreated.  When SYS_INDEXES.PAGE_NO == FIL_NULL, do not abort but
create the index tree.

fil_discard_tablespace(): Pass the return code from fil_delete_tablespace().

row_truncate_table_for_mysql(): Attempt to discard and recreate
single-table tablespaces.  Reassign the tablespace identifier both in
the data dictionary (SYS_TABLES and SYS_INDEXES) and in the data
dictionary cache.
2007-03-29 08:51:13 +00:00
marko
bab6e2faf5 branches/zip: dict_mem_table_free(): Remove the call
ut_free(table->col_names) that should have been removed in r1264,
which made the temporary memory allocations use a caller-supplied heap.
2007-03-05 09:13:33 +00:00
marko
9b765549b4 branches/zip: Merge revisions 1271:1322 from trunk. 2007-03-01 13:53:57 +00:00
marko
a1475f6990 branches/zip: dict_table_copy_types(), dict_index_copy_types(): Add const
qualifiers.  Correct the documentation of the parameters.
2007-02-28 16:04:19 +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
5fc003b65d branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG. 2007-01-18 18:29:12 +00:00
marko
8f65d7a661 branches/zip: Merge revisions 1165:1206 from trunk. 2007-01-18 12:58:39 +00:00
marko
f116afa724 branches/zip: Remove the fil_space_get_zip_size() call from
buf_page_get_gen().  This saves one mutex operation per block request.

buf_page_get_gen(), various macros and functions: Add parameter zip_size.

btr_node_ptr_get_child(): Add parameter index.

fil_space_get_latch(): Add optional output parameter zip_size.

fil_space_get_zip_size(): Return 0 for space id==0, because the
system tablespace is never compressed.

fsp_header_init(): Remove the parameter zip_size.

ibuf_free_excess_pages(): Remove the parameter zip_size.

trx_rseg_t, trx_undo_t: Add field zip_size.

xdes_lst_get_next(): Remove, unused.
2007-01-18 09:59:00 +00:00
marko
7fbc4f2bc0 branches/zip: Merge revisions 1009:1165 from trunk. 2007-01-02 14:36:59 +00:00
marko
229d901921 branches/zip: Fix compilation errors when UNIV_HOTBACKUP is defined. 2006-11-30 15:25:52 +00:00
marko
03bdaaf509 branches/zip: Introduce a new preprocessor symbol, UNIV_BUF_DEBUG, and
enclose buf_validate() and friends in it.
2006-11-16 09:00:30 +00:00
marko
d266262af6 branches/zip: Prepare for buffer pool allocation in several chunks.
buf_pool_t: Remove n_frames, max_size, and blocks_of_frames.
The current buffer pool size is in curr_size.

buf_pool_init(): Remove parameter max_size.

buf_pool_get_max_size(), buf_pool_is_block(): Remove.

buf_block_align(): Do not assume that the buffer pool is allocated
in one chunk.  Replace dependency on buf_pool->blocks_of_frames
with a call to buf_page_hash_get().
2006-10-30 15:15:19 +00:00
marko
d9e1e326cb branches/zip: Port r973 from trunk.
Do not break the latching order in TRUNCATE TABLE.

dict_truncate_index_tree(): Replace parameter rec_t* rec with
btr_pcur_t* pcur.  Reposition pcur before calling btr_create().

sync_thread_add_level(): Remove the relaxation of the assertion added in r968.
2006-10-30 13:44:00 +00:00
marko
d288c0fa0e branches/zip: dict_load_table(): Note that dict_sys_tables_get_zip_size()
returns the compressed page size in kilobytes, not bytes.
2006-10-27 13:12:47 +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
53fec05c38 branches/zip: After merge (r956) fix:
Implement dict_index_get_if_in_cache_low() correctly.
Restore the function dict_index_get_if_in_cache() #ifdef UNIV_DEBUG.
2006-10-26 07:50:51 +00:00
marko
8df8b91977 branches/zip: Merge revisions 887:934 from trunk. 2006-10-25 11:19:12 +00:00
marko
d6c684798e branches/zip: Add const qualifiers to function parameters, mostly dtuple_t. 2006-10-20 08:30:07 +00:00
marko
8919884f45 branches/zip: Remove some more casts.
dict_index_get_nth_col_pos(), dict_index_get_sys_col_pos(),
dict_index_get_n_fields(), fil_page_get_type():
Add const qualifier to parameter.

dict_index_get_nth_field(): Implement as a macro unless #ifdef UNIV_DEBUG.
2006-10-19 07:52:28 +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
8f07794024 branches/zip: Introduce const qualifiers to many read-only parameters
and modify some functions to return const pointers.  Add const qualifiers
to local variable declarations or casts to remove the const qualifier
in those places where write access is needed.
2006-10-17 12:24:13 +00:00
marko
5669dc3d2a branches/zip: Reduce the number of buf_block_align() calls.
btr_block_get(): New function to return buf_block_t.

btr_page_alloc(), buf_page_get_release_on_io(), buf_page_get_gen(),
buf_page_create(), fseg_create(), fseg_create_general(): Return buf_block_t.

buf_page_get_known_nowait(): Expect buf_block_t instead of buf_frame_t.

buf_frame_get_newest_modification(): Replace with
buf_block_get_newest_modification().

buf_page_dbg_add_level(): Replace with buf_block_dbg_add_level().

buf_block_get_zip_size(): New function.

buf_block_get_page_zip(): Reintroduce.

recv_recover_page(): Replace page, space, page_no with block.

ibuf_bitmap_page_init(): Replace page, zip_size with block.

ibuf_parse_bitmap_init(): Remove the parameter zip_size.

btr_search_drop_page_hash_index(): Replace page with block.
2006-10-12 11:05:22 +00:00
marko
736a8ffb01 branches/zip: Replace buf_frame_get_page_no() and buf_frame_get_space_id()
with page_get_page_no() and page_get_space_id().  We want to avoid
buf_block_align() calls, and the page_no and space_id are now stamped
on the pages early on.
2006-10-12 07:02:36 +00:00