Commit graph

1016 commits

Author SHA1 Message Date
Marko Mäkelä
493b45e85f Fix a bogus debug assertion in the fix of Bug #57707.
buf_pool_init(): Replace ut_ad(n_instances < MAX_BUFFER_POOLS)
with ut_ad(n_instances <= MAX_BUFFER_POOLS).
(Spotted by Michael Izioumtchenko.)
Add ut_ad(n_instances > 0).
2010-10-27 21:50:45 +03:00
Vasil Dimov
afe6ec6649 Merge mysql-5.5-bugteam -> mysql-5.5-innodb 2010-10-27 16:41:26 +03:00
Vasil Dimov
497613c057 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-27 16:39:22 +03:00
Marko Mäkelä
9c168f3225 Bug #57707 InnoDB buf_page_t size has doubled on 32-bit systems
buf_page_t: Remove the buf_pool pointer. Add buf_pool_index:6 next to
buf_fix_count:19 (it was buf_fix_count:25). This will limit the number
of concurrent transactions to somewhere around 524,288.

buf_pool_index(buf_pool): A new function to determine the index of a
buffer pool in buf_pool_ptr[].

buf_pool_ptr: Make this a dynamically allocated array instead of an
array of pointers. Allocate the array in buf_pool_init() and free in
buf_pool_free().

buf_pool_free_instance(): No longer free the buf_pool object, as it is
allocated from a big array.

buf_pool_from_bpage(), buf_pool_from_block(): Move the definitions to
the beginning of the files, because some compilers have (had) problems
with forward definitions of inline functions. Calculate the buffer
pool from buf_pool_index.

buf_pool_from_array(): Add debug assertions for input validation.
2010-10-27 09:56:56 +03:00
Marko Mäkelä
548289eea0 Bug #57730 Clean up references to InnoDB Plugin
CMakeLists.txt: Remove the checks for mysql_storage_engine.cmake
and MYSQL_VERSION_ID.

ha_innodb.cc, ha_innodb.h: Remove the checks for MYSQL_VERSION_ID.
2010-10-27 09:54:20 +03:00
Inaam Rana
b87f59b2b2 Fix compiler warning introduced by previous commit. 2010-10-26 21:45:58 -04:00
Inaam Rana
b91f6c72dd Bug #57611 ibdata file and continuous growing undo logs
rb://498
  
  Fix handling of update_undo_logs at trx commit. Previously, when
  rseg->update_undo_list grows beyond 500 the update_undo_logs were
  marked with state TRX_UNDO_TO_FREE which should have been
  TRX_UNDO_TO_PURGE.
  In 5.5 we don't need the heuristic as we support multiple rollback
  segments.
  
  Approved by: Sunny Bains
2010-10-26 17:06:24 -04:00
Inaam Rana
cb64e66003 Bug #57611 ibdata file and continuous growing undo logs
rb://498

Fix handling of update_undo_logs at trx commit. Previously, when
rseg->update_undo_list grows beyond 500 the update_undo_logs were
marked with state TRX_UNDO_TO_FREE which should have been
TRX_UNDO_TO_PURGE.

Approved by: Sunny Bains
2010-10-26 16:54:18 -04:00
kevin.lewis@oracle.com
2dad3c94f7 Bug#57720 - Windows Vista and possibly Windows 7 can return ERROR_TIMEOUT instead of WAIT_TIMEOUT from calls to SleepConditionVariableCS() which is used in os0sync.c; os_cond_wait_timeout() where it is mapped to sleep_condition_variable().
Consider ERROR_TIMEOUT to be a timeout just like WAIT_TIMEOUT.  

In addition, test for EINTR as a possible return value from pthread_cond_timeout() in the posix section of os_cond_wait_timeout(), even though it is not supposed to be returned, but just to be safe.
2010-10-26 14:18:31 -05:00
Georgi Kodinov
cfa413bf4e merge 2010-10-27 09:32:26 +02:00
Jimmy Yang
e548b2f107 merge from mysql-5.1-innodb to mysql-5.5-innodb. 2010-10-25 00:02:03 -07:00
Jimmy Yang
7334d96e0c Merge from mysql-5.1-security to mysql-5.5-security. 2010-10-24 20:45:03 -07:00
Jimmy Yang
d14045b7ea Fix Bug #56791 Remove ios_mutex from InnoDB code
rb://495 approved by Inaam
2010-10-21 23:34:57 -07:00
Calvin Sun
86919e95af Fix an error introduced in a follow-up fix of Bug#57232 by Sunny Bains
revno: 3185
revid: sunny.bains@oracle.com-20101018060544-wo81q6kbl3la1uq0
2010-10-21 12:29:00 -05:00
Jon Olav Hauglid
67ecb9d9cf Merge from mysql-5.5-innodb to mysql-5.5-bugteam
No conflicts
2010-10-21 15:31:16 +02:00
Sunny Bains
30d5e327c8 Bug #57243 Inconsistent use of trans_register_ha() API in InnoDB
Remove trx_t::active_trans. Split into two separate fields with distinct
responsibilities. trx_t::is_registered and trx_t::owns_prepare_mutex.
There are wrapper functions for using this fields in ha_innodb.cc. The
wrapper functions check for invariants.

Fix some formatting to conform to InnoDB guidelines.

Remove innobase_register_stmt() and innobase_register_trx_and_stmt().

Add:
trx_is_started()
trx_deregister_from_2pc()
trx_register_for_2pc()
trx_is_registered_for_2pc()
trx_owns_prepare_commit_mutex_set()
trx_has_prepare_commit_mutex()

rb://479, Approved by Jimmy Yang.
2010-10-21 22:22:27 +11:00
Marko Mäkelä
731344d3d6 Remove files that are no longer needed.
These files were needed when InnoDB Plugin was maintained and distributed
separately from the MySQL 5.1 source tree. They have never been needed in
MySQL 5.5.

storage/innobase/mysql-test:
 Patches to the test suite.

storage/innobase/handler/mysql_addons.cc:
 Wrappers for private MySQL functions.
2010-10-21 10:45:44 +03:00
Marko Mäkelä
3e2e7575af lock_rec_validate_page(): Disable the debug printout.
It is filling the error log when testing the debug version of the server.
The printout only seems to be useful when debugging a crash, not when
testing an instrumented version of the server.
2010-10-21 10:32:41 +03:00
Jimmy Yang
59f35ce808 Fix Bug #57616 Sig 11 in dict_load_table() when failed to load
index or foreign key

Approved by Sunny Bains
2010-10-20 19:56:42 -07:00
Jimmy Yang
6c2221e401 Merge from mysql-5.1-security to mysql-5.5-security. 2010-10-20 19:24:56 -07:00
Jimmy Yang
56c3083776 Fix bug #57616 Sig 11 in dict_load_table() when failed to load index
or foreign key

Fix approved by Sunny Bains
2010-10-20 19:14:25 -07:00
Marko Mäkelä
9c418526a8 Fix a compiler warning caused by fixing Bug #57588 (compiler warning).
Declare DATA_MBMAXLEN with the same data type as DATA_MBMINLEN.
2010-10-20 15:58:47 +03:00
Marko Mäkelä
c486d4da98 Fix bit-rot left by the multiple buffer pools patch.
Rename buf_pool_watch, buf_pool_mutex, buf_pool_zip_mutex
to buf_pool->watch, buf_pool->mutex, buf_pool->zip_mutex
in comments. Refer to buf_pool->flush_list_mutex instead of
flush_list_mutex.

Remove obsolete declarations of buf_pool_mutex and buf_pool_zip_mutex.
2010-10-20 14:46:28 +03:00
Vasil Dimov
ef2f1d583b Merge mysql-5.1-innodb -> mysql-5.5-innodb
In the fix for Bug#53916 also apply equivalent changes to CMakeLists.txt
2010-10-20 10:41:51 +03:00
Sunny Bains
bd8343dd27 Bug #57588 - Compiler warning in InnoDB due to comparison between signed and unsigned
For DATA_MBMINLEN(), cast the result of UNIV_EXPECT to ulint because in GCC
it returns a long causing unsigned/signed comparison warnings.

Approved by Jimmy Yang on IM.
2010-10-20 14:39:31 +11:00
Davi Arnaut
71a8764af5 Bug#45288: pb2 returns a lot of compilation warnings
Ensure that fdatasync is properly declared as on Mac OS X, the
function is available but there is no prototype. Also, port a
fix for a warning from the InnoDB plugin over to the builtin.
2010-10-19 14:48:03 -02:00
Davi Arnaut
15d104591f Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-10-19 12:30:06 -02:00
Davi Arnaut
2cebd47e20 Bug#45288: pb2 returns a lot of compilation warnings on linux
Tag unused arguments.

Approved by: Marko (via IRC)
2010-10-19 12:09:28 -02:00
Marko Mäkelä
e8a709a6c3 ibuf_set_del_mark(): Do not complain about already delete-marked records.
According to a comment in row_upd_sec_index_entry(), it is a
legitimate situation that can be caused by a lock wait.
2010-10-19 09:44:38 +03:00
Marko Mäkelä
e85e1206b1 Merge Bug #56680 from mysql-5.1.
Additional fixes in 5.5:

ibuf_set_del_mark(): Add diagnostics when setting a buffered delete-mark fails.

ibuf_delete(): Correct a misleading comment about non-found records.

rec_print(): Add a const qualifier to the index parameter.

Bug #56680 wrong InnoDB results from a case-insensitive covering index

row_search_for_mysql(): When a secondary index record might not be
visible in the current transaction's read view and we consult the
clustered index and optionally some undo log records, return the
relevant columns of the clustered index record to MySQL instead of the
secondary index record.

ibuf_insert_to_index_page_low(): New function, refactored from
ibuf_insert_to_index_page().

ibuf_insert_to_index_page(): When we are inserting a record in place
of a delete-marked record and some fields of the record differ, update
that record just like row_ins_sec_index_entry_by_modify() would do.

btr_cur_update_alloc_zip(): Make the function public.

mysql_row_templ_t: Add clust_rec_field_no.

row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the
flag rec_clust, for returning data at clust_rec_field_no instead of
rec_field_no. Resurrect the debug assertion that the record not be
marked for deletion. (Bug #55626)

[UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(),
buf_flush_page_try():
Implement innodb_change_buffering_debug=1 for evicting pages from the
buffer pool, so that change buffering will be attempted more
frequently.
2010-10-19 09:35:14 +03:00
Marko Mäkelä
f2d39c9eaf Bug #56680 wrong InnoDB results from a case-insensitive covering index
row_search_for_mysql(): When a secondary index record might not be
visible in the current transaction's read view and we consult the
clustered index and optionally some undo log records, return the
relevant columns of the clustered index record to MySQL instead of the
secondary index record.

REC_INFO_DELETED_FLAG: Move the definition from rem0rec.ic to rem0rec.h.

ibuf_insert_to_index_page_low(): New function, refactored from
ibuf_insert_to_index_page().

ibuf_insert_to_index_page(): When we are inserting a record in place
of a delete-marked record and some fields of the record differ, update
that record just like row_ins_sec_index_entry_by_modify() would do.

mysql_row_templ_t: Add clust_rec_field_no.

row_sel_store_mysql_rec(), row_sel_push_cache_row_for_mysql(): Add the
flag rec_clust, for returning data at clust_rec_field_no instead of
rec_field_no. Resurrect the debug assertion that the record not be
marked for deletion. (Bug #55626)

buf_LRU_free_block(): Refactored from
buf_LRU_search_and_free_block(). This is needed for the
innodb_change_buffering_debug diagnostics.

[UNIV_DEBUG || UNIV_IBUF_DEBUG] ibuf_debug, buf_page_get_gen(),
buf_flush_page_try():
Implement innodb_change_buffering_debug=1 for evicting pages from the
buffer pool, so that change buffering will be attempted more
frequently.
2010-10-19 08:58:53 +03:00
Vasil Dimov
75063440d8 Merge mysql-5.1-innodb -> mysql-5.5-innodb 2010-10-18 15:16:23 +03:00
Vasil Dimov
33496519e1 Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
In order to fix this bug we need to distinguish whether ha_innobase::info()
has been called from ::analyze() or not. Rename ::info() to ::info_low()
and add a boolean parameter that tells whether the call is from ::analyze()
or not. Create a new simple ::info() that just calls
::info_low(false => not called from analyze). From ::analyze() instead of
::info() call ::info_low(true => called from analyze).

Approved by:	Jimmy (rb://487)
2010-10-18 13:48:11 +03:00
Sunny Bains
626b2d6a83 Fix bug encountered during testing on BSD. In the original fix for bug# 55681
the check for overflow was wrong and the OS_SYNC_INFINITE_TIME was handled
incorrectly.
  
Approved by Jimmy Yang (IM)
2010-10-18 17:05:44 +11:00
Vasil Dimov
e201510316 Merge mysql-5.5-bugteam -> mysql-5.5-innodb 2010-10-15 17:52:36 +03:00
Vasil Dimov
08daccd469 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-15 17:38:39 +03:00
Jimmy Yang
4bd55cd67b Merge from mysql-5.1-innodb to mysql-5.5-innodb. 2010-10-14 04:39:42 -07:00
Sunny Bains
ebf1ac2bff Bug# 55681 - MTR slowdown after default storage engine was changed to InnoDB
Add new function os_cond_wait_timed(). Change the os_thread_sleep() calls
to timed conditional waits. Signal the background threads during the shutdown
phase so that we avoid waiting for the sleep to timeout thus saving some time.

rb://439 -- Approved by Jimmy Yang
2010-10-14 14:12:02 +11:00
Vasil Dimov
f19fa5277a Fix Bug#56143 too many foreign keys causes output of show create table to become invalid
Just remove the check whether the file is "too big".
A similar code exists in ha_innobase::update_table_comment() but that
method does not seem to be used.
2010-10-13 20:18:59 +03:00
Alexander Nozdrin
bde1955104 Auto-merge from mysql-5.5-bugteam. 2010-10-13 01:17:22 +04:00
klewis@mysql.com
b1698f638f Bug#56632 - The warning code related to KEY_BLOCK_SIZE and ROW_FORMAT when innodb_strict_mode=OFF is improved in order to take into account whether the KEY_BLOCK_SIZE is specified on the current ALTER statement or the previous CREATE statement.
The testcase shows the expected results of 12 different combinations of these settings.
2010-10-12 12:07:09 -05:00
Jimmy Yang
b265bd106f Merge from mysql-5.1-security to mysql-5.5-security. 2010-10-12 00:06:15 -07:00
karen.langford@oracle.com
ebc8ba0bb2 Fix bug #57345 2010-10-11 22:13:47 +02:00
Marko Makela
60ce7ea801 Merge Bug #57345, Bug #56982, Bug#53307 test from mysql-5.1-innodb 2010-10-11 21:28:51 +02:00
Vasil Dimov
0b29085cac Merge mysql-5.5-innodb -> mysql-5.5-bugteam 2010-10-11 18:22:22 +03:00
Jimmy Yang
0062e693d7 Merge from mysql-5.1-innodb to mysql-5.5-innodb 2010-10-11 05:56:44 -07:00
Jimmy Yang
f3a8c2be04 A more complete fix for bug #57345 btr_pcur_store_position abort for load
with concurrent lock/unlock tables

Approved by Marko
2010-10-11 05:36:13 -07:00
Marko Mäkelä
cfc97fd026 Bug #56947 InnoDB leaks memory when failing to create a table
row_create_table_for_mysql(): When the table creation fails,
free the dict_table_t object.
2010-10-11 11:59:43 +03:00
Marko Mäkelä
ff95690751 Bug #56947 InnoDB leaks memory when failing to create a table
No mysql-test case. Tested by creating a table, removing a *.frm file and
attempting to create the table again. Code coverage tested by
instrumentation. Tested with Valgrind.
2010-10-11 11:01:47 +03:00
Davi Arnaut
31e1b12eb0 Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix assorted compiler warnings.
2010-10-08 11:52:39 -03:00
Jon Olav Hauglid
ee1ea44569 Merge from mysql-5.5-runtime to mysql-5.5-bugteam
No conflicts
2010-10-07 14:12:33 +02:00
Vasil Dimov
8bdbfe6ac8 Merge mysql-5.5-innodb -> mysql-5.5-bugteam 2010-10-07 14:43:47 +03:00
Martin Hansson
d6ee2ecf90 Bug#56423: Different count with SELECT and CREATE SELECT queries
This is the 5.5 version of the fix. The 5.1 version was too complicated to
merge and was null merged.

This is a regression from the fix for bug no 38999. A storage engine capable
of reading only a subset of a table's columns updates corresponding bits in
the read buffer to signal that it has read NULL values for the corresponding
columns. It cannot, and should not, update any other bits. Bug no 38999
occurred because the implementation of UPDATE statements compare the NULL bits
using memcmp, inadvertently comparing bits that were never requested from the
storage engine. The regression was caused by the storage engine trying to
alleviate the situation by writing to all NULL bits, even those that it had no
knowledge of. This has devastating effects for the index merge algorithm,
which relies on all NULL bits, except those explicitly requested, being left
unchanged.

The fix reverts the fix for bug no 38999 in both InnoDB and InnoDB plugin and
changes the server's method of comparing records. For engines that always read
entire rows, we proceed as usual. For engines capable of reading only select
columns, the record buffers are now compared on a column by column basis. An
assertion was also added so that non comparable buffers are never read. Some
relevant copy-pasted code was also consolidated in a new function.
2010-10-07 12:01:51 +02:00
Martin Hansson
9c82ecec37 Bug#56423: Different count with SELECT and CREATE SELECT queries
This is a regression from the fix for bug no 38999. A storage engine capable
of reading only a subset of a table's columns updates corresponding bits in
the read buffer to signal that it has read NULL values for the corresponding
columns. It cannot, and should not, update any other bits. Bug no 38999
occurred because the implementation of UPDATE statements compare the NULL bits
using memcmp, inadvertently comparing bits that were never requested from the
storage engine. The regression was caused by the storage engine trying to
alleviate the situation by writing to all NULL bits, even those that it had no
knowledge of. This has devastating effects for the index merge algorithm,
which relies on all NULL bits, except those explicitly requested, being left
unchanged.

The fix reverts the fix for bug no 38999 in both InnoDB and InnoDB plugin and
changes the server's method of comparing records. For engines that always read
entire rows, we proceed as usual. For engines capable of reading only select
columns, the record buffers are now compared on a column by column basis. An
assertion was also added so that non comparable buffers are never read. Some
relevant copy-pasted code was also consolidated in a new function.
2010-10-07 10:13:11 +02:00
Jimmy Yang
8e03529502 Merge from mysql-5.1-security to mysql-5.5-security 2010-10-06 07:58:12 -07:00
Davi Arnaut
5f911fa874 Bug#49938: Failing assertion: inode or deadlock in fsp/fsp0fsp.c
Bug#54678: InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock

- Incompatible change: truncate no longer resorts to a row by
row delete if the storage engine does not support the truncate
method. Consequently, the count of affected rows does not, in
any case, reflect the actual number of rows.

- Incompatible change: it is no longer possible to truncate a
table that participates as a parent in a foreign key constraint,
unless it is a self-referencing constraint (both parent and child
are in the same table). To work around this incompatible change
and still be able to truncate such tables, disable foreign checks
with SET foreign_key_checks=0 before truncate. Alternatively, if
foreign key checks are necessary, please use a DELETE statement
without a WHERE condition.

Problem description:

The problem was that for storage engines that do not support
truncate table via a external drop and recreate, such as InnoDB
which implements truncate via a internal drop and recreate, the
delete_all_rows method could be invoked with a shared metadata
lock, causing problems if the engine needed exclusive access
to some internal metadata. This problem originated with the
fact that there is no truncate specific handler method, which
ended up leading to a abuse of the delete_all_rows method that
is primarily used for delete operations without a condition.

Solution:

The solution is to introduce a truncate handler method that is
invoked when the engine does not support truncation via a table
drop and recreate. This method is invoked under a exclusive
metadata lock, so that there is only a single instance of the
table when the method is invoked.

Also, the method is not invoked and a error is thrown if
the table is a parent in a non-self-referencing foreign key
relationship. This was necessary to avoid inconsistency as
some integrity checks are bypassed. This is inline with the
fact that truncate is primarily a DDL operation that was
designed to quickly remove all data from a table.
2010-10-06 11:34:28 -03:00
Jimmy Yang
c0923d396a Manual port Bug #Bug #54582 "stack overflow when opening many tables
linked with foreign keys at once" from mysql-5.1-security to
mysql-5.5-security again.

rb://391 approved by Heikki
2010-10-06 06:55:34 -07:00
Jimmy Yang
34c61d0448 Fix Bug #57255 Cascade Delete results in "Got error -1 from storage engine".
rb://477 approved by Marko
2010-10-06 03:41:26 -07:00
Calvin Sun
ebb99e7827 Merge from bk-internal.mysql.com/bzrroot/server/mysql-5.5-innodb/
to local repo.
2010-10-05 13:49:17 -05:00
Calvin Sun
5df8fd90be bug#56318: Replication aborts with ER_TOO_BIG_ROWSIZE if innodb
parameters don't match

Revert the changes of the default values of innodb_file_per_table
and innobase_file_format in 5.5, until WL#5135 is implemented.
2010-10-05 13:38:30 -05:00
Georgi Kodinov
539291cde9 merged mysql-5.1 into mysql-5.1-bugteam 2010-10-05 11:11:56 +03:00
Vasil Dimov
c82feaf5ba Merge mysql-5.5-innodb from bk-internal to my local tree 2010-10-04 13:46:41 +03:00
Marko Mäkelä
a71ca27dca Merge Bug#56716 from 5.1 2010-10-04 13:38:05 +03:00
Marko Mäkelä
fe2ff69061 Merge Bug#56716 from 5.1 2010-10-04 13:38:05 +03:00
Marko Mäkelä
484e61a778 Bug#56716 InnoDB locks a record gap without locking the table
row_search_for_mysql(): Acquire an intention lock on the table
before locking the first record gap.
2010-10-04 13:05:21 +03:00
Vasil Dimov
66bde6c26b Merge mysql-5.5-innodb -> mysql-5.5-bugteam 2010-10-01 16:36:35 +03:00
Vasil Dimov
f7b01a39b5 Fix a potential bug when using __sync_lock_test_and_set()
This is a manual merge from mysql-5.1-innodb of:

  revision-id: vasil.dimov@oracle.com-20100930102618-s9f9ytbytr3eqw9h
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  timestamp: Thu 2010-09-30 13:26:18 +0300
  message:
    Fix a potential bug when using __sync_lock_test_and_set()

    TYPE __sync_lock_test_and_set (TYPE *ptr, TYPE value, ...)

    it is not documented what happens if the two arguments are of different
    type like it was before: the first one was lock_word_t (byte) and the
    second one was 1 or 0 (int).

    Approved by:	Marko (via IRC)
2010-10-01 14:51:00 +03:00
Vasil Dimov
314d795bb0 Fix Bug#56340 innodb updates index stats too frequently after non-index updates
This is a manual merge from mysql-5.1-innodb of:

  revno: 3618
  revision-id: vasil.dimov@oracle.com-20100930124844-yglojy7c3vaji6dx
  parent: vasil.dimov@oracle.com-20100930102618-s9f9ytbytr3eqw9h
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-5.1-innodb
  timestamp: Thu 2010-09-30 15:48:44 +0300
  message:
    Fix Bug#56340 innodb updates index stats too frequently after non-index updates

    This is a simple optimization issue. All stats are related to only indexed
    columns, index size or number of rows in the whole table. UPDATEs that touch
    only non-indexed columns cannot affect stats and we can avoid calling the
    function row_update_statistics_if_needed() which may result in unnecessary I/O.

    Approved by:	Marko (rb://466)

In addition to the above message: we know that
row_update_cascade_for_mysql() (the other place where
row_update_statistics_if_needed is called) always updates indexed
columns (FK-related), so there is no need to add this cond there.
2010-10-01 10:34:21 +03:00
Vasil Dimov
e9bd5900f5 Fix Bug#56340 innodb updates index stats too frequently after non-index updates
This is a simple optimization issue. All stats are related to only indexed
columns, index size or number of rows in the whole table. UPDATEs that touch
only non-indexed columns cannot affect stats and we can avoid calling the
function row_update_statistics_if_needed() which may result in unnecessary I/O.

Approved by:	Marko (rb://466)
2010-09-30 15:48:44 +03:00
Vasil Dimov
64ef6416bf Manually merge a GCC warning fix from 5.1 to 5.5:
------------------------------------------------------------
  revno: 3615
  revision-id: vasil.dimov@oracle.com-20100928081234-22qbm6cwht521484
  parent: vasil.dimov@oracle.com-20100928063833-snn6cjwgksa6gk3b
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-5.1-innodb
  timestamp: Tue 2010-09-28 11:12:34 +0300
  message:
    Silence a GCC warning about reaching the end of non-void func
    
    Spotted by:	Marko
2010-09-28 11:14:42 +03:00
Vasil Dimov
f661c09dd4 Use C-style comment instead of C++ in a C header.
Spotted by:	Davi Arnaut
2010-09-27 20:08:12 +03:00
Sunny Bains
ae1f1a6798 This patch comes from Michael: See bug#56933. 2010-09-24 08:37:09 +10:00
Mark Leith
693f13463f Bug#56922 SHOW ENGINE INNODB STATUS truncation limit is too strict and not instrumented
rb://459 approved by Jimmuy / Inaam
2010-09-23 09:12:09 +01:00
Vasil Dimov
5af0e024ae (ut0rnd.ic:88) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:41:58 +03:00
Vasil Dimov
32e9abebd5 (trx0undo.c:1873) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:40:44 +03:00
Vasil Dimov
a5975d4304 (trx0undo.c:1075) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:40:13 +03:00
Vasil Dimov
862caf5d5c (trx0trx.c:1801) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:39:35 +03:00
Vasil Dimov
f5d1b4787a (trx0sys.c:252) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:37:53 +03:00
Vasil Dimov
53be9a8204 (trx0roll.c:746) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:36:08 +03:00
Vasil Dimov
c2fc573435 (trx0roll.c:747) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:35:13 +03:00
Vasil Dimov
19a4c1429f (trx0purge.c:1082) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:34:39 +03:00
Vasil Dimov
202cebad7c (trx0purge.c:674) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:33:38 +03:00
Vasil Dimov
0babdaf233 (trx0purge.c:316) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:32:35 +03:00
Vasil Dimov
78d7f7b19a (trx0purge.c:318) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:30:44 +03:00
Vasil Dimov
6f082344d5 (row0vers.c:74) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:17:20 +03:00
Vasil Dimov
7f1ffcfbb3 (row0umod.c:117) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:10:33 +03:00
Vasil Dimov
60cd54f3ec (row0purge.c:789) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:09:30 +03:00
Vasil Dimov
c07b437ffe (i_s.cc:1111) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:07:54 +03:00
Vasil Dimov
5f5bc71fcb (ha_innodb.cc:9037) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:04:14 +03:00
Vasil Dimov
8fe3d04e6c (ha_innodb.cc:7202) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:03:05 +03:00
Vasil Dimov
1bcb1d2da3 (que0que.c:1286) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:01:14 +03:00
Vasil Dimov
16215b6c1d (os0file.c:1485) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 19:00:28 +03:00
Vasil Dimov
4883683668 (os0file.c:1486) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:57:36 +03:00
Vasil Dimov
fb1338558d (log0recv.c:2905) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:55:54 +03:00
Vasil Dimov
07427cd8fb (log0recv.c:1660) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:53:07 +03:00
Vasil Dimov
e2b4074d82 (log0recv.c:572) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:51:51 +03:00
Vasil Dimov
4cce243414 (ibuf0ibuf.c:1300) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:51:11 +03:00
Vasil Dimov
d9d20d93c6 Remove redundant variable 2010-09-20 18:48:38 +03:00
Vasil Dimov
10ec98ca0e (eval0eval.c:388) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:47:51 +03:00
Vasil Dimov
72a65da579 (dict0dict.c:4458) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:47:15 +03:00
Vasil Dimov
977d0e0524 (dict0crea.c:630) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:46:24 +03:00
Vasil Dimov
2460ca43d9 (buf0flu.c:136) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:45:40 +03:00
Vasil Dimov
31d79a481e (btr0sea.c:1510) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:43:15 +03:00
Vasil Dimov
63072c7324 (btr0pcur.c:455) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:42:13 +03:00
Vasil Dimov
38c61d65a4 (btr0cur.c:4559) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:38:43 +03:00
Vasil Dimov
318b075cac (btr0cur.c:1957) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:33:39 +03:00
Vasil Dimov
88c3af8d9a (btr0btr.c:2566) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:31:58 +03:00
Vasil Dimov
c36871e59f (btr0btr.c:1900) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 18:16:19 +03:00
Vasil Dimov
d3c82da63e (btr0btr.c:606) Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-20 17:59:59 +03:00
Vasil Dimov
3374d5bb1d Whitespace fixup on ha_innodb.cc:2612 2010-09-20 17:14:21 +03:00
Vasil Dimov
bc889d6ef3 Whitespace fixup on ha_innodb.cc:1274 2010-09-20 15:50:34 +03:00
Vasil Dimov
5cf9dab765 Increment InnoDB version from 1.1.2 to 1.1.3
InnoDB 1.1.2 was released with MySQL 5.5.6-rc
2010-09-20 15:31:34 +03:00
Jimmy Yang
76ea88cdb6 Temporarily backout the Information Schema System Table Information Schema
interface related change, will put back in once gain approval.
2010-09-16 19:24:32 -07:00
Vasil Dimov
e5e4c2d6a9 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/ha_innodb.cc: In function 'bool innodb_show_status(handlerton*, THD*, bool (*)(THD*, const char*, uint, const char*, uint, const char*, uint))':
handler/ha_innodb.cc:7539:7: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
2010-09-14 18:25:41 +03:00
Vasil Dimov
150c19ee03 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
handler/ha_innodb.cc: In function 'void innobase_drop_database(handlerton*, char*)':
handler/ha_innodb.cc:5969:6: error: variable 'error' set but not used [-Werror=unused-but-set-variable]
2010-09-14 18:22:30 +03:00
Vasil Dimov
b88a2c4752 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0undo.c: In function 'trx_undo_set_state_at_prepare':
trx/trx0undo.c:1798:16: error: variable 'page_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 17:55:44 +03:00
Vasil Dimov
d947f567d4 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0undo.c: In function 'trx_undo_truncate_end':
trx/trx0undo.c:1015:14: error: variable 'rseg' set but not used [-Werror=unused-but-set-variable]
2010-09-14 17:53:49 +03:00
Vasil Dimov
6a163cde4e (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0trx.c: In function 'trx_prepare_off_kernel':
trx/trx0trx.c:1830:11: error: variable 'update_hdr_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:30:26 +03:00
Vasil Dimov
67b412652f (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0sys.c: In function 'trx_sys_create_doublewrite_buf':
trx/trx0sys.c:168:10: error: variable 'new_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:28:48 +03:00
Vasil Dimov
eb362b90c3 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
trx/trx0roll.c: In function 'trx_undo_arr_remove_info':
trx/trx0roll.c:717:9: error: variable 'n' set but not used [-Werror=unused-but-set-variable]
trx/trx0roll.c:716:9: error: variable 'n_used' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:21:32 +03:00
Vasil Dimov
2869f5376b (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_rec_release':
trx/trx0purge.c:1007:18: error: variable 'arr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:19:04 +03:00
Vasil Dimov
dff449bc97 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_rseg_get_next_history_log':
trx/trx0purge.c:599:15: error: variable 'seg_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:17:48 +03:00
Vasil Dimov
2245d41627 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
trx/trx0purge.c: In function 'trx_purge_add_update_undo_to_history':
trx/trx0purge.c:254:16: error: variable 'page_header' set but not used [-Werror=unused-but-set-variable]
trx/trx0purge.c:252:15: error: variable 'seg_header' set but not used [-Werror=unused-but-set-variable]
2010-09-14 15:04:03 +03:00
Vasil Dimov
e454b9e2ab (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0vers.c: In function 'row_vers_impl_x_locked_off_kernel':
row/row0vers.c:62:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:50:13 +03:00
Vasil Dimov
aa5ac11d2a (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0upd.c: In function 'row_upd_in_place_in_select':
row/row0upd.c:2040:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:46:13 +03:00
Vasil Dimov
6f8d5d6180 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0umod.c: In function 'row_undo_mod_clust_low':
row/row0umod.c:92:9: error: variable 'success' set but not used [-Werror=unused-but-set-variable]
2010-09-14 14:09:36 +03:00
Vasil Dimov
4c0f9c5d33 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
row/row0purge.c: In function 'row_purge_step':
row/row0purge.c:660:9: error: variable 'err' set but not used [-Werror=unused-but-set-variable]

(row_purge() always returns DB_SUCCESS)
2010-09-14 13:56:29 +03:00
Vasil Dimov
4a4c7b9275 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
que/que0que.c: In function 'que_thr_dec_refer_count':
que/que0que.c:805:11: error: variable 'sess' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:39:52 +03:00
Vasil Dimov
52dc49e4ef (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
que/que0que.c: In function 'que_run_threads_low':
que/que0que.c:1295:9: error: variable 'cumul_resource' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:38:21 +03:00
Vasil Dimov
100c5f010d (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
os/os0file.c: In function 'os_file_create':
os/os0file.c:1318:14: error: variable 'purpose_str' set but not used [-Werror=unused-but-set-variable]
os/os0file.c:1317:14: error: variable 'type_str' set but not used [-Werror=unused-but-set-variable]
2010-09-14 13:01:25 +03:00
Vasil Dimov
3be2fd8841 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
log/log0recv.c: In function 'recv_synchronize_groups':
log/log0recv.c:403:10: error: variable 'limit_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:46:23 +03:00
Vasil Dimov
f57fd93258 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
log/log0recv.c: In function 'recv_recovery_from_checkpoint_start':
log/log0recv.c:2509:10: error: variable 'archived_lsn' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:41:00 +03:00
Vasil Dimov
5cc0173acb (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
lock/lock0lock.c: In function 'lock_print_info_all_transactions':
lock/lock0lock.c:4299:10: error: variable 'page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:37:03 +03:00
Vasil Dimov
e92ef01fc4 Remove redundant variable 2010-09-14 12:11:00 +03:00
Vasil Dimov
70a1e89635 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
eval/eval0eval.c: In function 'eval_notfound':
eval/eval0eval.c:371:14: error: variable 'arg2' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:06:47 +03:00
Vasil Dimov
3684641cd9 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:
buf/buf0flu.c: In function 'buf_flush_batch':
buf/buf0flu.c:844:9: error: variable 'old_page_count' set but not used [-Werror=unused-but-set-variable]
2010-09-14 12:00:58 +03:00
Vasil Dimov
ee41fb98cd (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
btr/btr0sea.c: In function 'btr_search_update_hash_on_delete':
btr/btr0sea.c:1404:9: error: variable 'found' set but not used [-Werror=unused-but-set-variable]
2010-09-14 11:39:34 +03:00
Vasil Dimov
1859761222 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
btr/btr0pcur.c: In function 'btr_pcur_move_backward_from_page':
btr/btr0pcur.c:432:8: error: variable 'space' set but not used [-Werror=unused-but-set-variable]
2010-09-14 11:38:59 +03:00
Vasil Dimov
a01a739c97 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warnings:
btr/btr0cur.c: In function 'btr_store_big_rec_extern_fields':
btr/btr0cur.c:3368:10: error: variable 'rec_page' set but not used [-Werror=unused-but-set-variable]
btr/btr0cur.c: In function 'btr_free_externally_stored_field':
btr/btr0cur.c:3542:8: error: variable 'offset' set but not used [-Werror=unused-but-set-variable]
btr/btr0cur.c:3539:10: error: variable 'rec_page' set but not used [-Werror=unused-but-set-variable]
2010-09-14 11:37:21 +03:00
Vasil Dimov
5ff27ae1a0 (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:

btr/btr0btr.c:2063:9: error: variable 'level' set but not used [-Werror=unused-but-set-variable]
2010-09-13 16:39:40 +03:00
Vasil Dimov
39827fdc9b (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6
Fix compiler warning:

storage/innobase/include/ut0rnd.ic:70:8: error: variable 'n_bits' set but not used [-Werror=unused-but-set-variable]
2010-09-13 16:33:25 +03:00
Vasil Dimov
d2af4e3bc3 Whitespace fixup on ha_innodb.cc:9561 2010-09-10 12:52:14 +03:00
Vasil Dimov
a962007dae Whitespace fixup on ha_innodb.cc:2567 2010-09-10 12:32:21 +03:00
Marko Mäkelä
7b4b1acdb3 Merge Vasil Dimov 2010-09-09 Enable UNIV_DEBUG when WITH_DEBUG is defined 2010-09-09 15:14:05 +03:00
Marko Mäkelä
06f41e335b Remove ut0auxconf.h.
It was needed when InnoDB Plugin was distributed independently of MySQL.
Approved by Vasil Dimov.
2010-09-09 14:27:52 +03:00
Marko Mäkelä
30fdbe35d4 Invoke make with -j$(nproc) for better parallelism. 2010-09-09 13:50:06 +03:00
Marko Mäkelä
76d68c814b ibuf_insert_to_index_page(): Remove bogus code added for delete buffering.
In early development of delete buffering, we did allow B-tree pages
to become empty as a result of buffered deletes. That caused fundamental
problems. The fix was to refuse buffering purge operations unless
the page can be guaranteed to be nonempty. Remove an attempt to
cope with empty pages when merging inserts.
2010-09-09 13:48:00 +03:00
Marko Mäkelä
130bfccc93 Remove unused constant REC_INFO_BITS.
This was replaced with REC_OLD_INFO_BITS in MySQL 5.0.3.
2010-09-09 13:44:04 +03:00
Vasil Dimov
32253e4582 Enable UNIV_DEBUG when WITH_DEBUG is defined 2010-09-09 13:06:43 +03:00
Vasil Dimov
1fe035c121 Merge mysql-5.5-bugfixing -> mysql-5.5-innodb 2010-09-09 12:30:05 +03:00
Vasil Dimov
cda13e7415 Fix Bug#56384 Remove two COPYING files from innobase directory
Remove non applicable licensing files

storage/innobase/COPYING is in the MySQL top level directory and
storage/innobase/COPYING.Sun_Microsystems is not applicable anymore
now that Oracle and Sun are one company.
2010-09-07 21:09:50 +03:00
Georgi Kodinov
684c3e9e3d merge from 5.5-merge 2010-09-02 16:57:59 +03:00
Jimmy Yang
edbae904ff Merge from mysql-5.1-bugteam to mysql-5.1-security 2010-09-01 17:43:02 -07:00
Alexander Nozdrin
dc195adf34 Auto-merge from mysql-5.5-merge. 2010-08-30 18:07:40 +04:00
Jimmy Yang
0003925e75 Add a space indentation to InnoDB buffer pool size and log sequence
number boot up message.
2010-08-25 00:25:46 -07:00
Jimmy Yang
73d767644a This is to resolve a hang situation in 5.1 builtin raised by
bug #49251 (deadlock/crash with concurrent truncate table and index
statistics calculation) by backporting a solution from #54678 fixed
for 5.1 plugin and 5.5.
2010-08-24 20:42:33 -07:00
Marko Mäkelä
0a7a78a8d5 Merge Bug#55832 fix from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3550
revision-id: marko.makela@oracle.com-20100824081003-v4ecy0tga99cpxw2
parent: marko.makela@oracle.com-20100823102854-t1clrojqis2ley36
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Tue 2010-08-24 11:10:03 +0300
message:
  Bug#55832: selects crash too easily when innodb_force_recovery>3

  dict_update_statistics_low(): Create bogus statistics for those
  indexes that cannot be accessed because of the innodb_force_recovery
  setting.

  ha_innobase::info(): Calculate statistics for each index, even if
  innodb_force_recovery is set. Fill in bogus data for those indexes
  that are not accessed because of the innodb_force_recovery setting.
2010-08-24 11:34:19 +03:00
Marko Mäkelä
109893dac0 Bug#55832: selects crash too easily when innodb_force_recovery>3
dict_update_statistics_low(): Create bogus statistics for those
indexes that cannot be accessed because of the innodb_force_recovery
setting.

ha_innobase::info(): Calculate statistics for each index, even if
innodb_force_recovery is set. Fill in bogus data for those indexes
that are not accessed because of the innodb_force_recovery setting.
2010-08-23 13:28:54 +03:00
Inaam Rana
707aeca30c When flushing from LRU we try to keep a certain number of pages over
and above the general requirement free. We call them
BUF_FLUSH_EXTRA_MARGIN. With multiple buffer pools we may end up keeping
this amount of pages for each buffer pool. This patch, diagnosed and fixed
by Michael, throttles flushing in such cases.

rb://435
bug#54346
2010-08-20 12:39:04 -04:00
Georgi Kodinov
bd62942ec1 merge 2010-08-20 16:10:49 +03:00
Sunny Bains
54fd56c5c3 Fix Bug #54538 - use of exclusive innodb dictionary lock limits performance.
This patch doesn't get rid of the need to acquire the dict_sys->mutex but
reduces the need to keep the mutex locked for the duration of the query
to fsp_get_available_space_in_free_extents() from ha_innobase::info().

rb://390.
2010-08-20 17:49:43 +10:00
Sunny Bains
eff4a5d202 Fix Bug #55027: assertion: mutex_own(&dict_sys->mutex) in dict_table_get_on_id()
The callers should indicate that the dictionary is locked or not using
the trx->dict_operation_lock_mode == RW_X_LATCH mode. Checking explicitly
for system tables is unnecessary.

Approved by Marko on IRC.
2010-08-20 12:57:04 +10:00
Marko Mäkelä
b14708f326 Bug#56114 Disallow trx->dict_operation_lock_mode==RW_X_LATCH in srv_suspend_mysql_thread()
Issue an error message to the error log when
trx->dict_operation_lock_mode == RW_X_LATCH in
srv_suspend_mysql_thread(). Transactions that modify InnoDB
data dictionary tables must be free of lock waits, because they
must be holding the data dictionary latch in exclusive mode.
The transactions must not be accessing any other tables other than
the data dictionary tables.

The handling of RW_X_LATCH was accidentally added in the InnoDB Plugin,
as a wrong fix of an assertion failure. (Fast index creation was accessing
both data dictionary tables and user tables in the same transaction.)
2010-08-19 13:36:37 +03:00
Jimmy Yang
1e9438ebf7 Bug #48026 Log start and end of InnoDB buffer pool initialization to
the error log
2010-08-18 21:16:47 -07:00
Marko Mäkelä
75930fd508 Merge Bug#55626 fix from mysql-5.1-innodb:
revno: 3545
revision-id: marko.makela@oracle.com-20100818110110-zfs0i1vfrccfb4yw
parent: vasil.dimov@oracle.com-20100817193934-1yl7zz2odikxauf8
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Wed 2010-08-18 14:01:10 +0300
message:
  Bug#55626: MIN and MAX reading a delete-marked record from secondary index

  Remove a bogus debug assertion that triggered the bug.
  Add assertions precisely where records must not be delete-marked.
  And a comment to clarify when the record is allowed to be delete-marked.
2010-08-18 14:40:02 +03:00
Jon Olav Hauglid
5139bf6c8f Manual merge from mysql-5.5-bugfixing to mysql-5.5-runtime. 2010-08-18 13:29:04 +02:00
Magne Mahre
bd75361929 Bug #55547 InnoDB is not included when configuring by default
Added InnoDB to the 'default' plugin group, and modified 
the autoconf script so the 'default' group is actually 
built by default.
      
(i.e  ./configure.am == ./configure.am --with-plugins=default ,
instead of being ./configure.am --with-plugins=none )
2010-08-18 10:14:55 +02:00
Vasil Dimov
02492ae36f Merge mysql-5.5-bugfixing -> mysql-5.5-innodb 2010-08-18 10:14:06 +03:00
Marko Mäkelä
332a41ce57 A non-functional change:
dict_load_index_low(): Rename the parameter "cached" to "allocated"
and clarify the comments.
2010-08-17 15:07:54 +03:00
Jimmy Yang
da24a208dd Fix bug #53496 Use Lock_time in slow query log output for InnoDB row
lock wait time. Including the InnoDB lock time in the exiting "Lock_time"
output.
2010-08-17 01:19:24 -07:00
Vasil Dimov
c292616a7d Fix Bug#53761 RANGE estimation for matched rows may be 200 times different
Improve the range estimation algorithm.

Previously:
For a given level the algo knows the number of pages in the requested range and the n

With this change:
Same idea, but peek a few (10) of the intermediate pages to get a better estimate of 

In the bug report one of the examples has a btree with a snippet of the leaf level li
page1(899 records), page2(1 record), page3(1 record), page4(1 record)
so when trying to estimate, the previous algo, assumed there are average (899+1)/2=45
Fix Bug#53761 RANGE estimation for matched rows may be 200 times different

Improve the range estimation algorithm.

Previously:
For a given level the algo knows the number of pages in the requested range
and the number of records on the leftmost and the rightmost page. Then it
assumes all pages in between contain the average between the two border pages
and multiplies this average number by the number of intermediate pages.

With this change:
Same idea, but peek a few (10) of the intermediate pages to get a better
estimate of the average number of records per page. If there are less than 10
intermediate pages then all of them will be scanned and the result will be
precise, not an estimation.

In the bug report one of the examples has a btree with a snippet of the leaf
level like this:
page1(899 records), page2(1 record), page3(1 record), page4(1 record)
so when trying to estimate, the previous algo, assumed there are average
(899+1)/2=450 records per page which went terribly wrong. With this change
page2 and page3 will be read and the exact number of records will be returned.

Approved by:	Sunny (rb://401)
2010-08-16 17:23:29 +03:00
Mats Kindahl
cd34770558 Merging with mysql-5.5-stage. 2010-08-16 14:50:27 +02:00
Sunny Bains
97aa121579 Merge from -c3476 mysql-5.1-security.
------------------------------------------------------------
     revno: 3476
     committer: Sunny Bains <Sunny.Bains@Oracle.Com>
     branch nick: 5.1-security
     timestamp: Thu 2010-08-05 19:18:17 +1000
     message:
       Fix bug# 55543 - InnoDB Plugin: Signal 6: Assertion failure in file fil/fil0fil.c line 4306

         The bug is due to a double delete of a BLOB, once via:

               rollback -> btr_cur_pessimistic_delete()

         and the second time via purge.

         The bug is in row_upd_clust_rec_by_insert(). There we relinquish ownership
         of the non-updated BLOB columns in btr_cur_mark_extern_inherited_fields()
         before building the row entry that will be inserted and whose contents will
         be logged in the UNDO log. However, we don't set the BLOB column later to
         INHERITED so that a possible rollback will not free the original row's
         non-updated BLOB entries. This is because the condition that checks for
         that is in :

     		    	if (node->upd_ext) {}.

         node->upd_ext is non-NULL only if a BLOB column was updated and that column
         is part of some key ordering (see row_upd_replace()). This results in the
         non-update BLOB columns being deleted during a rollback and subsequently by
         purge again.

         rb://413
2010-08-16 12:05:49 +10:00
Sunny Bains
787f0c54cb Fix Bug #55277 - Failing assertion: auto_inc > 0
Handle overflow when reading value from SELECT MAX(C) FROM T;

Call ha_innobase::info() after initializing the autoinc value
in ha_innobase::open().

Fix for both the builtin and plugin.

rb://402

Merge from mysql-5.1-security.
2010-08-16 11:59:43 +10:00
Inaam Rana
231a97fde0 Change default for innodb_strict_mode to FALSE.
Note that this was originally pushed by Calvin but the was later
reverted by mistake.

bug#54702
2010-08-13 15:07:22 -04:00
Inaam Rana
0daa01fed0 Undo changes to innodb_strict_mode that went in by mistake in r3149 2010-08-13 12:14:59 -04:00
Vasil Dimov
bfca4bb9bf Manually merge a changeset from mysql-5.1-security:
------------------------------------------------------------
  revno: 3475
  revision-id: jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z
  parent: jimmy.yang@oracle.com-20100804101133-c38qqbm0fkwn9jhc
  committer: Jimmy Yang <jimmy.yang@oracle.com>
  branch nick: mysql-5.1-security
  timestamp: Wed 2010-08-04 03:37:44 -0700
  message:
    Fix bug #54678, InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock
    
    rb://399 approved by Sunny Bains
  modified:
    storage/innodb_plugin/ChangeLog 2425@16c675df-0fcb-4bc9-8058-dcc011a37293:branches%2Fzip%2FChangeLog
    storage/innodb_plugin/include/dict0dict.h 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdict0dict.h
    storage/innodb_plugin/include/dict0dict.ic 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Finclude%2Fdict0dict.ic
    storage/innodb_plugin/row/row0mysql.c 2@16c675df-0fcb-4bc9-8058-dcc011a37293:trunk%2Frow%2Frow0mysql.c
2010-08-13 15:52:11 +03:00
Alexander Nozdrin
13ec2a1625 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Sunny Bains
b591344769 Fix bug #52263 innodb does not compile on OpenSolaris with gcc4.3.2
Disable the GCC visibility attribute on all sun platforms.

Approved by Marko on IRC.
2010-08-12 20:00:07 +10:00
Marko Mäkelä
ef6f561a9e Bug#54914: InnoDB: performance drop with innodb_change_buffering=all
Reduce ibuf_mutex and ibuf_pessimistic_insert_mutex contention further.

Protect ibuf->empty by the insert buffer root page latch, not ibuf_mutex.

ibuf_tree_root_get(): Assert that ibuf_mutex is owned by the
caller. Assert that the stamped page number is correct. Assert that
ibuf->empty agrees with the root page.

ibuf_size_update(): Do not update ibuf->empty.

ibuf_init_at_db_start(): Update ibuf->empty while holding the root page latch.

ibuf_add_free_page(): Return TRUE/FALSE instead of DB_SUCCESS/DB_STRONG_FAIL.

ibuf_remove_free_page(): Release ibuf_pessimistic_insert_mutex as
early as possible.

ibuf_contract_ext(): Rely on a dirty read of ibuf->empty, unless the
server is being shut down. Never acquire ibuf_mutex. Eliminate n_stored.

ibuf_contract_after_insert(): Never acquire ibuf_mutex. Perform dirty
reads of ibuf->size and ibuf->max_size.

ibuf_insert_low(): Only acquire ibuf_mutex for mode==BTR_MODIFY_TREE.
Perform dirty reads of ibuf->size and ibuf->max_size. Update
ibuf->empty while holding the root page latch.

ibuf_delete_rec(): Update ibuf->empty while holding the root page latch.

ibuf_is_empty(): Release ibuf_mutex earlier.
2010-08-10 13:22:48 +03:00
Marko Mäkelä
84fbabace0 Reduce the ibuf_mutex hold time. This does not fix the update
regression in Bug #54914, but it does speed up the execution for
innodb_change_buffering=inserts.

ibuf_add_ops(), ibuf_merge_or_delete_for_page(),
ibuf_delete_for_discarded_space(): Use atomic built-ins instead of
ibuf_mutex, when available.

ibuf_add_free_page(), ibuf_remove_free_page(), ibuf_contract_ext():
Release ibuf_mutex earlier.

ibuf_free_excess_pages(): Release ibuf_mutex before a conditional branch.

ibuf_insert_low(): Release ibuf_mutex before a conditional
branch. Create ibuf_entry before re-acquiring ibuf_mutex. Simplify a
loop to reduce code footprint. Release ibuf_mutex before mtr_commit()
[btr_pcur_close()].

ibuf_is_empty(): Release ibuf_mutex before mtr_commit().
2010-08-09 11:58:37 +03:00
Davi Arnaut
c562aece2e Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Post-merge fix: remove --with-debug=full, it was only used for safemalloc.
2010-08-06 09:59:38 -03:00
Jimmy Yang
ff8cf2e974 Address bug #55465 ERROR 1280 (42000): Incorrect index name '<index name>',
adding a couple FK related messages.

rb://409 approved by Sunny Bains
2010-08-06 02:49:22 -07:00
Inaam Rana
a7996bff5d merge 2010-08-05 11:42:11 -04:00
Inaam Rana
ec6ba66af1 Currently we do a full validation of AHI whenever check tables is
called on any table. This patch fixes this by only doing this full
check in debug versions.

bug#55716
rb://423
approved by: Marko
2010-08-05 11:09:05 -04:00
Sunny Bains
6c0f9301ea Fix Bug #55277 - Failing assertion: auto_inc > 0
Handle overflow when reading value from SELECT MAX(C) FROM T;

Call ha_innobase::info() after initializing the autoinc value
in ha_innobase::open().

Fix for both the builtin and plugin.

rb://402
2010-08-05 19:24:34 +10:00
Jimmy Yang
6fce5c4c77 Fix Bug #54582 stack overflow when opening many tables linked with
foreign keys at once

rb://391 approved by Heikki
Z
2010-08-04 03:11:33 -07:00
Calvin Sun
ae67979f76 Bug #54702: revert the default of innodb_strict_mode to false. 2010-08-03 01:12:03 -05:00
Jimmy Yang
f4b088972a Fix Bug #55382 Assignment with SELECT expressions takes unexpected S locks
in READ COMMITTED

rb://410 Approved by Sunny Bains
2010-08-01 22:25:57 -07:00
Inaam Rana
612579976e merge from parent 2010-07-30 10:41:59 -04:00
Inaam Rana
c7e307e987 When the caller of buf_flush_list() provides us with the number of
pages that it wants to flush then we should honor that value as in
not going beyond that in our eagerness to flush the neighbors of
the selected victim.
2010-07-30 10:39:16 -04:00
Vasil Dimov
a95441c03a Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-07-29 11:51:00 +03:00
Vasil Dimov
9c0a4999af Fix trailing whitespace on ha_innodb.cc:1259 2010-07-28 09:15:07 +03:00
Vasil Dimov
c402eccf79 Remove trailing whitespace on ha_innodb.cc:574 2010-07-28 08:38:28 +03:00
Jimmy Yang
e168621d61 Fix Bug #55395 INNODB_TRX duplicates columns
rb://408 approved by Sunny Bains
2010-07-26 03:07:36 -07:00
Vasil Dimov
10870186e5 Merge mysql-5.1 -> mysql-5.1-innodb 2010-07-23 12:51:14 +03:00
Sunny Bains
b00f156088 Remove code that was added during the flush list mutex refactoring. We cannot
release a dirty page in the middle of a mini-transaction. Replace the code
with an assertion that checks for this condition.

Original svn revision was: r6330.
2010-07-22 14:46:12 +10:00
Sunny Bains
7c6d9a94b7 Bug#54583 InnoDB: Assertion failure sync/sync0sync.c:1226
Silence the UNIV_SYNC_DEBUG assertion failure while upgrading old data files
to multiple rollback segments during server startup. Because the upgrade
takes place while InnoDB is running a single thread, we can safely ignore the
latching order checks without fearing deadlocks.
      
innobase_start_or_create_for_mysql(): Set srv_is_being_started = FALSE
only after trx_sys_create_rsegs() has completed.
      
sync_thread_add_level(): If srv_is_being_started, ignore latching order
violations for SYNC_TRX_SYS_HEADER and SYNC_IBUF_BITMAP.

Create all the non-IO threads after creating the extra rollback segments.

Patch originally from Marko with some additions by Sunny.
2010-07-22 09:16:19 +10:00
Sunny Bains
043e9e2491 Bug 54617 - During shutdown: Failing assertion: arr->n_reserved == 0
Get rid of at least on suspicious path. Ensure that the purge thread
doesn't acquire a mutex after it has signalled shutdown.
2010-07-22 07:41:51 +10:00
Vasil Dimov
6a8e6ac4c5 Increment InnoDB version to 1.1.2
InnoDB 1.1.1 was released with MySQL 5.5.5-m3
2010-07-21 20:19:59 +03:00