Commit graph

4371 commits

Author SHA1 Message Date
Marko Mäkelä
cd4c9520fc Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-04 15:20:28 +02:00
Marko Mäkelä
7b0f7a4374 row_ins_index_entry(): Note that only CREATE INDEX sets foreign=FALSE. 2010-11-04 15:12:15 +02:00
Sunny Bains
2a36ae5d59 Add change log entry for bug#54538 fix. 2010-11-04 09:41:36 +11:00
Marko Mäkelä
515c24480e Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-03 14:51:15 +02:00
Marko Mäkelä
bf770f3615 rw_lock_debug_print(): Output the thread ID in unsigned format. 2010-11-03 14:38:36 +02:00
Marko Mäkelä
18d38d4890 Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-03 11:25:14 +02:00
Marko Mäkelä
88a7d55f6b Bug#57947 InnoDB diagnostics shows btr_block_get calls instead of real callers
Improve the diagnostics of buffer pool accesses for B-trees,
so that the file names and line numbers of the real calls are shown
instead of the line of the buf_page_get() call in btr_block_get().

btr_page_get(): Replaced with a macro.

btr_block_get_func(): Renamed from btr_block_get(). Add file, line.

btr_block_get(): A macro that passes the __FILE__, __LINE__ to
btr_block_get_func().

dict_truncate_index_tree(): Replace a btr_page_get() call
with btr_block_get(), since we are only latching the page, not accessing it.
2010-11-03 11:19:12 +02:00
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
2c0e21aca4 Merge from mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-03 14:14:44 +11: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
kevin.lewis@oracle.com
8cf52ba106 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 16:54:23 -05:00
kevin.lewis@oracle.com
64d07bf74c Merge 2010-11-02 10:04:16 -05:00
kevin.lewis@oracle.com
e0efcfe807 Bug#57904 - Only one INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS was displayed
per table from Innodb
2010-11-02 10:03:14 -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ä
290925226b Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-02 09:34:09 +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
Marko Mäkelä
e5ad4e2055 Start preprocessor directive from column 1. 2010-11-01 10:49:28 +02:00
Marko Mäkelä
a576cd5cfb Bug #57579 blobs cause a thread to wait for itself endlessly
btr_estimate_n_rows_in_range_on_level(): Always do mtr_commit(),
so that the page will not remain pinned indefinitely.
2010-11-01 10:18:33 +02:00
Jimmy Yang
718f09e0ab Merge fix for bug#57616 from mysql-5.5-security to mysql-5.5-innodb. 2010-10-28 21:55:43 -07:00
Vasil Dimov
2aee9fb97d Fix a compilation warning:
/export/home/pb2/build/sb_0-2459340-1288264809.63/mysql-5.5.8-ga/storage/innobase/os/os0sync.c: In function 'os_cond_wait_timed':
/export/home/pb2/build/sb_0-2459340-1288264809.63/mysql-5.5.8-ga/storage/innobase/os/os0sync.c:184: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'time_t'
gmake[2]: *** [storage/innobase/CMakeFiles/innobase.dir/os/os0sync.c.o] Error 1
2010-10-28 20:12:23 +03:00
Calvin Sun
c441f79acf 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.

rb://415
Approved by: Inaam
2010-10-28 00:34:53 -05: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
Calvin Sun
b5819779f8 Fixed a C89 violation when atomic builtins are not defined, causing
a compile error with MSVC. The problem was introduced in Revision: 3150
revid:marko.makela@oracle.com-20100809085837-s1nfx6gjf7l6ttab
2010-10-27 17:06:20 -05:00
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
Marc Alff
2a4f50a5df local merge 2010-10-26 11:02:32 +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
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
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
Davi Arnaut
1e1985eba7 Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-10-20 17:02:59 -02: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
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