Commit graph

873 commits

Author SHA1 Message Date
marko
99f97f8c1d branches/zip: ha_innobase::add_index(): Lock the table before creating
any indexes.  Before this fix, other transactions could see the empty indexes
before we acquired the table lock.
2007-10-18 12:46:14 +00:00
marko
582c74c5f8 branches/zip: row_merge_lock_table(): Clear the trx->dict_operation flag
for the duration of the lock_table() call in order to avoid a bogus warning.
2007-10-18 09:18:18 +00:00
marko
d967aaa65b branches/zip: Remove const warnings reported by GCC 4.2.1.
page_cur_set_before_first(), page_cur_set_after_last(),
page_cur_position(): Add const qualifiers to buf_block_t and rec.
A better solution would be to define a const_page_cur_t and a
set of accessors, but it would lead to severe code duplication.

page_rec_get_n_recs_before(): Add const qualifiers.

page_dir_get_nth_slot(): Define as a const-preserving macro.

page_dir_slot_get_rec(), page_dir_slot_get_n_owned(),
page_dir_find_owner_slot(), page_check_dir(): Add const qualifiers.

page_rec_get_next_low(): Add const qualifiers.

page_rec_get_next_const(), page_rec_get_prev_const(): New functions,
based on the const-less page_rec_get_next() and page_rec_get_prev().

page_cur_get_page(), page_cur_get_block(), page_cur_get_page_zip(),
page_cur_get_rec(): Define as const-preserving macros.

page_cur_try_search_shortcut(), page_cur_search_with_match():
Add const qualifiers.

buf_page_get_mutex(): Add a const qualifier to buf_page_t*.

rec_get_next_ptr_const(): Const variant of rec_get_next_ptr().
2007-10-18 07:12:05 +00:00
marko
00b1b124f8 innodb-test: Allow Innodb_buffer_pool_pages_total to be 511 or 512.
The size of the buffer pool can be one page smaller than the requested
size when os_mem_alloc_large() returns something that is not
aligned by UNIV_PAGE_SIZE.  This test may still fail on systems with
a big os_large_page_size.
2007-10-18 06:58:39 +00:00
vasil
12729aea3c branches/zip:
Fix typo in comment.
2007-10-17 12:30:22 +00:00
marko
f372ed678c branches/zip: row_scan_and_check_index(): Remove the compiler warning
that tmp_heap is possibly uninitialized.  This was introduced in r1990.
2007-10-17 12:19:35 +00:00
marko
df4c733df7 branches/zip: Initialize dfield_t::ext as soon as possible. This should
fix the bugs introduced in r1591.

row_rec_to_index_entry_low(): Clear "n_ext".  Do not allow it to be NULL.
Add const qualifier to dict_index_t*.

row_rec_to_index_entry(): Add the parameters "offsets" and "n_ext".

btr_cur_optimistic_update(): Add an assertion that there are no externally
stored columns.  Remove the unreachable call to btr_cur_unmark_extern_fields()
and the preceding unnecessary call to rec_get_offsets().

btr_push_update_extern_fields(): Remove the parameters index, offsets.
Only report the additional externally stored columns of the update vector.

row_build(), trx_undo_rec_get_partial_row(): Flag externally stored columns
also with dfield_set_ext().

rec_copy_prefix_to_dtuple(): Assert that there are no externally stored
columns in the prefix.

row_build_row_ref(): Note and assert that the index is a secondary index,
and assert that there are no externally stored columns.

row_build_row_ref_fast(): Assert that there are no externally stored columns.

rec_offs_get_n_alloc(): Expose the function.

row_build_row_ref_in_tuple(): Assert that there are no externally stored
columns in a record of a secondary index.

row_build_row_ref_from_row(): Assert that there are no externally stored
columns.

row_upd_check_references_constraints(): Add the parameter offsets, to
avoid a redundant call to rec_get_offsets().

row_upd_del_mark_clust_rec(): Add the parameter offsets.  Remove
duplicated code.

row_ins_index_entry_set_vals(): Copy the external storage flag.

sel_pop_prefetched_row(): Assert that there are no externally stored
columns.

row_scan_and_check_index(): Copy offsets to a temporary heap across
the invocation of row_rec_to_index_entry().
2007-10-17 12:13:29 +00:00
marko
d49217dd23 branches/zip: btr_push_update_extern_fields(): Add parameter "index"
and use it for flagging externally stored columns in the data tuple.
The data tuple contains the same columns as the clustered index record,
but in a different order.  This error was introduced in r1591.

TODO: the assertion ut_ad(!dfield_is_ext()) may fail in
btr_cur_pessimistic_update().
2007-10-16 07:25:58 +00:00
marko
f7bf6fec47 branches/zip: btr_cur_mark_dtuple_inherited_extern(): Fix the loop condition
that was broken in r1591.  Spotted by Heikki and Vasil.
2007-10-16 06:05:09 +00:00
marko
278334e07e branches/zip: plug.in: Remove the check for aio.h and -lrt, which were
never used.  Combine the three AC_CHECK_FUNCS tests.
2007-10-15 11:30:38 +00:00
marko
0349b9d235 branches/zip: buf_chunk_init(): Note that the function does not always
return the requested amount of memory.
2007-10-15 11:26:58 +00:00
marko
7c68ba2e9d branches/zip: Allow a dynamically loaded InnoDB storage engine plugin
to replace a built-in instance of InnoDB in mysqld.  This is work in
progress, with several limitations:

* Other plugins defined in the builtin InnoDB are not disabled.
  However, InnoDB in MySQL 5.1 only defines the storage engine plugin,
  no INFORMATION_SCHEMA plugins.

* The global C symbols in ha_innodb.so except innodb_hton_ptr and
  builtin_innobase_plugin will have to be redefined, e.g., by objcopy.

* The storage engine cannot be called "InnoDB" to avoid a conflict with
  the builtin name.  Here we call it InnoDBzip.

innobase_hton_name[]: Rename to "InnoDBzip" when building a dynamic plugin.

innodb_plugin_init(): New function for the dynamic plugin, to copy
and redirect configuration parameters from the builtin InnoDB.

innodb_dynamic: New configuration parameter.  This has to be added
to the builtin InnoDB in MySQL 5.1.  Also, innodb_hton_ptr must be made
global there.

innobase_init(): Interpret the parameter innodb_dynamic.

Makefile.am: Redefine class ha_innobase to ha_innodb by a preprocessor
define.  Apparently, C++ classes cannot be easily renamed by objcopy.
2007-10-15 11:05:40 +00:00
marko
81761f5f7c branches/zip: innodb-index.test: Add FORCE INDEX directives and remove
those SELECTs whose ORDER BY cannot possibly make use of an index.
2007-10-15 08:42:35 +00:00
marko
edb7de5fee branches/zip: On compressed pages, always update the insert buffer bitmap.
Do not assume anything about the contents of the bitmap.

ibuf_update_free_bits_low(): Use this function only for uncompressed pages.
Remove the parameter zip_size.  This function avoids latching the bitmap page
and updating the bitmap when the bits do not change.

ibuf_update_free_bits_zip(): New function based on ibuf_update_free_bits_low(),
for use on compressed pages.  Remove the parameter max_insert_size that
was used for computing the before image of the free bits.  Always update the
bitmap.

ibuf_index_page_calc_free_zip(): New function, factored out from
ibuf_index_page_calc_free().

ibuf_update_free_bits_if_full(): Document that this function must only be
invoked on uncompressed pages.  Add a debug assertion about this.
2007-10-12 13:25:12 +00:00
vasil
468df81b8f branches/zip:
Add the proper macros for checking the correct latching order in trx
information_schema code.

Approved by:	Marko
2007-10-12 11:20:13 +00:00
marko
75e12d4898 branches/zip: page_zip_max_ins_size(): Correct the comment of the return value. 2007-10-12 11:16:20 +00:00
marko
edf5b599d1 branches/zip: ibuf_insert_low(): Add the parameter entry_size in order to
avoid repeated invocation of the costly function rec_get_converted_size().
2007-10-12 10:48:35 +00:00
marko
1367c5e5be branches/zip: ibuf_index_page_calc_free(): Add const qualifiers. 2007-10-12 10:45:41 +00:00
vasil
8bafadab91 branches/zip:
Fix off-by-one error in ut_raw_to_hex().
2007-10-12 10:20:01 +00:00
marko
36e3171767 branches/zip: Improve diagnostic output in ibuf_insert_to_index_page()
and add some debug assertions.
2007-10-12 08:38:49 +00:00
marko
4a697d8f60 branches/zip: ut_raw_to_hex(): Fix a compiler warning that was introduced
in r1960.
2007-10-12 08:37:27 +00:00
vasil
31dae76d30 branches/zip:
Non-functional change: add a missed space in the output message.
2007-10-12 07:58:28 +00:00
vasil
abceb43b98 branches/zip:
Non-functional change: fix compiler warning:

buf0buf.ic:637: warning: assignment discards qualifiers from pointer target type
2007-10-11 11:54:51 +00:00
vasil
9dbf703da8 branches/zip:
Non-functional change to improve readability.
2007-10-11 10:45:57 +00:00
vasil
e722cf5a30 branches/zip:
Add ut_raw_to_hex() function to convert a raw binary strings to hex.
This is a monstrous, fine-tuned implementation.

Approved by:	Marko
2007-10-10 16:35:05 +00:00
marko
2966cf744f branches/zip: row_ins_foreign_report_add_err(): Note that the dtuple_print()
call may display uninitialized values of DB_TRX_ID and DB_ROLL_PTR.
2007-10-10 11:39:26 +00:00
marko
a8a47268a4 branches/zip: innodb-index.result: Adapt the results to a patch from MySQL.
Unfortunately, the patch seems to prevent MySQL from utilizing secondary
indexes in the ORDER BY clauses.  Thus, the test no longer checks if newly
created indexes are well-formed.

ChangeSet@1.2528.98.1  2007-08-02 12:45:56-07:00  igor@mysql.com

Fixed bug#28404.
This patch adds cost estimation for the queries with ORDER BY / GROUP BY
and LIMIT. 
If there was a ref/range access to the table whose rows were required
to be ordered in the result set the optimizer always employed this access
though a scan by a different index that was compatible with the required 
order could be cheaper to produce the first L rows of the result set.
Now for such queries the optimizer makes a choice between the cheapest
ref/range accesses not compatible with the given order and index scans
compatible with it.
2007-10-08 12:16:32 +00:00
vasil
fe92e646f7 branches/zip:
Add diagnostic function ha_storage_get_size() to retrieve the amount of
memory used by a ha_storage_t object.

Approved by:	Marko
2007-10-08 10:46:26 +00:00
marko
4cd65bb092 branches/zip: page_mem_alloc_free(): Fix the debug assertion that was
accidentally broken in r1939.  It failed when next_rec == NULL.
2007-10-05 11:33:19 +00:00
marko
3d9183da6a branches/zip: Correct the Valgrind instrumentation that was added in r1947. 2007-10-05 11:22:23 +00:00
marko
8e4c946d11 branches/zip: i_s.cc: Add missing #include "buf0buf.h" that should have
been added in r1943.  This is needed for building a noninlined version.
2007-10-05 10:59:34 +00:00
marko
1080bc105a branches/zip: dtuple_convert_big_rec(): Do not flag the extern field
references uninitialized, because it causes bogus warnings since r1947.
2007-10-05 09:58:24 +00:00
marko
e233731f1b branches/zip: Add some Valgrind instrumentation.
dtuple_validate(): Detect uninitialized data.

page_cur_insert_rec_low(), page_cur_insert_rec_zip(): Assert that the
record being inserted is valid before and after insertion.
2007-10-05 08:53:28 +00:00
marko
5ae0bb6d60 branches/zip: innodb.test: Fix the result, now that fast index creation
reports duplicate key values.  The reported value may depend on the
size of the main-memory merge sort buffer (row_merge_block_t).
2007-10-05 08:39:35 +00:00
marko
9fb9158b6a branches/zip: Use static linkage for row_ins(). 2007-10-05 06:23:37 +00:00
marko
1b166ea268 branches/zip: Add DBUG_ASSERT(hton == innodb_hton_ptr) to various functions. 2007-10-04 08:33:25 +00:00
marko
a298d8ba0a branches/zip: Move the implementation of the INFORMATION_SCHEMA tables
INNODB_ZIP and INNODB_ZIP_RESET from ha_innodb.cc to i_s.cc.

plugin_author, END_OF_ST_FIELD_INFO, i_s_info: New common constants.

trx_i_s_common_deinit(): Renamed to i_s_common_deinit().
2007-10-03 14:00:54 +00:00
marko
354a9fc077 branches/zip: Initialize also the newly added field open_method
in ST_FIELD_INFO.
2007-10-03 13:48:17 +00:00
marko
f591eb0ba3 branches/zip: Silence some more GCC 4.2.1 warnings. 2007-10-03 12:36:59 +00:00
marko
2d61dbb747 branches/zip: page_rec_get_next_low(): Fix a bug that was made in r952. 2007-10-03 12:27:06 +00:00
marko
6557ba5342 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
a344db96e7 branches/zip: Merge 1918:1937 from trunk. 2007-10-03 08:44:50 +00:00
marko
8758ac866f branches/zip: dict_index_copy_rec_order_prefix(): Add const qualifiers. 2007-10-01 08:00:24 +00:00
marko
d1b3d492c0 branches/zip: btr_search_validate(): Use buf_block_hash_get(). 2007-10-01 07:45:02 +00:00
marko
3d57033064 branches/zip: Optimize buf_page_try_get_func().
buf_block_hash_get(): New function, similar to buf_page_hash_get().

buf_page_get_block(): Remove the const qualifiers.  This is a low-level
function, and the operations on block->mutex are non-const.

buf_page_try_get_func(): Implement with lower-level predicates, somewhat
similar to buf_page_get_known_nowait().

lock_rec_print(): Remove the unused variable zip_size and the
call to fil_space_get_zip_size().  Adapt to buf_page_try_get() returning
a const pointer.
2007-10-01 07:32:45 +00:00
marko
1110b563b2 branches/zip: Introduce the function buf_block_fix_dec(), similar to
buf_block_fix_inc(), and use it.
2007-10-01 07:25:02 +00:00
vasil
598a8ca67c branches/zip:
Remove bogus comment from ha_storage_empty().
2007-09-28 14:07:02 +00:00
vasil
795a17980d branches/zip:
Add const qualifier to the value returned by ha_storage_put().
It must not be changed as this will invalidate the hash.
2007-09-28 13:40:12 +00:00
marko
20d7ea9851 branches/zip: Add the function buf_page_get_block(), for converting
from buf_page_t* to buf_block_t*.

buf_page_can_relocate(): Replace the incorrect __attribute__((const))
with __attribute__((pure)).
2007-09-28 12:04:04 +00:00
marko
3b99f0d17c branches/zip: Fix some link errors.
ha_innobase::update_thd(void): New function, to call the inline function
ha_innobase::update_thd(THD*).

check_trx_exists(): Make static.  handler0alter.cc does not need to call
this function.
2007-09-28 10:44:20 +00:00