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
COMMUNICATION PACKETS, ERROR_CODE: 1160
If idle FEDERATED table is evicted from the table cache when
a connection to remote server is lost, query that initiated
eviction may fail.
If this query is executed by slave SQL thread it may fail as well.
An error of close was stored in diagnostics area, which was later
attributed to the statement that caused eviction.
With this patch FEDERATED clears an error of close.
- dijkstra_shortest_paths() needs a Graph as first parameter, in case of reverse_graph we now need to use
its m_g member
- use boost::tuples::tie() on all places where tie() was used . Reason -
fix the build with Visual Studio 10 SP1 (which includes std:tr1:tie, thus creating ambiguity)
mysql-test/suite/maria/r/maria-recovery3.result:
Added test case for recovery bug
mysql-test/suite/maria/t/maria-recovery3.test:
Added test case for recovery bug
storage/maria/ha_maria.cc:
Don't print query twice to log
storage/maria/ma_delete.c:
More DBUG_PRINT
storage/maria/ma_key_recover.c:
Added new asserts to detect errors earlier
storage/maria/ma_recovery.c:
Update all states when moving a non-transactional file to transactional. This fixes lp:887051
The counter handler_read_key (SSV::ha_read_key_count) is incremented
incorrectly.
The mysql server maintains a per thread system_status_var (SSV)
object. This object contains among other things the counter
SSV::ha_read_key_count. The purpose of this counter is to measure the
number of requests to read a row based on a key (or the number of
index lookups).
This counter was wrongly incremented in the
ha_innobase::innobase_get_index(). The fix removes
this increment statement (for both innodb and innodb_plugin).
The various callers of the innobase_get_index() was checked to
determine if anybody must increment this counter (if they first call
innobase_get_index() and then perform an index lookup). It was found
that no caller of innobase_get_index() needs to worry about the
SSV::ha_read_key_count counter.
This bug ensures that a live downgrade from an InnoDB 5.6 with WL5756 and
a database created with innodb-page-size=8k or 4k will make a version 5.5
installation politely refuse to start. Instead of crashing or giving some
indication about a corrupted database, it will indicate the page size
difference.
This patch takes only that part of the Wl5756 patch that is needed to
protect against opening a tablespace that is stamped with a different
page size.
It also contains the change in dict_index_find_on_id_low() just in case
a database with another page size is created by recompiling a pre-WL5756
InnoDB.
WITH LARGE BUFFER POOL
(Note: this a backport of revno:3472 from mysql-trunk)
rb://845
approved by: Marko
When dropping a table (with an .ibd file i.e.: with
innodb_file_per_table set) we scan entire LRU to invalidate pages from
that table. This can be painful in case of large buffer pools as we hold
the buf_pool->mutex for the scan. Note that gravity of the problem does
not depend on the size of the table. Even with an empty table but a
large and filled up buffer pool we'll end up scanning a very long LRU
list.
The fix is to scan flush_list and just remove the blocks belonging to
the table from the flush_list, marking them as non-dirty. The blocks
are left in the LRU list for eventual eviction due to aging. The
flush_list is typically much smaller than the LRU list but for cases
where it is very long we have the solution of releasing the
buf_pool->mutex after scanning 1K pages.
buf_page_[set|unset]_sticky(): Use new IO-state BUF_IO_PIN to ensure
that a block stays in the flush_list and LRU list when we release
buf_pool->mutex. Previously we have been abusing BUF_IO_READ to achieve
this.
mysql-test/suite/maria/r/maria-autozerofill.result:
Updated test case
storage/maria/ha_maria.cc:
Write create_rename_lsn for auto_zerofilled tables.
storage/maria/ma_delete.c:
Added DBUG_ASSERT() to find errors when deleting pages.
storage/maria/ma_locking.c:
Fixed typo
storage/maria/ma_open.c:
Don't regard file as movable if create_rename_lsn is not LSN_NEEDS_NEW_STATE_LSNS
- leaking mutex in lf_hash_destroy
- pthread_getspecific() before pthread_key_create() in my_thread_var_dbug()
(called by static C++ object constructors called in sys_vars)
- perfschema destroys mutexes that were not created.
client/mysqltest.cc:
Free mutex after usage (fixes valgrind warnings in embedded server)
mysql-test/include/gis_keys.inc:
Fixed failure in innodb.gis_test
mysql-test/r/gis.result:
Updated result
mysql-test/suite/innodb/r/innodb_gis.result:
Updated results
mysql-test/suite/innodb/t/innodb_bug38231.test:
Added handling of timeouts (happend on some servers in buildbot)
mysql-test/suite/innodb_plugin/r/innodb_gis.result:
Updated results
mysql-test/suite/innodb_plugin/t/innodb.test:
Use error names instead of numbers
mysql-test/suite/innodb_plugin/t/innodb_misc1.test:
This test requires utf8
mysql-test/suite/innodb_plugin/t/innodb_mysql.test:
This test requires Xtradb
sql/sql_base.cc:
Don't print table names for placeholders.
sql/sql_show.cc:
Temporary fix:
Save and restore db and table_name in mysqld_show_create (to get rid of valgrind warning)
A better solution that needs to be investgated is to not change these fields in mysql_derived_prepare()
sql/sql_view.cc:
Fixed valgrind warning
storage/xtradb/handler/ha_innodb.cc:
Don't access THD directly
mysql-test/lib/My/Options.pm:
My::Options::is_set() now matches both option names and values!
mysql-test/lib/mtr_cases.pm:
1. don't merge --plugin-load here, it's too early
2. don't skip combinations that set --plugin-load just because the test needs another --plugin-load.
Skip *only* if test's --plugin-load matches *exactly* --plugin-load of one of the combinations.
3. if skipping all combinations but one, still assign the test to the combination
mysql-test/mysql-test-run.pl:
1. remove dead code - don't set variables that aren't used.
2. bugfix: allow one-letter combination names
3. in the command line, merge all --plugin-load options in one
storage/federated/ha_federated.cc:
bugfix: garbage character in the generated SELECT query
Replace statements connected with bitwise OR with series of "if"s.
The later is guaranteed to execute in order, bitwise OR does not have
specific order for statement execution.
dbug/tests.c:
Added __attribute__((unused)) to get rid of compiler warning
server-tools/instance-manager/guardian.cc:
Added __attribute__((unused)) to get rid of compiler warning
sql/filesort.cc:
Added __attribute__((unused)) to get rid of compiler warning
sql/slave.cc:
Added __attribute__((unused)) to get rid of compiler warning
sql/sql_load.cc:
Added __attribute__((unused)) to get rid of compiler warning
sql/sql_table.cc:
Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_blockrec.c:
Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_check.c:
Added missing cast
storage/maria/ma_loghandler.c:
Added __attribute__((unused)) to get rid of compiler warning
storage/maria/ma_recovery.c:
Added __attribute__((unused)) to get rid of compiler warning
storage/pbxt/src/cache_xt.cc:
Added __attribute__((unused)) to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
Removed not used variable
storage/xtradb/handler/ha_innodb.cc:
Use unused variable
vio/viosocket.c:
Remove usage of not used variable
vio/viosslfactories.c:
Added cast
cmd-line-utils/libedit/map.c:
Fixed compiler warning
cmd-line-utils/libedit/terminal.c:
Fixed compiler warning
cmd-line-utils/libedit/tty.c:
Fixed compiler warning
sql/sql_base.cc:
Fixed memory leak found by valgrind
storage/maria/compat_aliases.cc:
Ensure that recover_alias is also a set
storage/maria/ma_bitmap.c:
Proper fix for compiler warning
support-files/compiler_warnings.supp:
Fixed compiler warning
- "" is now used if no option is set
include/maria.h:
Added HA_RECOVER_ANY
storage/maria/ha_maria.cc:
Insert of checking if maria_recover_options == 0, check if any bit is set.
Fix maria_recover_names to match bitmap. This fixes that recover options works as expected.
storage/maria/ha_maria.h:
Insert of checking if maria_recover_options == 0, check if any bit is set.
storage/maria/ma_check.c:
Fixed wrong print
WITH MYISAM_USE_MMAP ENABLED
MySQL server can crash due to segmentation fault when
started with myisam_use_mmap.
The reason behind this being, while making a request to
unmap (munmap) the previously mapped memory (mmap), the
size passed was 7 bytes larger than the size requested at
the time of mapping. This can eventually unmap the adjacent
memory mapped block, belonging to some other memory-map pool.
Hence the subsequent call to mmap can map a region which was
still a valid memory mapped area.
Fixed by removing the extra 7-byte margin which was erroneously
added to the size, used for unmappping.
storage/myisam/mi_close.c:
Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
WITH MYISAM_USE_MMAP ENABLED
Added a condition to call _mi_unmap_file() in case
of compressed records. mi_munmap_file() is called
otherwise.
storage/myisam/mi_packrec.c:
Bug#11756764 48726: MYSQLD KEEPS CRASHING WITH SIGSEGV
WITH MYISAM_USE_MMAP ENABLED
mi_dynmap_file() function, after successfully executing
mmap, stores the total size in info->s->mapped_length
variable. Now, if mi_dynmap_file() is invoked with a size
with an extra 7-byte margin (MEMMAP_EXTRA_MARGIN),
the margin will eventually also get stored in mapped_length.
So, un-mapping function can simply use the value stored in
mapped_length in order to unmap the previously mapped
region.
DISJOINT can't be properly optimized with the RTree keys in MyISAM also.
per-file comments:
storage/myisam/rt_index.c
bug 857066 Wrong result with ST_DISJOINT when using an index.
don't optimize DISJOINT with the RTree keys.
the ST_DISJOINT can't be properly optimized with the RTree key
at the moment.
per-file comments:
storage/maria/ma_rt_index.c
bug 857066 Wrong result with ST_DISJOINT when using an index
disabled optimization for the DISJOINT case.
sql/sql_base.cc:
fix a memory leak
storage/xtradb/handler/ha_innodb.cc:
fix for a visual studio
storage/xtradb/row/row0ins.c:
valgrind complains about uninitialized variable.
incorrect errors in the innodb.test too
- build executables we have in 5.3 (mysql_install_db.exe, mysq_upgrade_service.exe, upgrade wizard), and MSI
- add some missing headers to windows specific source files.
This needs to be done since 5.5 is using WIN32_LEAN_AND_MEAN preprocessor constant thus windows.h
no more includes whiole Windows
- do not deliver perl scripts (mysql_install_db.pl & friends) -they do not work, are not documented, and we
have native executables for this functionality. do not pack echo.exe, replace.exe into MSI, they
are not needed. Do not build resolveip on Windows, it is not used.
- precache results of of system checks in cmake/os/WindowsCache.cmake (like it is alreay done for majority of tests
to speed up cmake run with VS)
- make feedback plugin DEFAULT on Windows (so MSI works if user enables plugin),
fix null pointer access in PSI_register
A variable XTRADB_PREFER_STATIC_LIBAIO should be set to 1 (or TRUE
or ON) for static linking.
Even if mysqld can avoid dependency on shared libaio, shared libraries
libmysqld.so or ha_innodb.so cannot link without it.
Given that the patch primarily addresses building tar.gz package, and
shared libraries mentioned above deemed less important than mysqld
executable, we accept shared lib dependency on libaio.so
mysql-test/mysql-test-run.pl:
Rename MYSQLD -> MYSQLD_SIMPLE_CMD to avoid conflict with new MYSQLD variable from MySQL 5.1
mysql-test/r/innodb_file_format.result:
Remove old duplicated test
mysql-test/suite/pbxt/r/endspace.result:
Update test to last version
mysql-test/suite/pbxt/r/heap.result:
Removed heap test (not part of pbxt)
mysql-test/suite/pbxt/r/select_safe.result:
Updated results after error message change
mysql-test/suite/pbxt/r/view_grant.result:
Removed view test (not part of pbxt)
mysql-test/suite/pbxt/t/endspace.test:
Update test to last version
mysql-test/suite/pbxt/t/heap.test:
Removed heap test (not part of pbxt)
mysql-test/suite/pbxt/t/view_grant.test:
Removed view test (not part of pbxt)
mysql-test/t/innodb_file_format.test:
Remove old duplicated test
mysql-test/t/mysqld_option_err.test:
Use renamed variable
sql/my_decimal.h:
Fixed wrong define
storage/maria/ma_loghandler.c:
Fixed compiler warning
AND HANG IN SHOW TABLE STATUS.
ISSUE: Table corruption due to concurrent queries.
Different threads running insert and check
query leads to table corruption. Not properly locked,
rows are inserted in between check query.
SOLUTION: In check query mutex lock is acquired
for a longer time to handle concurrent
insert and check query.
NOTE: Additionally we backported the fix for CHECKSUM
issue(bug#11758979).
Remove btr_cur_t::ibuf_cnt. The only dependence on cursor->ibuf_cnt
was ibuf_set_entry_counter(). That code path was removed in the
original bug fix (marko.makela@oracle.com-20111107072802-dgwagejlpub0rjkd).
rb:819 approved by Jimmy Yang
rb://816
approved by: Marko Makela
The title is misleading. This bug was actually introduced by
bug 12635227 and was unearthed by a later optimization.
We need to free buf_page_t structs that we are allocating using
malloc() at shutdown.
I manually checked that all the conflicting InnoDB changes are in 5.5 already.
Two things I am not sure about - I commented them with XXX in this patch.
I will further check with the authors of the changesets whether these things
should be present or not.
a.k.a. Bug#7975 deadlock without any locking, simple select and update
Bug#7975 was reintroduced when the storage engine API was made
pluggable in MySQL 5.1. Instead of looking at thd->lex directly, we
rely on handler::extra(). But, we were looking at the wrong extra()
flag, and we were ignoring the TRX_DUP_REPLACE flag in places where we
should obey it.
innodb_replace.test: Add tests for hopefully all affected statement
types, so that bug should never ever resurface. This kind of tests
should have been added when fixing Bug#7975 in MySQL 5.0.3 in the
first place.
rb:806 approved by Sunny Bains
btr_pcur_restore_position_func(): When the cursor was positioned at
the tree infimum or supremum, initialize pos_state and latch_mode. The
assertion failed, because pos_state was BTR_PCUR_WAS_POSITIONED. In
the test failure of WL#5874, the purge thread attempted to restore the
cursor position on the infimum record (the clustered index was empty).
btr_pcur_detach(), btr_pcur_is_detached(): Unused functions, remove.
rb:804 approved by Inaam Rana