Added option to disable multi-threaded flush with innodb_use_mtflush = 0
option, by default multi-threaded flush is used.
Updated innochecksum tool, still it does not support new checksums.
execution and global memory heap on shutdown.
Added a funcition to get work items from queue without waiting and
additional info when there is no work to do for a extended periods.
Update InnoDB to 5.6.14
Apply MySQL-5.6 hack for MySQL Bug#16434374
Move Aria-only HA_RTREE_INDEX from my_base.h to maria_def.h (breaks an assert in InnoDB)
Fix InnoDB memory leak
There are two threads. In one thread, dml operation is going on
involving cascaded update operation. In another thread, alter
table add foreign key constraint is happening. Under these
circumstances, it is possible for the dml thread to access a
dict_foreign_t object that has been freed by the ddl thread.
The debug sync test case provides the sequence of operations.
Without fix, the test case will crash the server (because of
newly added assert). With fix, the alter table stmt will return
an error message.
rb:947
approved by Jimmy Yang
InnoDB: Remove HAVE_purify, UNIV_INIT_MEM_TO_ZERO, UNIV_SET_MEM_TO_ZERO.
The compile-time setting HAVE_purify can mask potential bugs.
It is being set in PB2 Valgrind runs. We should simply get rid of it,
and replace it with UNIV_MEM_INVALID() to declare uninitialized memory
as such in Valgrind-instrumented binaries.
os_mem_alloc_large(), ut_malloc_low(): Remove the parameter set_to_zero.
ut_malloc(): Define as a macro that invokes ut_malloc_low().
buf_pool_init(): Never initialize the buffer pool frames. All pages
must be initialized before flushing them to disk.
mem_heap_alloc(): Never initialize the allocated memory block.
os_mem_alloc_nocache(), ut_test_malloc(): Unused function, remove.
rb:813 approved by Jimmy Yang
This fix was accidentally pushed to mysql-5.1 after the 5.1.59 clone-off in
bzr revision id marko.makela@oracle.com-20110829081642-z0w992a0mrc62s6w
with the fix of Bug#12704861 Corruption after a crash during BLOB update
but not merged to mysql-5.5 and upwards.
In the Barracuda formats, the clustered index record no longer
contains a prefix of off-page columns. Because of this, the undo log
must contain these prefixes, so that purge and multi-versioning will
continue to work. However, this also means that an undo log record can
become too big to fit in an undo log page. (It is a limitation of the
undo log that undo records cannot span across multiple pages.)
In case the checks for undo log size fail when CREATE TABLE or CREATE
INDEX is executed, we need a fallback that blocks a modification
operation when the undo log record would exceed the maximum size.
trx_undo_free_last_page_func(): Renamed from trx_undo_free_page_in_rollback().
Define the trx_t parameter only in debug builds.
trx_undo_free_last_page(): Wrapper for trx_undo_free_last_page_func().
Pass the trx_t parameter only in debug builds.
trx_undo_truncate_end_func(): Renamed from trx_undo_truncate_end().
Define the trx_t parameter only in debug builds. Rewrite a for(;;) loop
as a while loop for clarity.
trx_undo_truncate_end(): Wrapper for from trx_undo_truncate_end_func().
Pass the trx_t parameter only in debug builds.
trx_undo_erase_page_end(): Return TRUE if the page was non-empty
to begin with. Refuse to erase empty pages.
trx_undo_report_row_operation(): If the page for which the undo log
was too big was empty, free the undo page and return DB_TOO_BIG_RECORD.
rb:749 approved by Inaam Rana
Also addressed issues in bug #11745133, where we could mark a table
corrupted instead of crashing the server when found a corrupted buffer/page
if the table created with innodb_file_per_table on.
DB_COL_APPEARS_TWICE_IN_INDEX: Remove. This condition is already
checked and reported by MySQL before passing the index definition to
the storage engine.
row_create_index_for_mysql(): Remove the redundant check for
DB_COL_APPEARS_TWICE_IN_INDEX. When enforcing the column prefix index
limit, invoke dict_mem_index_free(index) to plug the memory leak. In
the loop, use index->n_def instead of dict_index_get_n_fields(index),
because the latter would be 0 for indexes that have not been copied to
the data dictionary cache.
innodb-use-sys-malloc.test:
Add test cases for attempting to trigger the error checks in
row_create_index_for_mysql(). Before MySQL 5.5 and WL#5743, the leak
is only reproducible if ha_innobase::max_supported_key_part_length()
returned a higher limit than the one used in
row_create_index_for_mysql().
In MySQL 5.5 and later, the leak is reproducible with
innodb_large_prefix=true.
rb:688 approved by Jimmy Yang
With this change, the index prefix column length lifted from 767 bytes
to 3072 bytes if "innodb_large_prefix" is set to "true".
rb://603 approved by Marko
Bug #11766501: Multiple RBS break the get rseg with mininum trx_t::no code during purge
Bug# 59291 changes:
Main problem is that truncating the UNDO log at the completion of every
trx_purge() call is expensive as the number of rollback segments is increased.
We truncate after a configurable amount of pages. The innodb_purge_batch_size
parameter is used to control when InnoDB does the actual truncate. The truncate
is done once after 128 (or TRX_SYS_N_RSEGS iterations). In other words we
truncate after purge 128 * innodb_purge_batch_size. The smaller the batch
size the quicker we truncate.
Introduce a new parameter that allows how many rollback segments to use for
storing REDO information. This is really step 1 in allowing complete control
to the user over rollback space management.
New parameters:
i) innodb_rollback_segments = number of rollback_segments to use
(default is now 128) dynamic parameter, can be changed anytime.
Currently there is little benefit in changing it from the default.
Optimisations in the patch.
i. Change the O(n) behaviour of trx_rseg_get_on_id() to O(log n)
Backported from 5.6. Refactor some of the binary heap code.
Create a new include/ut0bh.ic file.
ii. Avoid truncating the rollback segments after every purge.
Related changes that were moved to a separate patch:
i. Purge should not do any flushing, only wait for space to be free so that
it only does purging of records unless it is held up by a long running
transaction that is preventing it from progressing.
ii. Give the purge thread preference over transactions when acquiring the
rseg->mutex during commit. This to avoid purge blocking unnecessarily
when getting the next rollback segment to purge.
Bug #11766501 changes:
Add the rseg to the min binary heap under the cover of the kernel mutex and
the binary heap mutex. This ensures the ordering of the min binary heap.
The two changes have to be committed together because they share the same
that fixes both issues.
rb://567 Approved by: Inaam Rana.
1. BUG#32430 - 'show innodb status' causes errors Invalid (old?) table
or database name in logs
2. White space fixup
Detailed revision comments:
r6136 | marko | 2009-11-04 12:28:10 +0200 (Wed, 04 Nov 2009) | 15 lines
branches/5.1: Port r6134 from branches/zip:
------------------------------------------------------------------------
r6134 | marko | 2009-11-04 07:57:29 +0000 (Wed, 04 Nov 2009) | 5 lines
branches/zip: innobase_convert_identifier(): Convert table names with
explain_filename() to address Bug #32430: 'show innodb status'
causes errors Invalid (old?) table or database name in logs.
rb://134 approved by Sunny Bains
------------------------------------------------------------------------
innobase_print_identifier(): Replace with innobase_convert_name().
innobase_convert_identifier(): New function, called by innobase_convert_name().
r6152 | vasil | 2009-11-10 15:30:20 +0200 (Tue, 10 Nov 2009) | 4 lines
branches/5.1:
White space fixup.
layout as we always had in trees containing only the builtin
2) win\configure.js WITH_INNOBASE_STORAGE_ENGINE still works.
storage/innobase/CMakeLists.txt:
fix to new directory name (and like 5.1)
storage/innobase/Makefile.am:
fix to new directory name (and like 5.1)
storage/innobase/handler/ha_innodb.cc:
fix to new directory name (and like 5.1)
storage/innobase/plug.in:
fix to new directory name (and like 5.1)
bzr branch mysql-5.1-performance-version mysql-trunk # Summit
cd mysql-trunk
bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin
bzr rm innobase # remove the builtin
Next step: build, test fixes.
Bug #36819: ut_usectime does not handle errors from gettimeofday
Detailed revision comments:
r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines
branches/5.1:
Fix Bug#36819 ut_usectime does not handle errors from gettimeofday
by retrying gettimeofday() several times if it fails in ut_usectime().
If it fails on all calls then return error to the caller to be handled
at higher level.
Update the variable innodb_row_lock_time_max in SHOW STATUS output only
if ut_usectime() was successful.
Fixes the following bugs:
Bug #30706: SQL thread on slave is allowed to block client queries when slave load is high
Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
Bug #30888: Innodb table + stored procedure + row deletion = server crash
While adding code for the low level read of the AUTOINC value from the index,
the case for MEDIUM ints which are 3 bytes was missed triggering an
assertion.
Bug #30907: Regression: "--innodb_autoinc_lock_mode=0" (off) not same as older releases
We don't rely on *first_value to be 0 when checking whether
get_auto_increment() has been invoked for the first time in a multi-row
INSERT. We instead use trx_t::n_autoinc_rows. Initialize trx::n_autoinc_rows
inside ha_innobase::start_stmt() too.
Bug #31444: "InnoDB: Error: MySQL is freeing a thd" in innodb_mysql.test
ha_innobase::external_lock(): Update prebuilt->mysql_has_locked and
trx->n_mysql_tables_in_use only after row_lock_table_for_mysql() returns
DB_SUCCESS. A timeout on LOCK TABLES would lead to an inconsistent state,
which would cause trx_free() to print a warning.
Bug #31494: innodb + 5.1 + read committed crash, assertion
Set an error code when a deadlock occurs in semi-consistent read.
mysql-test/r/innodb.result:
Apply snapshot innodb-5.1-ss1989
Also, a test is moved into the new innodb_autoinc_lock_mode_zero
test, because it depends on a non-default setting for a read-only
variable.
Revision r1821:
Merge a change from MySQL AB:
ChangeSet@1.2536.50.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.
innodb.result: Adjusted results for test cases affected fy the fix for
bug #28404.
Revision r1781:
Fix a test case that was broken after Bug#16979 fix. See r1645 and r1735.
The variable used in the tests below was introduced in r1735.
Revision r1792:
innodb.result: Revert r1655, which should have been reverted as part of r1781.
Revision r1843:
Add test for Bug# 21409, the actual bug was fixed in r1334.
mysql-test/t/innodb.test:
Apply snapshot innodb-5.1-ss1989
Also, a test is moved into the new innodb_autoinc_lock_mode_zero
test, because it depends on a non-default setting for a read-only
variable.
Revision r1781:
Fix a test case that was broken after Bug#16979 fix. See r1645 and r1735.
The variable used in the tests below was introduced in r1735.
Revision r1843:
Add test for Bug# 21409, the actual bug was fixed in r1334.
storage/innobase/buf/buf0lru.c:
Apply snapshot innodb-5.1-ss1989
Revision r1819:
Merge r1815:1817 from branches/zip: Improve Valgrind instrumentation.
UNIV_MEM_ASSERT_RW(): New macro, to check that the contents of a memory
area is defined.
UNIV_MEM_ASSERT_W(): New macro, to check that a memory area is writable.
UNIV_MEM_ASSERT_AND_FREE(): New macro, to check that the memory is
writable before declaring it free (unwritable). This replaces UNIV_MEM_FREE()
in many places.
mem_init_buf(): Check that the memory is writable, and declare it undefined.
mem_erase_buf(): Check that the memory is writable, and declare it freed.
storage/innobase/dict/dict0dict.c:
Apply snapshot innodb-5.1-ss1989
Revision r1894:
Add debug lock checks to autoinc functions. Add lock guards around an
invocation of dict_table_autoinc_initialize().
storage/innobase/dict/dict0load.c:
Apply snapshot innodb-5.1-ss1989
Revision r1974:
Prevent loading of tables that have unsupported features most notably
FTS indexes.
storage/innobase/handler/ha_innodb.cc:
Apply snapshot innodb-5.1-ss1989
Revision r1850:
Implement this feature request:
http://bugs.mysql.com/30706
* Add a function that returns the number of microseconds since
epoch - ut_time_us().
* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
until a timeout elapses.
* Using all of the above, handle the replication thread specially in
srv_conc_enter_innodb().
Approved by: Heikki
Revision r1887:
Merge changes from MySQL AB:
ChangeSet@1.2528.115.25 2007-08-27 18:18:14-06:00 tsmith@hindu.god
Fix some Windows compiler warnings.
dict0mem.c: Fix compiler warning with a cast.
ha_innodb.cc: Change type to fix a compiler warning.
Revision r1809:
ha_innobase::external_lock(): Update prebuilt->mysql_has_locked and
trx->n_mysql_tables_in_use only after row_lock_table_for_mysql()
returns DB_SUCCESS. A timeout on LOCK TABLES would lead to an
inconsistent state, which would cause trx_free() to print a warning.
This was later reported as Bug #31444.
Revision r1833:
Add /*== ... === */ decoration that was missing around some auto-inc functions.
Add a missing comment, fix the length of a decoration. Initialize the *value
out parameter in ha_innobase::innobase_get_auto_increment().
Revision r1866:
Revert r1850 as MySQL did not approve the addition.
log for r1850:
Implement this feature request:
http://bugs.mysql.com/30706
* Add a function that returns the number of microseconds since
epoch - ut_time_us().
* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
until a timeout elapses.
* Using all of the above, handle the replication thread specially in
srv_conc_enter_innodb().
Revision r1846:
Add config option innodb_use_adaptive_hash_indexes to enable/disable
adaptive hash indexes. It is enabled by default (no change in default
behavior).
Approved by: Marko
Revision r1974:
Prevent loading of tables that have unsupported features most notably
FTS indexes.
Revision r1829:
Add assertion to enforce check of an implicit invariant and add comment about
retry of autoinc read semantics. We always reread the table's autoinc counter
after attempting to initialize it i.e., we want to guarantee that a read of
autoinc valus that is returned to the caller is always covered by the
AUTOINC locking mechanism.
Revision r1787:
Move the prototype of innobase_print_identifier() from ut0ut.c to
ha_prototypes.h. Enclose the definitions in ha_prototypes.h in
#ifndef UNIV_HOTBACKUP.
Revision r1888:
Merge a change from MySQL AB:
ChangeSet@1.2528.115.30 2007-08-28 10:17:15-06:00 tsmith@hindu.god
Fix another compiler warning on Windows in InnoDB.
ha_innodb.cc:
Fix compiler warning: ::get_auto_increment takes a ulonglong
for nb_desired_values, but InnoDB's trx struct stores it as
a ulint (unsigned long). Probably harmless, as a single
statement won't be asking for more than 2^32 rows.
Revision r1987:
Bug fix: The problem was that when write_row() attempted to update the max
autoinc value, and if it was rolled back because of a deadlock, the
deadlock error (transaction rollback) was not being propagated back to MySQL.
Revision r1889:
Merge a change from MySQL AB:
ChangeSet@1.2560 2007-09-21 10:15:16+02:00 gkodinov@local
ha_innodb.cc: fixed type conversion warnings revealed by bug 30639
Revision r1989:
Suppress printing of deadlock errors while reading the autoinc value.
DB_DEADLOCK errors are part of normal processing and excessive printing
of these error messages could be disconcerting for users.
Revision r1828:
Fix two bugs:
Bug# 30907: We don't rely on *first_value to be 0 when checking whether
get_auto_increment() has been invoked for the first time in a multi-row
INSERT. We instead use trx_t::n_autoinc_rows. Initialize trx::n_autoinc_rows
inside ha_innobase::start_stmt() too.
Bug# 30888: While adding code for the low level read of the AUTOINC value
from the index, the case for MEDIUM ints which are 3 bytes was missed
triggering an assertion.
storage/innobase/handler/ha_innodb.h:
Apply snapshot innodb-5.1-ss1989
Revision r1844:
Remove the prototypes of some functions inside #if 0.
The function definitions were removed in r1746.
storage/innobase/ibuf/ibuf0ibuf.c:
Apply snapshot innodb-5.1-ss1989
Revision r1965:
ibuf_insert_to_index_page(): Fix typos in diagnostic output.
storage/innobase/include/db0err.h:
Apply snapshot innodb-5.1-ss1989
Revision r1974:
Prevent loading of tables that have unsupported features most notably
FTS indexes.
storage/innobase/include/ha_prototypes.h:
Apply snapshot innodb-5.1-ss1989
Revision r1787:
Move the prototype of innobase_print_identifier() from ut0ut.c to
ha_prototypes.h. Enclose the definitions in ha_prototypes.h in
#ifndef UNIV_HOTBACKUP.
storage/innobase/include/mach0data.h:
Apply snapshot innodb-5.1-ss1989
Revision r1779:
Fix a bug that handles the case where the host specific byte order matches
the InnoDB storage byte order, which is big-endian.
storage/innobase/include/mach0data.ic:
Apply snapshot innodb-5.1-ss1989
Revision r1779:
Fix a bug that handles the case where the host specific byte order matches
the InnoDB storage byte order, which is big-endian.
storage/innobase/include/mem0dbg.h:
Apply snapshot innodb-5.1-ss1989
Revision r1830:
Improve memory debugging. This is follow-up to r1819.
mem_heap_validate(): Compile this function also if UNIV_MEM_DEBUG is
defined. Previously, this function was only compiled with UNIV_DEBUG.
mem_heap_free_heap_top(): Flag the memory allocated, not freed, for
Valgrind. Otherwise, Valgrind would complain on the second call of
mem_heap_empty().
UNIV_MEM_ASSERT_RW(), UNIV_MEM_ASSERT_W(): Display additional diagnostics
for failed Valgrind checks.
storage/innobase/include/mem0mem.ic:
Apply snapshot innodb-5.1-ss1989
Revision r1830:
Improve memory debugging. This is follow-up to r1819.
mem_heap_validate(): Compile this function also if UNIV_MEM_DEBUG is
defined. Previously, this function was only compiled with UNIV_DEBUG.
mem_heap_free_heap_top(): Flag the memory allocated, not freed, for
Valgrind. Otherwise, Valgrind would complain on the second call of
mem_heap_empty().
UNIV_MEM_ASSERT_RW(), UNIV_MEM_ASSERT_W(): Display additional diagnostics
for failed Valgrind checks.
Revision r1937:
mem_heap_free_top(): Remove a bogus Valgrind warning.
Revision r1819:
Merge r1815:1817 from branches/zip: Improve Valgrind instrumentation.
UNIV_MEM_ASSERT_RW(): New macro, to check that the contents of a memory
area is defined.
UNIV_MEM_ASSERT_W(): New macro, to check that a memory area is writable.
UNIV_MEM_ASSERT_AND_FREE(): New macro, to check that the memory is
writable before declaring it free (unwritable). This replaces UNIV_MEM_FREE()
in many places.
mem_init_buf(): Check that the memory is writable, and declare it undefined.
mem_erase_buf(): Check that the memory is writable, and declare it freed.
storage/innobase/include/rem0rec.ic:
Apply snapshot innodb-5.1-ss1989
Revision r1918:
Improve Valgrind instrumentation.
rec_offs_set_n_alloc(): Use UNIV_MEM_ASSERT_AND_ALLOC().
UNIV_MEM_ASSERT_AND_ALLOC(): New directive, similar to
UNIV_MEM_ASSERT_AND_FREE().
storage/innobase/include/row0mysql.h:
Apply snapshot innodb-5.1-ss1989
Revision r1783:
Correct the function comments of row_create_table_for_mysql() and
row_drop_table_for_mysql().
storage/innobase/include/sync0rw.h:
Apply snapshot innodb-5.1-ss1989
Revision r1757:
Enclose rw_lock_validate() in #ifdef UNIV_DEBUG. It is only called by
debug assertions.
storage/innobase/include/univ.i:
Apply snapshot innodb-5.1-ss1989
Revision r1827:
Merge r1826 from branches/zip: UNIV_MEM_ASSERT_AND_FREE():
Use UNIV_MEM_ASSERT_W() instead of UNIV_MEM_ASSERT_RW().
The memory area need not be initialized.
This mistake was made in r1815.
Revision r1918:
Improve Valgrind instrumentation.
rec_offs_set_n_alloc(): Use UNIV_MEM_ASSERT_AND_ALLOC().
UNIV_MEM_ASSERT_AND_ALLOC(): New directive, similar to
UNIV_MEM_ASSERT_AND_FREE().
Revision r1830:
Improve memory debugging. This is follow-up to r1819.
mem_heap_validate(): Compile this function also if UNIV_MEM_DEBUG is
defined. Previously, this function was only compiled with UNIV_DEBUG.
mem_heap_free_heap_top(): Flag the memory allocated, not freed, for
Valgrind. Otherwise, Valgrind would complain on the second call of
mem_heap_empty().
UNIV_MEM_ASSERT_RW(), UNIV_MEM_ASSERT_W(): Display additional diagnostics
for failed Valgrind checks.
Revision r1819:
Merge r1815:1817 from branches/zip: Improve Valgrind instrumentation.
UNIV_MEM_ASSERT_RW(): New macro, to check that the contents of a memory
area is defined.
UNIV_MEM_ASSERT_W(): New macro, to check that a memory area is writable.
UNIV_MEM_ASSERT_AND_FREE(): New macro, to check that the memory is
writable before declaring it free (unwritable). This replaces UNIV_MEM_FREE()
in many places.
mem_init_buf(): Check that the memory is writable, and declare it undefined.
mem_erase_buf(): Check that the memory is writable, and declare it freed.
Revision r1948:
UNIV_MEM_ASSERT_RW(), UNIV_MEM_ASSERT_W(): Display also __FILE__ and __LINE__
when these Valgrind checks fail.
storage/innobase/include/ut0ut.h:
Apply snapshot innodb-5.1-ss1989
Revision r1850:
Implement this feature request:
http://bugs.mysql.com/30706
* Add a function that returns the number of microseconds since
epoch - ut_time_us().
* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
until a timeout elapses.
* Using all of the above, handle the replication thread specially in
srv_conc_enter_innodb().
Approved by: Heikki
Revision r1862:
Add ut_snprintf() function. On Windows this needs to be implemented
using auxiliary functions because there is no snprintf-variant on
Windows that behaves exactly as specified in the standard:
* Always return the number of characters that would have been printed
if the size were unlimited (not including the final `\0').
* Always '\0'-terminate the result
* Do not touch the buffer if size=0, only return the number of characters
that would have been printed. Can be used to estimate the size needed
and to allocate it dynamically.
See http://www.freebsd.org/cgi/query-pr.cgi?pr=87260 for the reason why
2 ap variables are used.
Approved by: Heikki
Revision r1866:
Revert r1850 as MySQL did not approve the addition.
log for r1850:
Implement this feature request:
http://bugs.mysql.com/30706
* Add a function that returns the number of microseconds since
epoch - ut_time_us().
* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
until a timeout elapses.
* Using all of the above, handle the replication thread specially in
srv_conc_enter_innodb().
storage/innobase/mem/mem0dbg.c:
Apply snapshot innodb-5.1-ss1989
Revision r1830:
Improve memory debugging. This is follow-up to r1819.
mem_heap_validate(): Compile this function also if UNIV_MEM_DEBUG is
defined. Previously, this function was only compiled with UNIV_DEBUG.
mem_heap_free_heap_top(): Flag the memory allocated, not freed, for
Valgrind. Otherwise, Valgrind would complain on the second call of
mem_heap_empty().
UNIV_MEM_ASSERT_RW(), UNIV_MEM_ASSERT_W(): Display additional diagnostics
for failed Valgrind checks.
Revision r1819:
Merge r1815:1817 from branches/zip: Improve Valgrind instrumentation.
UNIV_MEM_ASSERT_RW(): New macro, to check that the contents of a memory
area is defined.
UNIV_MEM_ASSERT_W(): New macro, to check that a memory area is writable.
UNIV_MEM_ASSERT_AND_FREE(): New macro, to check that the memory is
writable before declaring it free (unwritable). This replaces UNIV_MEM_FREE()
in many places.
mem_init_buf(): Check that the memory is writable, and declare it undefined.
mem_erase_buf(): Check that the memory is writable, and declare it freed.
storage/innobase/mem/mem0mem.c:
Apply snapshot innodb-5.1-ss1989
Revision r1819:
Merge r1815:1817 from branches/zip: Improve Valgrind instrumentation.
UNIV_MEM_ASSERT_RW(): New macro, to check that the contents of a memory
area is defined.
UNIV_MEM_ASSERT_W(): New macro, to check that a memory area is writable.
UNIV_MEM_ASSERT_AND_FREE(): New macro, to check that the memory is
writable before declaring it free (unwritable). This replaces UNIV_MEM_FREE()
in many places.
mem_init_buf(): Check that the memory is writable, and declare it undefined.
mem_erase_buf(): Check that the memory is writable, and declare it freed.
storage/innobase/row/row0mysql.c:
Apply snapshot innodb-5.1-ss1989
Revision r1786:
row_create_table_for_mysql(), row_truncate_table_for_mysql(),
row_drop_table_for_mysql(): Do not mention innodb_force_recovery
when newraw is set.
Revision r1790:
row_drop_table_for_mysql(): Before calling
dict_table_remove_from_cache(table) and thus freeing the memory
allocated for the table, copy the table name. This avoids reading
freed memory when name == table->name.
Approved by Sunny.
Revision r1783:
Correct the function comments of row_create_table_for_mysql() and
row_drop_table_for_mysql().
Revision r1894:
Add debug lock checks to autoinc functions. Add lock guards around an
invocation of dict_table_autoinc_initialize().
storage/innobase/row/row0sel.c:
Apply snapshot innodb-5.1-ss1989
Revision r1782:
Add comment that the variable dest should be word aligned. After discussion
on IM with Heikki.
Revision r1988:
Set an error code when a deadlock occurs in semi-consistent read. (Bug #31494)
innodb-semi-consistent: New tests for InnoDB semi-consistent reads.
Unfortunately, these will not trigger Bug #31494, because there merely
occur lock wait timeouts, not deadlocks.
Revision r1820:
Use the clustered index and not the one selected by the optimizer in the plan,
when building a previous version of the row. This bug is triggered when
running queries via InnoDB's internal SQL parser; when InnoDB's optimizer
selects a secondary index for the plan.
Revision r1828:
Fix two bugs:
Bug# 30907: We don't rely on *first_value to be 0 when checking whether
get_auto_increment() has been invoked for the first time in a multi-row
INSERT. We instead use trx_t::n_autoinc_rows. Initialize trx::n_autoinc_rows
inside ha_innobase::start_stmt() too.
Bug# 30888: While adding code for the low level read of the AUTOINC value
from the index, the case for MEDIUM ints which are 3 bytes was missed
triggering an assertion.
Revision r1779:
Fix a bug that handles the case where the host specific byte order matches
the InnoDB storage byte order, which is big-endian.
storage/innobase/sync/sync0rw.c:
Apply snapshot innodb-5.1-ss1989
Revision r1757:
Enclose rw_lock_validate() in #ifdef UNIV_DEBUG. It is only called by
debug assertions.
storage/innobase/ut/ut0ut.c:
Apply snapshot innodb-5.1-ss1989
Revision r1850:
Implement this feature request:
http://bugs.mysql.com/30706
* Add a function that returns the number of microseconds since
epoch - ut_time_us().
* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
until a timeout elapses.
* Using all of the above, handle the replication thread specially in
srv_conc_enter_innodb().
Approved by: Heikki
Revision r1873:
snprintf() should always return non-negative result. According to
Microsoft documentation about _vscprintf():
If format is a null pointer, the invalid parameter handler is invoked,
as described in Parameter Validation. If execution is allowed to
continue, the functions return -1 and set errno to EINVAL.
The UNIX variant of snprintf() segfaults if format is a NULL pointer
(similar to strlen(NULL) for example), so it is better to conform to
this behavior and crash our custom Windows version instead of
returning -1. Noone would expect -1 to be returned from snprintf().
Cosmetic: Add a space after typecast.
Approved by: Marko
Revision r1862:
Add ut_snprintf() function. On Windows this needs to be implemented
using auxiliary functions because there is no snprintf-variant on
Windows that behaves exactly as specified in the standard:
* Always return the number of characters that would have been printed
if the size were unlimited (not including the final `\0').
* Always '\0'-terminate the result
* Do not touch the buffer if size=0, only return the number of characters
that would have been printed. Can be used to estimate the size needed
and to allocate it dynamically.
See http://www.freebsd.org/cgi/query-pr.cgi?pr=87260 for the reason why
2 ap variables are used.
Approved by: Heikki
Revision r1866:
Revert r1850 as MySQL did not approve the addition.
log for r1850:
Implement this feature request:
http://bugs.mysql.com/30706
* Add a function that returns the number of microseconds since
epoch - ut_time_us().
* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.
* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
until a timeout elapses.
* Using all of the above, handle the replication thread specially in
srv_conc_enter_innodb().
Revision r1787:
Move the prototype of innobase_print_identifier() from ut0ut.c to
ha_prototypes.h. Enclose the definitions in ha_prototypes.h in
#ifndef UNIV_HOTBACKUP.
Revision r1789:
ut_print_namel(): Do not assume that all '/' are separators between
database and table names.
Approved by Heikki.
Revision r1936:
ut_print_buf(): Add a Valgrind check that the buffer is wholly defined.
mysql-test/r/innodb-semi-consistent.result:
Apply snapshot innodb-5.1-ss1989
Revision r1988:
Set an error code when a deadlock occurs in semi-consistent read. (Bug #31494)
innodb-semi-consistent: New tests for InnoDB semi-consistent reads.
Unfortunately, these will not trigger Bug #31494, because there merely
occur lock wait timeouts, not deadlocks.
mysql-test/r/innodb_autoinc_lock_mode_zero.result:
New test, using read-only setting --innodb-autoinc-lock-mode=0
mysql-test/t/innodb-semi-consistent-master.opt:
Apply snapshot innodb-5.1-ss1989
Revision r1988:
Set an error code when a deadlock occurs in semi-consistent read. (Bug #31494)
innodb-semi-consistent: New tests for InnoDB semi-consistent reads.
Unfortunately, these will not trigger Bug #31494, because there merely
occur lock wait timeouts, not deadlocks.
mysql-test/t/innodb-semi-consistent.test:
Apply snapshot innodb-5.1-ss1989
Revision r1988:
Set an error code when a deadlock occurs in semi-consistent read. (Bug #31494)
innodb-semi-consistent: New tests for InnoDB semi-consistent reads.
Unfortunately, these will not trigger Bug #31494, because there merely
occur lock wait timeouts, not deadlocks.
mysql-test/t/innodb_autoinc_lock_mode_zero-master.opt:
New test, using read-only setting --innodb-autoinc-lock-mode=0
mysql-test/t/innodb_autoinc_lock_mode_zero.test:
New test, using read-only setting --innodb-autoinc-lock-mode=0
Fixes:
- Bug #23710: crash_commit_before fails if innodb_file_per_table=1
- Bug #28254: innodb crash if shutdown during innodb_table_monitor is running
- Bug #28604: innodb_force_recovery restricts data dump
- Bug #29097: fsp_get_available_space_in_free_extents() is capped at 4TB
- Bug #29155: Innodb "Parallel recovery" is not prevented
storage/innobase/Makefile.am:
Apply snapshot innodb-51-ss1644
Revision r1632:
Add include/lock0priv.h to noinst_HEADERS in Makefile.am.
Revision r1636:
Move lock_get_type() from lock/lock0lock.c to include/lock0priv.ic:
* lock0lock.c: remove lock_get_type() and include include/lock0priv.ic
* lock0priv.h: include lock0priv.ic and add lock_get_type() prototype
* Makefile.am: add lock0priv.ic to noinst_HEADERS
* lock0priv.ic: introduce this new file containing the body of
lock_get_type()
This move is necessary in order to use lock_get_type() from other lock/
source files (it's going to be used in lock/lock0iter.c).
Approved by: Heikki
Revision r1638:
Introduce a lock queue iterator for easy (and opaque) traversing of lock
queues. Supports table and record lock queues via the same interface.
There is only "get previous" method because currently there is no need
for "get next" - it would be unused. Feel free to add one if needed.
Approved by: Heikki
storage/innobase/buf/buf0buf.c:
Apply snapshot innodb-51-ss1644
Revision r1624:
Fix change missed as part of Bug 15815. Use a function to check if a block
needs to be made younger.
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/buf/buf0lru.c:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/fsp/fsp0fsp.c:
Apply snapshot innodb-51-ss1644
Revision r1605:
Fix Bug#29097 "fsp_get_available_space_in_free_extents() is capped at 4TB"
by typecasting the variables before multiplying them, so that the result of
the multiplication is of type "unsigned long long".
I verified this fix by creating a sparse file of 6TB and forcing InnoDB to
use it without overwriting it with zeroes (by commenting the code that
overwrites :newraw files).
New type ullint is introduced with the sole purpose of shortening
"unsigned long long", please do not define it to something else than
"unsigned long long".
Approved by: Heikki
storage/innobase/handler/ha_innodb.cc:
Apply snapshot innodb-51-ss1644
Revision r1605:
Fix Bug#29097 "fsp_get_available_space_in_free_extents() is capped at 4TB"
by typecasting the variables before multiplying them, so that the result of
the multiplication is of type "unsigned long long".
I verified this fix by creating a sparse file of 6TB and forcing InnoDB to
use it without overwriting it with zeroes (by commenting the code that
overwrites :newraw files).
New type ullint is introduced with the sole purpose of shortening
"unsigned long long", please do not define it to something else than
"unsigned long long".
Approved by: Heikki
Revision r1573:
create_table_def(): Eliminate the inline function call to dict_table_is_comp()
that was introduced in r1571. Inlining is disabled in ha_innodb.cc.
Revision r1574:
innodb_check_for_record_too_big_error(): Divide the return value of
page_get_free_space_of_empty_noninline() by 2. Until r1571, that function
did not return the same value as page_get_free_space_of_empty().
Revision r1571:
Fix a severe bug that was introduced in r1422 when fixing Bug 21101.
When creating an index containing a too long record, InnoDB would
dereference a NULL pointer when trying to determine the maximum row length.
innodb_check_for_record_too_big_error(): Replace the dict_table_t*
parameter with a Boolean flag. There is not always a dict_table_t object
when this function is called.
page_get_free_space_of_empty_noninline(): Move the definition and
declaration from row0mysql (!) to page0page. Make the signature
identical with page_get_free_space_of_empty().
create_clustered_index_when_no_primary(): Add the parameter "comp".
Remove unnecessary casts.
storage/innobase/include/buf0buf.ic:
Apply snapshot innodb-51-ss1644
Revision r1624:
Fix change missed as part of Bug 15815. Use a function to check if a block
needs to be made younger.
storage/innobase/include/fsp0fsp.h:
Apply snapshot innodb-51-ss1644
Revision r1605:
Fix Bug#29097 "fsp_get_available_space_in_free_extents() is capped at 4TB"
by typecasting the variables before multiplying them, so that the result of
the multiplication is of type "unsigned long long".
I verified this fix by creating a sparse file of 6TB and forcing InnoDB to
use it without overwriting it with zeroes (by commenting the code that
overwrites :newraw files).
New type ullint is introduced with the sole purpose of shortening
"unsigned long long", please do not define it to something else than
"unsigned long long".
Approved by: Heikki
storage/innobase/include/lock0lock.h:
Apply snapshot innodb-51-ss1644
Revision r1623:
Fix typo in comment.
Revision r1628:
lock_has_to_wait() is needed in the INFORMATION_SCHEMA implementation
in order to determine which lock is blocking which. Make it non-static
and put its definition in include/lock0lock.h.
Approved by: Heikki (via IM)
storage/innobase/include/mem0mem.ic:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/include/page0page.h:
Apply snapshot innodb-51-ss1644
Revision r1571:
Fix a severe bug that was introduced in r1422 when fixing Bug 21101.
When creating an index containing a too long record, InnoDB would
dereference a NULL pointer when trying to determine the maximum row length.
innodb_check_for_record_too_big_error(): Replace the dict_table_t*
parameter with a Boolean flag. There is not always a dict_table_t object
when this function is called.
page_get_free_space_of_empty_noninline(): Move the definition and
declaration from row0mysql (!) to page0page. Make the signature
identical with page_get_free_space_of_empty().
create_clustered_index_when_no_primary(): Add the parameter "comp".
Remove unnecessary casts.
storage/innobase/include/row0mysql.h:
Apply snapshot innodb-51-ss1644
Revision r1571:
Fix a severe bug that was introduced in r1422 when fixing Bug 21101.
When creating an index containing a too long record, InnoDB would
dereference a NULL pointer when trying to determine the maximum row length.
innodb_check_for_record_too_big_error(): Replace the dict_table_t*
parameter with a Boolean flag. There is not always a dict_table_t object
when this function is called.
page_get_free_space_of_empty_noninline(): Move the definition and
declaration from row0mysql (!) to page0page. Make the signature
identical with page_get_free_space_of_empty().
create_clustered_index_when_no_primary(): Add the parameter "comp".
Remove unnecessary casts.
storage/innobase/include/univ.i:
Apply snapshot innodb-51-ss1644
Revision r1605:
Fix Bug#29097 "fsp_get_available_space_in_free_extents() is capped at 4TB"
by typecasting the variables before multiplying them, so that the result of
the multiplication is of type "unsigned long long".
I verified this fix by creating a sparse file of 6TB and forcing InnoDB to
use it without overwriting it with zeroes (by commenting the code that
overwrites :newraw files).
New type ullint is introduced with the sole purpose of shortening
"unsigned long long", please do not define it to something else than
"unsigned long long".
Approved by: Heikki
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/lock/lock0lock.c:
Apply snapshot innodb-51-ss1644
Revision r1631:
Move lock_rec_find_set_bit() and lock_rec_get_prev() from
lock/lock0lock.c to include/lock0priv.h and make them non-static.
They will be used in lock/lock0iter.c.
Approved by: Heikki
Revision r1636:
Move lock_get_type() from lock/lock0lock.c to include/lock0priv.ic:
* lock0lock.c: remove lock_get_type() and include include/lock0priv.ic
* lock0priv.h: include lock0priv.ic and add lock_get_type() prototype
* Makefile.am: add lock0priv.ic to noinst_HEADERS
* lock0priv.ic: introduce this new file containing the body of
lock_get_type()
This move is necessary in order to use lock_get_type() from other lock/
source files (it's going to be used in lock/lock0iter.c).
Approved by: Heikki
Revision r1628:
lock_has_to_wait() is needed in the INFORMATION_SCHEMA implementation
in order to determine which lock is blocking which. Make it non-static
and put its definition in include/lock0lock.h.
Approved by: Heikki (via IM)
Revision r1629:
Add "const" qualifiers to lock_get_type() and lock_get_mode().
Approved by: Sunny
Revision r1626:
Move lock_*struct structures from lock/lock0lock.c to include/lock0priv.h.
This is needed in order to add more code to lock/ that uses members of
these structures (internal to the lock module) but in a separate file,
rather than lock0lock.c. lock0lock.c is a way too big already.
Approved by: Sunny
storage/innobase/log/log0recv.c:
Apply snapshot innodb-51-ss1644
Revision r1607:
Bug#23710
At InnoDB startup consider the case where log scan went beyond checkpoint_lsn as a crash and initiate crash recovery code path.
reviewed by: Heikki
storage/innobase/mem/mem0mem.c:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/mem/mem0pool.c:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/os/os0file.c:
Apply snapshot innodb-51-ss1644
Revision r1613:
Fix Bug#29155 by enabling file locking on FreeBSD.
It has been disabled because InnoDB has refused to start on
FreeBSD & LinuxThreads, but now it starts just fine.
Approved by: Heikki
storage/innobase/page/page0page.c:
Apply snapshot innodb-51-ss1644
Revision r1571:
Fix a severe bug that was introduced in r1422 when fixing Bug 21101.
When creating an index containing a too long record, InnoDB would
dereference a NULL pointer when trying to determine the maximum row length.
innodb_check_for_record_too_big_error(): Replace the dict_table_t*
parameter with a Boolean flag. There is not always a dict_table_t object
when this function is called.
page_get_free_space_of_empty_noninline(): Move the definition and
declaration from row0mysql (!) to page0page. Make the signature
identical with page_get_free_space_of_empty().
create_clustered_index_when_no_primary(): Add the parameter "comp".
Remove unnecessary casts.
storage/innobase/rem/rem0rec.c:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/row/row0mysql.c:
Apply snapshot innodb-51-ss1644
Revision r1571:
Fix a severe bug that was introduced in r1422 when fixing Bug 21101.
When creating an index containing a too long record, InnoDB would
dereference a NULL pointer when trying to determine the maximum row length.
innodb_check_for_record_too_big_error(): Replace the dict_table_t*
parameter with a Boolean flag. There is not always a dict_table_t object
when this function is called.
page_get_free_space_of_empty_noninline(): Move the definition and
declaration from row0mysql (!) to page0page. Make the signature
identical with page_get_free_space_of_empty().
create_clustered_index_when_no_primary(): Add the parameter "comp".
Remove unnecessary casts.
storage/innobase/sync/sync0rw.c:
Apply snapshot innodb-51-ss1644
Revision r1598:
Add some comments.
Approved by: Heikki (via IM)
storage/innobase/sync/sync0sync.c:
Apply snapshot innodb-51-ss1644
Revision r1598:
Add some comments.
Approved by: Heikki (via IM)
storage/innobase/trx/trx0sys.c:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.
storage/innobase/trx/trx0trx.c:
Apply snapshot innodb-51-ss1644
Revision r1595:
trx_commit_for_mysql(): Avoid acquiring and releasing kernel_mutex when
trx->sess or trx_dummy_sess is non-NULL.
storage/innobase/ut/ut0mem.c:
Apply snapshot innodb-51-ss1644
Revision r1581:
Port extra Valgrind instrumentation (UNIV_DEBUG_VALGRIND) from branches/zip.