Commit graph

3614 commits

Author SHA1 Message Date
Marko Mäkelä
20ca82fad9 Non-functional change: Remove bogus const qualifiers
and make some function comments more accurate.
2010-11-03 11:16:11 +02:00
Sunny Bains
cb2d2ab1fb 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().
 
This is a port of revno:3548 from the builtin to the plugin.

rb://501 Approved by Jimmy Yang and Marko Makela.
2010-11-03 12:40:53 +11:00
kevin.lewis@oracle.com
585379214d In this patch, existing tests innodb_bug54679.test and innodb_bug56632.test are
removed and replaced by the comprehensive innodb-create-options.test.
It uses the rules listed in the comments at the top of that test.
  
This patch introduces these differences from previous behavior;
1)  KEY_BLOCK_SIZE=0 is allowed by Innodb in both strict and non-strict mode
with no errors or warnings. It was previously used by the server to set 
KEY_BLOCK_SIZE to undefined.  (Bug#56628)
2)  An explicit valid non-DEFAULT ROW_FORMAT always takes priority over a
valid KEY_BLOCK_SIZE. (bug#56632)
3)  Automatic use of COMPRESSED row format is only done if the ROW_FORMAT
is DEFAULT or unspecified.
4)  ROW_FORMAT=FIXED is prevented in strict mode.

This patch also includes various formatting changes for consistency with
InnoDB coding standards.

Related Bugs
Bug#54679: ALTER TABLE causes compressed row_format to revert to compact
Bug#56628: ALTER TABLE .. KEY_BLOCK_SIZE=0 produces untrue warning or unnecessary error
Bug#56632: ALTER TABLE implicitly changes ROW_FORMAT to COMPRESSED
2010-11-02 17:28:34 -05:00
Vasil Dimov
63d56ff4a2 Increment InnoDB Plugin version to 1.0.14.
InnoDB Plugin 1.0.13 has been released with MySQL 5.1.52.
2010-11-02 10:00:04 +02:00
Marko Mäkelä
3dcbf1e279 Bug#57799 READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED
columns again

This is follow-up to Bug #54358. Not all occurrences of the bug were fixed.
We need to check all calls to btr_copy_externally_stored_field_prefix_low()
and do the right thing when the pointer to the off-page column is null
(full of zero bytes).

It turns out that only the call to btr_copy_externally_stored_field_prefix()
in row_sel_sec_rec_is_for_blob() needs to be changed.

For fetching complete off-page columns rather than prefixes, the function
btr_rec_copy_externally_stored_field() already checks if the pointer
is null (all-zero).  Two of its callers (row_merge_copy_blobs() and
row_sel_fetch_columns()) are never executed as READ COMMITTED and can
rightfully assert that the fetch succeeded.  The third caller,
row_sel_store_mysql_rec(), already does the right thing.

The calls in row_upd_ext_fetch() and trx_undo_page_fetch_ext() must
expect that the off-page column exists. Update and rollback are
locking operations, never READ UNCOMMITTED.
2010-11-02 09:28:48 +02:00
Marko Mäkelä
785d06febb White-space corrections in the InnoDB Plugin ChangeLog 2010-11-02 09:28:05 +02:00
Calvin Sun
bc921dd74f Bug#52062: Compiler warning in os0file.c on windows 64-bit
On Windows, the parameter for number of bytes passed into WriteFile()
and ReadFile() is DWORD. Casting is needed to silence the warning on
64-bit Windows.

Also, adding several asserts to ensure the variable for number of bytes
is no more than 32 bits, even on 64-bit Windows.

This is for InnoDB Plugin.

rb://415
Approved by: Inaam
2010-10-28 00:10:28 -05:00
Calvin Sun
6cc24b9a3e Bug#52062: Compiler warning in os0file.c on windows 64-bit
On Windows, the parameter for number of bytes passed into WriteFile()
and ReadFile() is DWORD. Casting is needed to silence the warning on
64-bit Windows.

Also, adding several asserts to ensure the variable for number of bytes
is no more than 32 bits, even on 64-bit Windows.

This is for built-in InnoDB.

rb://415
Approved by: Inaam
2010-10-27 23:18:59 -05:00
Vasil Dimov
497613c057 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-27 16:39:22 +03: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
Jimmy Yang
1b5b5cbe65 Fix bug #57700 Latching order violation in row_truncate_table_for_mysql().
Approved by Sunny Bains
2010-10-24 22:51:21 -07: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
Davi Arnaut
560ee2158d Bug#45288: pb2 returns a lot of compilation warnings
Fix assorted warnings that are generated in optimized builds.
Most of it is silencing variables that are set but unused.

This patch also introduces the MY_ASSERT_UNREACHABLE macro
which helps the compiler to deduce that a certain piece of
code is unreachable.
2010-10-20 16:21:40 -02: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
Vasil Dimov
e9eeebc517 Fix Bug#53916 storage/innodb_plugin does not compile on NetBSD/sparc64
Just check for all the functions that we are going to use, not a subset
of them.

Reviewed by:	Davi (via IRC)
2010-10-19 17:32:26 +03:00
Davi Arnaut
162dd50668 Bug#45288: pb2 returns a lot of compilation warnings on linux
Tag unused arguments.
      
Approved by: Marko (via IRC)
2010-10-19 12:12:43 -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ä
b568369dba 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:04:15 +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
50c69f9301 Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE
This is a merge from 5.1/builtin to 5.1/plugin of:

  --------------
  revision-id: vasil.dimov@oracle.com-20101018104811-nwqhg9vav17kl5s1
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  timestamp: Mon 2010-10-18 13:48:11 +0300
  message:
    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 14:20:16 +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
Vasil Dimov
3ed02e76aa Remove leftover conflict marker
It was added in jimmy.yang@oracle.com-20100902004302-m5ax9qo0ne2msdfx
2010-10-15 17:50:45 +03:00
Vasil Dimov
08daccd469 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-10-15 17:38:39 +03:00
Vasil Dimov
72d233903b Add InnoDB Plugin ChangeLog entry for Bug#56143 2010-10-15 17:30:32 +03:00
Vasil Dimov
acef4a023b Fix the formatting in storage/innodb_plugin/ChangeLog 2010-10-15 17:26:58 +03:00
Jimmy Yang
0fb4d49795 Remove an unused counter variable in io_handler_thread(). 2010-10-14 04:19:52 -07:00
Vasil Dimov
23df7715dd Fix Bug#56143 too many foreign keys causes output of show create table to become invalid
This is a port of the following changeset from
5.1/storage/innobase to 5.1/storage/innodb_plugin:

  ------------------------------------------------------------
  revno: 3626
  revision-id: vasil.dimov@oracle.com-20101013171859-gi9n558yj89x9v3w
  parent: klewis@mysql.com-20101012175933-ce9kkgl0z8oeqffa
  committer: Vasil Dimov <vasil.dimov@oracle.com>
  branch nick: mysql-5.1-innodb
  timestamp: Wed 2010-10-13 20:18:59 +0300
  message:
    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.

Also use a CREATE statement with all the FKs instead of ALTERing the
table 550 times because it is faster.
2010-10-14 12:28:25 +03: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
Jimmy Yang
ac1efb1ace Fix Bug #57397 io_handler_thread() will never cleanup
rb://483 approved by Inaam
2010-10-13 21:17:00 -07:00
klewis@mysql.com
f3292c3a13 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:59:33 -05: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
Sunny Bains
34b889e10f Bug# 56982 Assertion Failure from ha_innobase::innobase_peek_autoinc() when auto_inc > 0
Print an error message to stderr an get rid of the assertion.

Approved by: Jimmy Yang (over IM)
2010-10-11 11:26:49 +11: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
Georgi Kodinov
539291cde9 merged mysql-5.1 into mysql-5.1-bugteam 2010-10-05 11:11:56 +03:00
Marko Mäkelä
fe0b669416 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:06:41 +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
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
d70cbd6c61 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-09-30 13:26:18 +03:00
Vasil Dimov
3b0b15c5aa Increment InnoDB Plugin version to 1.0.13.
InnoDB Plugin 1.0.12 has been released with MySQL 5.1.51.
2010-09-28 15:31:33 +03:00
Vasil Dimov
68e34ab133 Silence a GCC warning about reaching the end of non-void func
Spotted by:	Marko
2010-09-28 11:12:34 +03:00
Vasil Dimov
7535f1eec9 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-09-28 09:38:33 +03:00
Davi Arnaut
d47e8991cb Bug#45288: pb2 returns a lot of compilation warnings on linux
Use UNINIT_VAR workaround instead of LINT_INIT. The former can
also be used to silence false-positives in non-debug builds as
it actually does not cause new code to be generated.
2010-09-24 19:13:51 -03:00
Vasil Dimov
d972a31ea8 Fix typo, should be UNIV_SYNC_DEBUG. 2010-09-15 19:58:36 +03:00
Vasil Dimov
e00e1aba61 (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:1069:14: error: variable 'rseg' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:50:05 +03:00
Vasil Dimov
c97283c207 (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:1871:16: error: variable 'page_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:49:25 +03:00
Vasil Dimov
b13a9c99a2 (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:1808:11: error: variable 'update_hdr_page' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:48:37 +03:00
Vasil Dimov
7fafd6408d (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:244:15: error: variable 'new_block' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:47:35 +03:00
Vasil Dimov
2aa70d99c6 (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:744:9: error: variable 'n' set but not used [-Werror=unused-but-set-variable]
trx/trx0roll.c:743:9: error: variable 'n_used' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:06:31 +03:00
Vasil Dimov
a0492a4425 (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:1071:18: error: variable 'arr' set but not used [-Werror=unused-but-set-variable]
2010-09-15 19:05:35 +03:00
Vasil Dimov
0c43681b43 (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:660:15: error: variable 'seg_hdr' set but not used [-Werror=unused-but-set-variable]
2010-09-15 18:47:14 +03:00