Commit graph

975 commits

Author SHA1 Message Date
Jimmy Yang
7a9120a119 Fix Bug #59197 double quote in field comment prevents foreign key
constraint creation

rb://557 Approved by Sunny Bains
2011-01-04 22:44:12 -08:00
Jimmy Yang
0f412ffb59 Fix Bug #59157 valgrind conditional jump warning from dict_load_foreign.
This is 5.1 built-in specific as the dict_table_t strcture is allocated
with mem_heap_zalloc since 5.1 plugin.

Approved by Sunny Bains
2011-01-04 22:31:46 -08:00
Vasil Dimov
99e5d278a3 PS-instrument the array of latches (rw locks) dict_table_stats_latches[].
This adds 64 new rows to performance_schema.rwlock_instances.

This patch will make perfschema.binlog_mix perfschema.binlog_row tests fail,
but they will be fixed by http://lists.mysql.com/commits/127862

Approved by:	Jimmy (rb://554)
2011-01-04 11:46:20 +02:00
Calvin Sun
cc79797ea5 Fix a build error on Windows, introduced by revision-id:
marko.makela@oracle.com-20101221112722-1yxxzzgqtem8bcm7

The fix was suggested by Jimmy.
2010-12-27 23:01:39 -06:00
Marko Mäkelä
85d668b45c Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-12-21 14:05:10 +02:00
Mikael Ronstrom
2a294a1989 BUG#59013, make partition handler not miss HA_STATUS_NO_LOCK, add HA_STATUS_VARIABLE_EXTRA to remove InnoDB bottleneck 2010-12-17 21:58:40 +01:00
Vasil Dimov
a79cd543ce Increment InnoDB version from 1.1.4 to 1.1.5
InnoDB 1.1.4 was released with MySQL 5.5.8
2010-12-16 09:53:07 +02:00
kevin.lewis@oracle.com
9fef50565e 55222 - Previous patch had a bug in unused code which was reactivated in
mysql-trunk-innodb in rev revno: 3367  Tue 2010-12-07 02:25:25-0800.
The crash happens only when lower_case_table_names=2, such as on MacOS,
when running the new testcase innodb-system-table-view.  Specifically,
it crashes when any query is made against the INFORMATION_SCHEMA.
INNODB_SYS_FOREIGN table.  The function dict_process_sys_foreign_rec()
is only used for displaying SYS_FOREIGN records so it does not need a
lookup version of those names to be allocated. In this patch, those new
function calls are deleted.
2010-12-09 10:42:35 -06:00
Jimmy Yang
e2131e678f Merge from mysql-5.1-innodb to mysql-5.5-innodb. 2010-12-09 01:32:53 -08:00
Vasil Dimov
219138f652 Cherry pick vasil.dimov@oracle.com-20101201140708-fsc5xlu9bkpov6pv
from mysql-trunk-innodb. The same problem also exists in 5.5.

  X revision-id: vasil.dimov@oracle.com-20101201140708-fsc5xlu9bkpov6pv
  X committer: Vasil Dimov <vasil.dimov@oracle.com>
  X branch nick: mysql-trunk-innodb
  X timestamp: Wed 2010-12-01 16:07:08 +0200
  X message:
  X   Fix Bug#58432 innodb.innodb_bug56143 fails under valgrind
  X   
  X   Use a longer timeout for semaphore waits if (possibly) running under
  X   Valgrind.
  X   
  X   Approved by:	Marko (via IRC)
2010-12-03 09:35:53 +02:00
Vasil Dimov
d331e48556 Define MYSQL_(MAJOR|MINOR)_VERSION the way things are defined in CMake
instead of hacking a custom ADD_DEFINITIONS().

Approved by:	Kent Boortz (via IRC)
2010-12-02 12:04:10 +02:00
Marko Mäkelä
5166f9d5c2 Merge from mysql-5.5-innodb to local. 2010-12-02 10:55:27 +02:00
Vasil Dimov
deade71e23 Use "rep; nop" in InnoDB if it is available and "pause" is not 2010-12-02 10:36:45 +02:00
Marko Mäkelä
aeb23e24fe Fix UNIV_MEM_DEBUG compilation failure caused by Bug#58226 fix.
To fix Bug#58226 (speed up UNIV_DEBUG), among other things we no longer
disable the inlining of the functions that are defined in InnoDB .ic files.
Inside UNIV_MEM_DEBUG, there was an implicit type conversion from void*
that is all right in C, but not in C++. Now that inlining was enabled,
the C++ compiler would see the code and complain.

Approved by Jimmy Yang on IRC.
2010-12-02 10:32:27 +02:00
Marko Mäkelä
019cbc1795 Bug#58212 Possible deadlock in change buffer in debug builds
ibuf_page(): Renamed to ibuf_page_low(). Add the parameters file, line
so that the latch diagnostics will be more meaningful.
In debug builds, add the parameter ibool x_latch. When x_latch=FALSE,
do not x-latch the page, but only buffer-fix it for reading the bit.
In UNIV_SYNC_DEBUG, display a message if an insert buffer bitmap page
was already latched. (The message should be displayed in those cases
where the code would have previously failed.)

ibuf_page(): A wrapper macro for ibuf_page_low(). Pass x_latch=TRUE.

ibuf_bitmap_page_get_bits(): Renamed to ibuf_bitmap_page_get_bits_low().
In UNIV_DEBUG, add the parameter latch_mode.
Remove the parameter mtr unless UNIV_DEBUG is defined.

ibuf_bitmap_page_get_bits(): A wrapper macro for
ibuf_bitmap_page_get_bits_low(). Pass latch_type=MTR_MEMO_PAGE_X_FIX.

buf_page_get_gen(): Use ibuf_page_low(x_latch=FALSE) in the debug assertion.
This avoids the possible deadlock.
2010-12-01 15:09:02 +02:00
Marko Mäkelä
ac8847655e Bug#58226 Some InnoDB debug checks consume too much CPU time
Do not disable InnoDB inlining when UNIV_DEBUG is defined. The
inlining is now solely controlled by the preprocessor symbol
UNIV_MUST_NOT_INLINE and by any compiler options.

mtr_memo_contains(): Add an explicit type conversion from void*, so
that the function can be compiled by a C++ compiler. Previously, this
function was never seen by the C++ compiler, because it is only
present in UNIV_DEBUG builds and InnoDB inlining used to be disabled.

buf_flush_validate_skip(): A wrapper that skips most calls of
buf_flush_validate_low(). Invoked by debug assertions in
buf_flush_insert_into_flush_list() and buf_flush_remove().

fil_validate_skip(): A wrapper that skips most calls of
fil_validate(). Invoked by debug assertions in fil_io() and fil_io_wait().

os_aio_validate_skip(): A wrapper that skips most calls of
os_aio_validate(). Invoked by debug assertions in
os_aio_func(), os_aio_windows_handle() and os_aio_simulated_handle.

os_get_os_version(): Only include this function if __WIN__ is defined.

sync_array_deadlock_step(): Slight optimizations. This function is a
major CPU consumer in UNIV_SYNC_DEBUG builds.
2010-12-01 10:43:33 +02:00
Marko Mäkelä
ba874a7d9d Fix a compilation error that was introduced in the Bug #55222 fix
(bzr revision id kevin.lewis@oracle.com-20101130182552-hfydggaeeys3tjqx).
2010-12-01 10:36:54 +02:00
Marko Mäkelä
2ed5c7d1d2 Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-12-01 10:09:32 +02:00
kevin.lewis@oracle.com
dd143b8900 Fix compiler warning for Bug#55222 patch. 2010-11-30 20:13:02 -06:00
kevin.lewis@oracle.com
a53845ca45 Bug#55222 - RB://517 - Approved by Sunny
InnoDB does not attempt to handle lower_case_table_names == 2 when looking
up foreign table names and referenced table name.  It turned that server
variable into a boolean and ignored the possibility of it being '2'.  

The setting lower_case_table_names == 2 means that it should be stored and
displayed in mixed case as given, but compared internally in lower case.
Normally the server deals with this since it stores table names.  But
InnoDB stores referential constraints for the server, so it needs to keep
track of both lower case and given names.

This solution creates two table name pointers for each foreign and referenced
table name.  One to display the name, and one to look it up.  Both pointers
point to the same allocated string unless this setting is 2.  So the overhead
added is not too much.

Two functions are created in dict0mem.c to populate the ..._lookup versions
of these pointers.  Both dict_mem_foreign_table_name_lookup_set() and
dict_mem_referenced_table_name_lookup_set() are called 5 times each.
2010-11-30 12:25:52 -06:00
kevin.lewis@oracle.com
234a67bb9f RB://518 approved by Jimmy Yang and Sunny bains
Code cleanup after changes for Bug 56628.  The general approach for 
InnoDB is to make a reference to each enum value whenever it is used in a
switch statement.  In addition, no default case should be used for switch 
statements on enum types.  This assures that if there is ever any change 
in the enum values, the switch will need to change to reflect it since a 
compiler warning will occur.  In this case, the enum row_type is declared 
in handler.h and could be changed for another storage engine.  If so, a 
warning will occur in the InnoDB build.  

Other changes;
* This patch uses 2 macros to help consolidate warning messages that
   need to occur twice in the single switch for row_format.
* Using row_format as the variable name to distinguish it from the enum
  type.
* Function declaration format correction.
2010-11-30 10:06:11 -06:00
Sunny Bains
42116cfe28 Fix Bug# 58459 - assert slot->in_use == FALSE while starting purge thread.
Fix a race condition in srv_master_thread(). We need to acquire the kernel
mutex before calling srv_table_reserve_slot(). Add a mutex_own() assertion
in srv_table_reserve_slot().
2010-11-30 16:51:40 +11:00
Vasil Dimov
e301078998 Make output from innobase_start_or_create_for_mysql() consistent
Prefix all printed lines with a timestamp and write one space between
the timestamp and "InnoDB:".
2010-11-29 14:53:09 +02:00
Vasil Dimov
24d1b3ef88 Fix pointers to documentation
Do not print pointer to the 5.1 documentation from within MySQL 5.5.

Instead of hardcoding the MySQL version, use the MAJOR_VERSION and
MINOR_VERSION CMake variables defined at top-level.
2010-11-29 14:50:26 +02:00
Vasil Dimov
ab710966a5 Merge mysql-5.5-bugteam -> mysql-5.5-innodb 2010-11-29 09:08:23 +02:00
Jimmy Yang
1a83ee844b Fix Bug #58461 InnoDB should show aggregated result for multiple
buffer pool instance.

rb://526 approved by Sunny Bains
2010-11-28 17:43:55 -08:00
Georgi Kodinov
c5987223db merge 2010-11-26 14:51:48 +02:00
Vasil Dimov
e8cdc991cd Fix the PAUSE instruction handling in InnoDB
Previously HAVE_IB_PAUSE_INSTRUCTION was never defined and thus InnoDB
never used the PAUSE instruction on non-windows even if it was available.
Probably the check was never migrated from autotools'
storage/innobase/plug.in to storage/innobase/CMakeLists.txt.

Since the check for PAUSE is done at top-level configure.cmake we can
use the result from there (HAVE_PAUSE_INSTRUCTION) instead of rolling
InnoDB's own HAVE_IB_PAUSE_INSTRUCTION (the check is identical anyway).
2010-11-26 10:54:12 +02:00
Sunny Bains
96bab278a4 Merge from mysql-5.1-innodb to mysql-5.5-innodb. Test was adjusted. 2010-11-24 14:36:00 +11:00
Vasil Dimov
070bf07b3a Fix Bug#57739 Scary messages in error log
Silence a warning about old table name when InnoDB tests whether the
format has changed using a nonexistent table name.

Reviewed by:	bar@mysql.com, marko.makela@oracle.com
2010-11-22 16:08:51 +02:00
Davi Arnaut
f6deb00a56 WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.

In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc

The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.
2010-11-20 12:47:50 -02:00
Vasil Dimov
fe136f1599 Fix Bug#58279 Incorrect enabling of UNIV_DEBUG in debug builds
Checking "IF(WITH_DEBUG)" does not work for multi-configuration CMake
generators like VS or XCode. See
http://forge.mysql.com/wiki/CMake#Debug-only_options
2010-11-19 15:45:18 +02:00
Jimmy Yang
f4cec49456 Fix Bug #16290 Unclear error message when adding foreign key constraint
rb://502 approved by Sunny Bains
2010-11-14 23:08:04 -08:00
Marko Mäkelä
a56c2e382d Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-11 15:13:52 +02:00
Vasil Dimov
0fe7ef2847 Merge mysql-5.1-innodb -> mysql-5.5-innodb 2010-11-11 13:25:35 +02:00
Marko Mäkelä
46b8fd922a Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-11 12:22:27 +02:00
Vasil Dimov
6dee4b50af Increment InnoDB version from 1.1.3 to 1.1.4
InnoDB 1.1.3 was released with MySQL 5.5.7-rc
2010-11-11 08:50:41 +02:00
Jimmy Yang
956ada2e2d Merge from mysql-5.1-innodb to mysql-5.5-innodb 2010-11-10 21:51:00 -08:00
Jimmy Yang
f5c5d23a20 Port fix for Bug #48026 to 5.1 built-in and plugin: Log start and end
of InnoDB buffer pool initialization to the error log
2010-11-10 21:27:10 -08:00
Vasil Dimov
22075c8fee Merge mysql-5.5-innodb from bk-internal into my local repo 2010-11-10 10:52:45 +02:00
Vasil Dimov
f97201dcb9 Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-11-08 16:46:26 +02:00
Vasil Dimov
4117327019 Merge mysql-5.5-bugteam -> mysql-5.5-innodb 2010-11-08 16:44:59 +02:00
kevin.lewis@oracle.com
f0cc2b6200 Bug57960 - In ha_innodb.cc, get_foreign_key_info() make sure the
referenced_table name uses the actual length of the table name.
2010-11-04 10:18:05 -05:00
Marko Mäkelä
cd4c9520fc Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-04 15:20:28 +02:00
Georgi Kodinov
7e2fa49edf merge 2010-11-03 16:09:17 +02: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
Vasil Dimov
927b4a1281 Merge mysql-5.1-innodb -> mysql-5.5-innodb 2010-11-03 12:07:16 +02:00
Marko Mäkelä
18d38d4890 Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-03 11:25:14 +02:00
Sunny Bains
2c0e21aca4 Merge from mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-03 14:14:44 +11: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
Marko Mäkelä
290925226b Merge mysql-5.1-innodb to mysql-5.5-innodb. 2010-11-02 09:34:09 +02:00
Jon Olav Hauglid
a4a11329fc Backport from mysql-trunk-bugfixing of:
------------------------------------------------------------
revno: 3309
committer: Tor Didriksen <tor.didriksen@oracle.com>
branch nick: trunk-bugfixing
timestamp: Mon 2010-11-01 08:58:27 +0100
message:
  Bug#45288: pb2 returns a lot of compilation warnings
  
  DBG build broken on binary-werror-linux-x86_64-tar-gz
  storage/innobase/os/os0sync.c:659: warning: 'timed_out' may be used uninitialized in this function
2010-11-01 14:12:59 +01: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
Georgi Kodinov
860c9d9c35 merge to 5.1-security 2010-10-29 14:02:49 +03: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
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
Jimmy Yang
e548b2f107 merge from mysql-5.1-innodb to mysql-5.5-innodb. 2010-10-25 00:02: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
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