------------------------------------------------------------------------
r3036 | marko | 2008-11-12 12:34:30 +0200 (Wed, 12 Nov 2008) | 4 lines
branches/zip: dtuple_validate(): When UNIV_DEBUG_VALGRIND is defined,
rely solely on the UNIV_MEM_ASSERT_RW() check and disable the for loop
that would only cause additional noise.
------------------------------------------------------------------------
r3037 | marko | 2008-11-12 13:52:57 +0200 (Wed, 12 Nov 2008) | 6 lines
branches/zip: row_vers_impl_x_locked_off_kernel(): Remove compilation
warnings about prev_trx_id and vers_del being possibly uninitialized,
by handling the case prev_version == NULL in a single if block.
rb://45 approved by Inaam Rana.
------------------------------------------------------------------------
r3131 | michael | 2008-11-17 14:56:56 +0200 (Mon, 17 Nov 2008) | 9 lines
branches/zip:
rb://53
Improve innodb_supports_xa system variable handling and
reduces the number of retrievals of the value from MySQL.
Approved by: Marko, over IM
------------------------------------------------------------------------
r3132 | michael | 2008-11-17 16:02:01 +0200 (Mon, 17 Nov 2008) | 5 lines
branches/zip: rb://53
Final version of rb://53, fixes the styling of a comment, makes
the definition and the declaration of thd_supports_xa() identical commentwise.
------------------------------------------------------------------------
r3141 | marko | 2008-11-19 16:39:55 +0200 (Wed, 19 Nov 2008) | 1 line
branches/zip: buf_LRU_free_block(): Clarify the function comment.
------------------------------------------------------------------------
r3144 | marko | 2008-11-20 11:39:49 +0200 (Thu, 20 Nov 2008) | 2 lines
branches/zip: rec_get_nth_field_offs_old(): Add UNIV_UNLIKELY hints
to assertion-like tests.
------------------------------------------------------------------------
r3145 | marko | 2008-11-20 12:22:40 +0200 (Thu, 20 Nov 2008) | 20 lines
branches/zip: Always check for "row too large" when executing SQL to create
an index or table. We have to skip this check when loading table definitions
from the data dictionary, because we could otherwise refuse to load old
tables (even uncompressed ones). This addresses Issue #119.
The first "row too large" check was implemented in MySQL 5.0.3
to address MySQL Bug #5682. In the InnoDB Plugin 1.0.2, a more
accurate check was implemented in innodb_strict_mode. We now
make the check unconditional.
dict_create_index_step(): Pass strict=TRUE to dict_index_add_to_cache().
trx_is_strict(), thd_is_strict(): Remove.
innodb-zip.test: Test in innodb_strict_mode=OFF.
innodb_bug36169.test: Ensure that none of the tables can be created.
rb://56 approved by Sunny Bains.
------------------------------------------------------------------------
r3148 | marko | 2008-11-20 13:27:27 +0200 (Thu, 20 Nov 2008) | 3 lines
branches/zip: rec_print_old(), rec_print_comp(): Dump each field in a
separate line, so that the dumps can be read and compared more easily.
------------------------------------------------------------------------
------------------------------------------------------------------------
r2809 | marko | 2008-10-16 09:41:13 +0300 (Thu, 16 Oct 2008) | 18 lines
branches/zip: Skip the undo log size check on REDUNDANT and COMPACT tables.
In ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPRESSED, column prefix indexes
require that prefixes of externally stored columns be written to the
undo log. This may make the undo log record bigger than the record on
the B-tree page. The maximum size of an undo log record is the page
size. That must be checked for, in dict_index_add_to_cache().
dict_index_add_to_cache(): Skip the undo log size check for REDUNDANT
and COMPACT tables. These tables store prefixes of externally stored
columns locally within the clustered index record. There are no special
considerations for the undo log record size.
innodb-index.test: Ensure that the check exists for ROW_FORMAT=DYNAMIC,
but not for ROW_FORMAT=COMPACT.
This fixes issue #99. rb://28 approved by Sunny.
------------------------------------------------------------------------
r2810 | vasil | 2008-10-16 19:57:58 +0300 (Thu, 16 Oct 2008) | 12 lines
branches/zip:
Fix Mantis issue#61:
In row_undo_ins_parse_undo_rec(): if we find that a table has no indexes
(dict_table_get_first_index() returns NULL) do not try to call
trx_undo_rec_get_row_ref() with a NULL pointer because that would lead to
a crash. Instead, print a warning and set node->table to NULL just like
it is done if the .ibd file is missing.
Approved by: Heikki (via IM)
------------------------------------------------------------------------
r2824 | marko | 2008-10-20 09:58:01 +0300 (Mon, 20 Oct 2008) | 2 lines
branches/zip: rec_convert_dtuple_to_rec_comp(): Relax a too tight assertion.
Spotted by Sunny.
------------------------------------------------------------------------
r2825 | vasil | 2008-10-20 13:41:04 +0300 (Mon, 20 Oct 2008) | 6 lines
branches/zip:
Print the table name via ut_print_name() and add two spaces before InnoDB.
Suggested by: Marko
------------------------------------------------------------------------
r2833 | marko | 2008-10-21 10:16:45 +0300 (Tue, 21 Oct 2008) | 2 lines
branches/zip: ibuf_insert_low(): Avoid unnecessarily
acquiring and releasing ibuf_mutex.
------------------------------------------------------------------------
r2834 | marko | 2008-10-21 10:18:57 +0300 (Tue, 21 Oct 2008) | 1 line
branches/zip: ibuf_delete_rec(): Add debug assertions suggested by Heikki.
------------------------------------------------------------------------
r2835 | marko | 2008-10-21 11:04:06 +0300 (Tue, 21 Oct 2008) | 1 line
branches/zip: ibuf_insert_low(): Simplify a comparison.
------------------------------------------------------------------------
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.
columns to be up to REC_MAX_INDEX_COL_LEN + BTR_EXTERN_FIELD_REF_SIZE
bytes in a debug assertion. This assertion could fail since r2159 in
trx_undo_prev_version_build(), because the undo log records for updates
and deletes would contain longer prefixes of externally stored columns.
The assertion failure was reported by Sunny.
on mispredicted branches: opcontrol --event=BR_CND_MISSP_EXEC:45000
UT_SORT_FUNCTION_BODY(): Copy the array with memcpy(3).
cmp_dtuple_rec_with_match(), cmp_rec_rec_with_match(),
cmp_debug_dtuple_rec_with_match(): Add UNIV_UNLIKELY hints around
tests for REC_INFO_MIN_REC_FLAG.
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().
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.
rec_get_converted_size_comp(), rec_convert_dtuple_to_rec_comp(),
rec_convert_dtuple_to_rec_new(), rec_convert_dtuple_to_rec(): Add a
const qualifier to dict_index_t*.
row_search_on_row_ref(): Add const qualifiers to the dict_table_t*
and dtuple_t* parameters. Note that pcur is an "out" parameter
and mtr is "in/out".
mem_alloc2(): New macro. This is a variant of mem_alloc() that
returns the allocated size, which is equal to or greater than
the requested size.
mem_alloc_func(): Add the output parameter *size for the allocated size.
When it is set, adjust the parameter passed to mem_heap_alloc().
rec_copy_prefix_to_buf_old(), rec_copy_prefix_to_buf(): Use mem_alloc2()
instead of mem_alloc().
rec_print_comp(): New function, sliced from rec_print_new().
rec_print_old(), rec_print_comp(): Print the untruncated length of the column.
row_merge_print_read, row_merge_print_write, row_merge_print_cmp:
New flags, to enable debug printout in UNIV_DEBUG builds.
row_merge_tuple_print(): New function for UNIV_DEBUG builds.
row_merge_read_rec(): Obey row_merge_print_read.
row_merge_buf_write(), row_merge_write_rec_low(),
row_merge_write_eof(): Obey row_merge_print_write.
row_merge_cmp(): Obey row_merge_print_cmp.
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().
The creation of the primary key does not work. We will have to flag
externally stored columns and copy the externally stored part from
the old table.
row_build_index_for_mysql(): Rename to row_merge_build_indexes().
Move from row0mysql.c to row0merge.c.
Remove private declarations from row0merge.h. Make many functions static
in row0merge.c.
cmp_rec_rec_simple(): A new comparison function.
dict_index_get_min_size(): New function.
OS_FILE_FROM_FD(fd): A macro for converting from int to os_file_t.
rec_convert_dtuple_to_rec_comp(): Make the interface lower-level.
rec_get_converted_size_comp(): Return also extra_size.
UT_SORT_FUNCTION_BODY(): Remove reference to an obsolete test program.
row_rec_to_index_entry_low(): New function.
row0merge.c: Implement merge sort based on file streams instead of
fixed-size blocks. Sort the small blocks as arrays of dfield_t*,
because it is faster than invoking rec_get_offsets() for every
comparison.
rec_get_converted_size_new(): Rename to rec_get_converted_size_comp().
Add const qualifier to dtuple. Remove the assertion
dict_table_is_comp(index->table), because this function will be invoked
when populating the temporary files in fast index creation.
rec_convert_dtuple_to_rec_new(): Rename to rec_convert_dtuple_to_rec_comp().
Add parameter "extra".
rec_init_offsets_comp_ordinary(): New function. Used in rec_init_offsets().
by adding the REC_OFFS_EXTERNAL flag to rec_offs_base(offsets)[0].
This reduces the processor usage of page_zip_write_rec() by about 40%
in one test case. The code could be sped up further by testing
rec_offs_any_extern() outside of loops that check rec_offs_nth_extern().
The vast majority of records does not contain any externally stored columns.
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.
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.
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.
of externally stored columns, and fix bugs introduced in r873. (Bug #22496)
btr_page_get_sure_split_rec(), btr_page_insert_fits(),
rec_get_converted_size(), rec_convert_dtuple_to_rec(),
rec_convert_dtuple_to_rec_old(), rec_convert_dtuple_to_rec_new():
Add parameters ext and n_ext. Flag external fields during the
conversion.
rec_set_field_extern_bits(), rec_set_field_extern_bits_new(),
rec_offs_set_nth_extern(), rec_set_nth_field_extern_bit_old():
Remove. The bits are set by rec_convert_dtuple_to_rec().
page_cur_insert_rec_low(): Remove the parameters ext and n_ext.
btr_cur_add_ext(): New utility function for updating and sorting ext[].
Low-level functions now expect the array to be in ascending order
for performance reasons. Used in btr_cur_optimistic_insert(),
btr_cur_pessimistic_insert(), and btr_cur_pessimistic_update().
btr_cur_optimistic_insert(): Remove some defensive code, because we cannot
compute the added parameters of rec_get_converted_size().
btr_push_update_extern_fields(): Sort the array. Require the array to
be twice the maximum usage, so that ut_ulint_sort() can be used.
dtuple_convert_big_rec(): Allocate new space for the BLOB pointer,
to avoid overwriting prefix indexes to the same column. Adapt
dtuple_convert_back_big_rec().
row_build_index_entry(): Fetch the columns also for prefix indexes of
the clustered index.
page_zip_apply_log(), page_zip_decompress_clust(): Allow externally
stored fields to lack a locally stored part.
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.
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.
trx-undo_prev_version_build(): Pass offsets==NULL to
rec_set_field_extern_bits().
rec_set_field_extern_bits(), rec_set_field_extern_bits_new():
Accept offsets==NULL.
row_upd_rec_in_place(): Remove the bogus comment that the function
would only be invoked on a clustered index. Remove the related
debug assertion.
page_zip_dir_delete() will need to handle BLOBs.
rec_set_field_extern_bits(), rec_set_field_extern_bits_new():
Add parameter offsets.
rec_offs_set_nth_extern(): New function to set an extern bit in offsets.
This will be called when an extern bit is set in a record.
page_cur_rec_insert(), page_cur_insert_rec_low(): Document that the
parameter "offsets" is in/out.
page_zip_dir_delete(): Note that the array of BLOB pointers will need
to be shifted.
page0zip.ic: Document the entry type for clearing a record.
page_zip_available(): Add parameter "index". Remove parameters
"is_leaf" and "is_clustered".
page_zip_get_trailer_len(): New function for computing the trailer length
of the compressed page.
page_zip_apply_log(): Implement the modification log entry type for
clearing the data bytes of a record.
page_zip_decompress(): Initialize n_blobs when actually copying the
BLOB pointers to place.
page_zip_validate(): Add diagnostic messages for failures. Check
also m_start, m_end, and n_blobs.
page_zip_write_blob_ptr(): Add page_zip_validate() assertion.
rec_get_offsets_reverse(): Calculate extra_size correctly.
page_zip_apply_log(): Fix an off-by-one error in comparison.
Replace heap_status with hs where possible.
Increment the heap_no in heap_status correctly.
page_zip_decompress(): Eliminate the local variable "err".
Check for Z_STREAM_END only at the start of a record, so that
incomplete records will always be detected.
page_zip_write_rec(): Calculate the address of "storage" in the
same way as elsewhere. Add TODO comments regarding the handling
of the uncompressed fields (BLOB pointers, trx_id, and roll_ptr).
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.
BLOB pointers, trx_id, and roll_ptr.
btr_empty(), btr_create(), page_create(): Add parameter "index", as some
index information will be encoded on the compressed page.
Define REC_NODE_PTR_SIZE as 4.
Allow btr_page_reorganize() and btr_page_reorganize_low() to fail.
Define the error code DB_ZIP_OVERFLOW.
Make row_ins_index_entry_low() static.
page0zip: Encode the index, log reorganized records, and store uncompressed
fields separately from the compressed data stream.