Issue #117. Before buffering IBUF_OP_DELETE, require that there be at least
two records on the page. In that way, at least one record will remain after
the delete operation has been merged.
delete-mark operation, do not count the buffered records. The count
is only relevant for buffering IBUF_OP_DELETE operations.
ibuf_get_volume_buffered(): Do not count the records if n_recs is NULL.
Do not zero out *n_recs, but let the caller do that.
ibuf_get_volume_buffered_count(): Do nothing if n_recs == NULL.
reintroduced in r2970.
ibuf_get_volume_buffered_hash(): Add the parameters "types" and "data".
The bug was that "types" lacked the offset IBUF_REC_INFO_SIZE, and the
type information would be read from the wrong place.
Invoke ibuf_get_volume_buffered_count() as many times as
ibuf_rec_get_volume(rec), so that *n_recs will be updated as appropriate.
This fixes Issue #82: some deletes will be buffered in purge.
insert buffer bitmap when buffering deletes or delete-marks.
TODO: ibuf_get_volume_buffered() should return only the volume of
the buffered inserts, not deletes or delete-marks.
(r2962, r2865, r2864) and do not refuse to buffer deletes. The
problem with refusing to buffer deletes was that no deletes were
buffered.
Instead, when merging delete requests, disregard a delete request
if it would make the page empty. InnoDB tolerates redundant secondary
index records, but not empty pages.
ibuf_delete(): When merging a delete request, print and ignore the record
if the page would become empty.
records on a page, count each unique buffered record at most once.
ibuf_get_volume_buffered_hash(): New function, for inserting a hashed record
into a bit array.
ibuf_get_volume_buffered_count(): New function, refactored from
ibuf_get_volume_buffered(), for counting the unique records buffered for
the page.
ibuf_get_volume_buffered(): Define hash_bitmap, a bit array for identifying
duplicate records. Hash collisions do not hurt correctness, only performance.
If the number of records on the page is estimated as 0, deletes will not be
buffered.
This patch is just for the record, as is rb://44. In the tests run so far,
the function ibuf_get_volume_buffered() always seems to estimate the number
of records as 0, disabling all buffered deletes.
------------------------------------------------------------------------
r2866 | marko | 2008-10-23 23:25:43 +0300 (Thu, 23 Oct 2008) | 4 lines
branches/zip: ibuf_delete_rec(): When the cursor to the insert buffer record
cannot be restored, do not complain if the tablespace does not exist.
This fixes Issue #88.
------------------------------------------------------------------------
r2867 | marko | 2008-10-24 10:24:17 +0300 (Fri, 24 Oct 2008) | 2 lines
branches/zip: ChangeLog: Document r2763, r2794, r2683, r2799, r2809, r2866.
------------------------------------------------------------------------
pages becoming empty. Remove work-arounds for empty pages. This fixes
Issue #82.
ibuf_get_volume_buffered(): Add the output parameter n_recs, for returning
the minimum number of records on the page.
ibuf_insert_low(): Refuse to buffer IBUF_OP_DELETE if the page could
become empty.
btr_page_get_father_node_ptr(): Remove the work-around for the page
being empty.
page_zip_dir_delete(): Revert to the version from branches/zip.
Always invoke page_zip_clear_rec().
------------------------------------------------------------------------
r2838 | vasil | 2008-10-21 12:49:27 +0300 (Tue, 21 Oct 2008) | 61 lines
branches/zip:
Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826):
------------------------------------------------------------------------
r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines
Changed paths:
M /branches/5.1/handler/ha_innodb.cc
branches/5.1:
In ha_innobase::info():
Replace sql_print_warning() which prints to mysqld error log with
push_warning_printf() which sends the error message to the client.
Suggested by: Marko, Sunny, Michael
Objected by: Inaam
------------------------------------------------------------------------
r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines
Changed paths:
M /branches/5.1/mysql-test/innodb-semi-consistent.result
M /branches/5.1/mysql-test/innodb-semi-consistent.test
M /branches/5.1/mysql-test/innodb.result
M /branches/5.1/mysql-test/innodb.test
branches/5.1:
Merge a change from MySQL (this fixes the failing innodb and
innodb-semi-consistent tests):
revno: 2757
committer: Georgi Kodinov <kgeorge@mysql.com>
branch nick: B39812-5.1-5.1.29-rc
timestamp: Fri 2008-10-03 15:24:19 +0300
message:
Bug #39812: Make statement replication default for 5.1 (to match 5.0)
Make STMT replication default for 5.1.
Add a default of MIXED into the config files
Fix the tests that needed MIXED replication mode.
modified:
mysql-test/include/mix1.inc
mysql-test/r/innodb-semi-consistent.result
mysql-test/r/innodb.result
mysql-test/r/innodb_mysql.result
mysql-test/r/tx_isolation_func.result
mysql-test/t/innodb-semi-consistent.test
mysql-test/t/innodb.test
mysql-test/t/tx_isolation_func.test
sql/mysqld.cc
support-files/my-huge.cnf.sh
support-files/my-innodb-heavy-4G.cnf.sh
support-files/my-large.cnf.sh
support-files/my-medium.cnf.sh
support-files/my-small.cnf.sh
------------------------------------------------------------------------
------------------------------------------------------------------------
r2847 | marko | 2008-10-22 10:07:37 +0300 (Wed, 22 Oct 2008) | 6 lines
branches/zip: page_zip_rec_needs_ext(): Fix a bug that was introduced
in the fix of Mantis issue #73. With key_block_size=16, we will also
have to check the available space on the uncompressed page.
Otherwise, the clustered index record can be almost 16 kilobytes in
size, and the undo log record will not fit.
------------------------------------------------------------------------
r2850 | marko | 2008-10-22 13:52:12 +0300 (Wed, 22 Oct 2008) | 2 lines
branches/zip: ibuf_insert_to_index_page(): Discard the local variable block.
page_cur is always positioned on block, the function parameter.
------------------------------------------------------------------------
r2853 | sunny | 2008-10-23 01:52:09 +0300 (Thu, 23 Oct 2008) | 2 lines
branches/zip: Add missing UNIV_INTERN.
------------------------------------------------------------------------
r2855 | sunny | 2008-10-23 09:29:46 +0300 (Thu, 23 Oct 2008) | 36 lines
branches/zip:
Merge revisions 2837:2852 from branches/5.1:
------------------------------------------------------------------------
r2849 | sunny | 2008-10-22 12:01:18 +0300 (Wed, 22 Oct 2008) | 8 lines
Changed paths:
M /branches/5.1/handler/ha_innodb.cc
M /branches/5.1/include/row0mysql.h
M /branches/5.1/row/row0mysql.c
branches/5.1: Return the actual error code encountered when allocating
a new autoinc value. The change in behavior (bug) was introduced in 5.1.22
when we introduced the new AUTOINC locking model.
rb://31
Bug#40224 New AUTOINC changes mask reporting of deadlock/timeout errors
------------------------------------------------------------------------
r2852 | sunny | 2008-10-23 01:42:24 +0300 (Thu, 23 Oct 2008) | 9 lines
Changed paths:
M /branches/5.1/handler/ha_innodb.cc
M /branches/5.1/handler/ha_innodb.h
branches/5.1: Backport r2724 from branches/zip
Check column value against the col max value before updating the table's
global autoinc counter value. This is part of simplifying the AUTOINC
sub-system. We extract the type info from MySQL data structures at runtime.
This fixes Bug#37788 InnoDB Plugin: AUTO_INCREMENT wrong for compressed tables
------------------------------------------------------------------------
------------------------------------------------------------------------
r2856 | sunny | 2008-10-23 10:07:05 +0300 (Thu, 23 Oct 2008) | 1 line
Reverting test file changes from r2855
------------------------------------------------------------------------
r2857 | sunny | 2008-10-23 10:24:33 +0300 (Thu, 23 Oct 2008) | 30 lines
branches/zip:
Merge revisions 2852:2854 from branches/5.1:
------------------------------------------------------------------------
r2854 | sunny | 2008-10-23 08:30:32 +0300 (Thu, 23 Oct 2008) | 13 lines
Changed paths:
M /branches/5.1/dict/dict0dict.c
M /branches/5.1/dict/dict0mem.c
M /branches/5.1/handler/ha_innodb.cc
M /branches/5.1/handler/ha_innodb.h
M /branches/5.1/include/dict0dict.h
M /branches/5.1/include/dict0mem.h
M /branches/5.1/row/row0mysql.c
branches/5.1: Backport changes from branches/zip r2725
Simplify the autoinc initialization code. This removes the
non-determinism related to reading the table's autoinc value for the first
time. This change has also reduced the sizeof dict_table_t by sizeof(ibool)
bytes because we don't need the dict_table_t::autoinc_inited field anymore.
Bug#39830 Table autoinc value not updated on first insert.
Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info
Bug#36411 Failed to read auto-increment value from storage engine" in 5.1.24 auto-inc
rb://16
------------------------------------------------------------------------
------------------------------------------------------------------------
r2858 | vasil | 2008-10-23 11:33:43 +0300 (Thu, 23 Oct 2008) | 4 lines
branches/zip:
Update the ChangeLog
------------------------------------------------------------------------
r2861 | marko | 2008-10-23 12:27:15 +0300 (Thu, 23 Oct 2008) | 24 lines
branches/zip: Clean up the file format stamping.
trx_sys_file_format_max_upgrade(): Rename from
trx_sys_file_format_max_update(). Improve the documentation. Add a
const qualifier to the parameter "name". Replace the parameter
"flags" with "format_id", because this function should deal with file
format identifiers, not with table flags.
trx_sys_file_format_max_write(), trx_sys_file_format_max_set(): Add a
const qualifier to the parameter "name".
ha_innodb.cc: Correct the spelling in some comments: "side effect".
Remove redundant prototypes for some static callback functions.
innodb_file_format_name_update(), innodb_file_format_check_update():
Correct the function signature. Use appropriate pointer type conversions.
MYSQL_SYSVAR_STR(file_format), MYSQL_SYSVAR_STR(file_format_check):
Remove the type conversions from the callback function pointers. When
the function signatures match, no type conversion is needed. The type
conversions would only prevent compilation warnings for any mismatch.
Approved by Sunny in rb://25.
------------------------------------------------------------------------
r2862 | marko | 2008-10-23 12:37:42 +0300 (Thu, 23 Oct 2008) | 8 lines
branches/zip: Non-functional changes:
ibuf_get_volume_buffered(): Declare with static linkage.
This function is private to ibuf0ibuf.c.
btr_cur_pessimistic_delete(): Use the cached result of
btr_cur_get_index(cursor).
------------------------------------------------------------------------
------------------------------------------------------------------------
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.
------------------------------------------------------------------------
This function was created when the delete buffering code was merged from
branches/fts in r2324.
ibuf_rec_get_size(): Rename the parameter new_format to pre_4_1. Use
the correct offsets and accessors for both values of pre_4_1.
ibuf_rec_get_info(): Note that the record must be in 4.1 or later format.
ibuf_get_entry_counter_low(): Rename from ibuf_set_entry_counter_low().
This function only reads the counter. Add const qualifier to the
rec parameter.
ibuf_set_entry_counter(): Document the entry parameter as in/out.
ibuf_rec_get_info(): Eliminate the local variable "mod". Use switch-case
instead of if-else if-else.
ibuf_rec_get_op_type(), ibuf_add_ops(), ibuf_print_ops():
Add const qualifiers to read-only parameters.
ibuf_rec_get_volume(): Remove empty line at end of block.
buf_pool->watch_ fields to start with the common prefix buf_pool_watch,
so that they can be searched easily:
buf_pool_watch_set(): Renamed from buf_pool_add_watch(). The "add" was
misleading, because only one watch can be active at a time.
buf_pool_watch_clear(): Renamed from buf_pool_remove_watch().
buf_pool_watch_occurred(): Renamed from buf_pool_watch_happened().
differences from branches/zip. The __attribute__((unused)) should
work on all platforms. When compiled with something else than GCC,
MySQL supposedly does #define __attribute__(x) /* empty */
so that the attributes will be ignored.
from branches/zip.
btr_cur_optimistic_delete(): Split a too long line in the way it is
split in branches/zip.
buf_page_get_gen(): Add missing space in the function comment.
buf_print_io(): Restoer a removed space to the printout.
univ.i: Remove C++-style (or C99-style) comments.
buf0buf.h: Undo the white-space changes to the wrapper macros of
buf_page_get_gen().
ibuf_update_free_bits_low(): Revert the changes. Restore the assertion
that this function must not be invoked on compressed pages. The function
ibuf_update_free_bits_zip() is for compressed pages.
ibuf_insert_to_index_page(): Undo a white-space change.
closer to branches/zip.
ibuf_size_update(): Add const qualifier to the parameter "root".
Remove #ifdef UNIV_SYNC_DEBUG around ut_ad(mutex_own()).
ibuf_page(): Use the variable name local_mtr instead of mtr_local, to
be more like existing functions. Eliminate the flag use_local_mtr.
ibuf_get_merge_page_nos(): Restore an "if (...) break; else if" to
"if (...) break; if" as in branches/zip.
ibuf_dummy_index_create(), ibuf_dummy_index_add_col(),
ibuf_contract_ext(), ibuf_insert_low(): Revert to the formatting of
branches/zip.
The followin mysql-tests failed (and they are known to fail):
main.information_schema [ fail ]
main.innodb_file_per_table_basic[ fail ]
main.type_bit_innodb [ fail ]
Tested against : MYSQL_SERVER_VERSION "5.1.28"
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.
innodb-index.test: Add a test with a large number of externally stored
columns. Check that there may not be prefix indexes on too many columns.
dict_index_too_big_for_undo(): New function: Check if the undo log may
overflow.
dict_index_add_to_cache(): Return DB_SUCCESS or DB_TOO_BIG_RECORD.
Postpone the creation and linking of some data structures, so that
when dict_index_too_big_for_undo() holds, it will be easier to clean up.
Check the return status in all callers.
contents end up with conflicting versions of a record's state. The zipped
page record was not being marked as "(un)deleted" because we were not
passing the zipped page contents to the (un)delete function, which first
(un)delete marks the uncompressed version and then based on whether
page_zip is NULL or not (un)delete marks the record in the compressed page.
buf_page_get_release_on_io(): Removed this unused function.
ibuf_build_entry_from_ibuf_rec(): Justify why it is not necessary to
add system columns to the dummy table pointed to by the dummy secondary index.
page_zip_rec_set_deleted(): Add a page_zip_validate() assertion.