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.
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.
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().
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.
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.
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.
offsets_[] arrays, as suggested by Vasil.
rec_offs_set_n_alloc(): Declare as a public function. Assert that
n_alloc > REC_OFFS_HEADER_SIZE.
rec_offs_get_n_alloc(): Assert that n_alloc > REC_OFFS_HEADER_SIZE.
Move part of the code from lock_rec_print() in a separate function
buf_page_try_get() because the same functionality is needed in
INFORMATION SCHEMA code.
Approved by: Heikki
Fix a bug where the condition (prtype & DATA_ROW_ID) is unexpectedly
always false becasue DATA_ROW_ID is 0.
Use a switch instead of if-else in order to avoid repeating
(prtype & DATA_SYS_PRTYPE_MASK).
Approved by: Heikki
innobase_col_to_mysql(): New function, adapted from
row_sel_field_store_in_mysql_format().
innobase_rec_to_mysql(): Correct the function comment, which was still
saying "clustered index record", although we can convert any record.
Make use of innobase_col_to_mysql(). Always call field->reset(),
so that innobase_col_to_mysql() will not have to pad anything.