Commit graph

449 commits

Author SHA1 Message Date
Kristian Nielsen
6ea41f1e84 MDEV-7026: Race in InnoDB/XtraDB mutex implementation can stall or hang the server.
The bug was that full memory barrier was missing in the code that ensures that
a waiter on an InnoDB mutex will not go to sleep unless it is guaranteed to be
woken up again by another thread currently holding the mutex. This made
possible a race where a thread could get stuck waiting for a mutex that is in
fact no longer locked. If that thread was also holding other critical locks,
this could stall the entire server. There is an error monitor thread than can
break the stall, it runs about once per second. But if the error monitor
thread itself got stuck or was not running, then the entire server could hang
infinitely.

This was introduced on i386/amd64 platforms in 5.5.40 and 10.0.13 by an
incorrect patch that tried to fix the similar problem for PowerPC.

This commit reverts the incorrect PowerPC patch, and instead implements a fix
for PowerPC that does not change i386/amd64 behaviour, making PowerPC work
similarly to i386/amd64.
2014-11-19 13:56:46 +01:00
Jan Lindström
8c7ef99bb2 MDEV-7100: InnoDB error monitor might unnecessary wait log_sys mutex
Analysis: InnoDB error monitor is responsible to call every second
sync_arr_wake_threads_if_sema_free() to wake up possible hanging 
threads if they are missed in mutex_signal_object. This is not 
possible if error monitor itself is on mutex/semaphore wait. We 
should avoid all unnecessary mutex/semaphore waits on error monitor.
Currently error monitor calls function buf_flush_stat_update() 
that calls log_get_lsn() function and there we will try to get 
log_sys mutex. Better, solution for error monitor is that in 
buf_flush_stat_update() we will try to get lsn with 
mutex_enter_nowait() and if we did not get mutex do not update 
the stats.

Fix: Use log_get_lsn_nowait() function on buf_flush_stat_update()
function. If returned lsn is 0, we do not update flush stats. 
log_get_lsn_nowait() will use mutex_enter_nowait() and if
we get mutex we return a correct lsn if not we return 0.
2014-11-13 11:24:19 +02:00
Jan Lindström
2da6f7ceba MDEV-7017: Add function to print semaphore waits
Add function to print to stderr all current semaphore 
waits. This function should be able to executed 
inside a gdb/ddd.
2014-11-03 15:43:44 +02:00
Kristian Nielsen
4c07b93bdb Fix missing UNIV_INTERN on dict_table_check_foreign_keys().
When UNIV_INTERN is missing in built-in XtraDB, this causes the
innodb_plugin to call the XtraDB version of the function instead
of its own (seen in --embedded-server test failure in Buildbot).
This in turn causes bad things to happen in case of difference
between XtranDB and innodb_plugin.
2014-10-20 10:50:10 +02:00
Sergei Golubchik
7e6d4bba0c XtraDB 5.5.40-36.1 2014-10-08 00:44:37 +02:00
Sergei Golubchik
0d2cba5df2 XtraDB 5.5.39-36.0 2014-10-06 20:06:39 +02:00
Sergei Golubchik
8deb9066e2 fix compilation on windows - wrong include file 2014-09-08 17:10:48 +02:00
Sergei Golubchik
695781a53e MDEV-6595 [PATCH] HPPA: storage/xtradb/os/os0stacktrace.c:88:54: error: invalid operands to binary & (have 'void *' and 'long unsigned int')
fix precedence as in the patch from Brian Evans
2014-09-06 09:51:34 +02:00
Sergey Vojtovich
c01c819209 Backport from 10.0:
MDEV-6483 - Deadlock around rw_lock_debug_mutex on PPC64

This problem affects only debug builds on PPC64.

There are at least two race conditions around
rw_lock_debug_mutex_enter and rw_lock_debug_mutex_exit:

- rw_lock_debug_waiters was loaded/stored without setting
  appropriate locks/memory barriers.
- there is a gap between calls to os_event_reset() and
  os_event_wait() and in such case we're supposed to pass
  return value of the former to the latter.

Fixed by replacing self-cooked spinlocks with system mutexes.
These days system mutexes offer much better performance. OTOH
performance is not that critical for debug builds.
2014-08-29 16:14:11 +04:00
Sergey Vojtovich
40497577ff Backport from 10.0:
MDEV-6450 - MariaDB crash on Power8 when built with advance tool
            chain

InnoDB mutex_exit() function calls __sync_test_and_set() to release
the lock. According to manual this function is supposed to create
"acquire" memory barrier whereas in fact we need "release" memory
barrier at mutex_exit().

The problem isn't repeatable with gcc because it creates
"acquire-release" memory barrier for __sync_test_and_set().
ATC creates just "acquire" barrier.

Fixed by creating proper barrier at mutex_exit() by using
__sync_lock_release() instead of __sync_test_and_set().
2014-08-29 16:02:46 +04:00
Michael Widenius
5569132ffe MDEV-6450 - MariaDB crash on Power8 when built with advance tool chain
Part of this work is based on Stewart Smitch's memory barrier and lower priori
patches for power8.

- Added memory syncronization for innodb & xtradb for power8.
- Added HAVE_WINDOWS_MM_FENCE to CMakeList.txt
- Added os_isync to fix a syncronization problem on power
- Added log_get_lsn_nowait which is now used srv_error_monitor_thread to ensur
  if log mutex is locked.

All changes done both for InnoDB and Xtradb
2014-08-19 19:28:35 +03:00
Sergei Golubchik
359d764b79 fix xtradb on windows (again) 2014-08-03 07:38:41 +02:00
Jan Lindström
27d23c020a Merged percona-server-5.5.38-35.2. 2014-08-01 12:54:56 +03:00
Michael Widenius
a1c1700b89 Fixed some compiler warnings 2014-07-30 10:05:01 +03:00
Sergei Golubchik
6ef139780d MDEV-6497 InnoDB deadlocks on UNINSTALL PLUGIN
Free the trx of the current thd (if any) in innobase_end()
2014-07-29 09:09:52 +02:00
Jan Lindström
42b9758814 Fix compiler error on sparc. 2014-07-27 08:44:45 +03:00
Jan Lindström
8ae267400c Fix InnoDB: Assertion failure in thread 2868898624 in file buf0lru.c line 1000
InnoDB: Failing assertion: mutex_own(&buf_pool->LRU_list_mutex)

and

InnoDB: Assertion failure in thread 2868898624 in file buf0lru.c line 1077
InnoDB: Failing assertion: mutex_own(&buf_pool->LRU_list_mutex)

Analysis: Function buf_LRU_free_block might release LRU_list_mutex on
same cases to avoid mutex order problems, we need to take it back 
before accessing list.
2014-07-26 21:14:21 +03:00
Jan Lindström
c104965746 Fix test failure caused by simulated compression failure on
IBUF_DUMMY table.
2014-07-25 09:34:05 +03:00
Jan Lindström
7bf45bec54 Fix too agressive long semaphore wait output and add guard against introducing
compression failures on insert buffer.
2014-07-24 14:35:09 +03:00
Jan Lindström
be00265557 Fix compiler errors on product build. 2014-07-23 13:52:17 +03:00
Jan Lindström
ebf3437810 MDEV-5673: Crash while parallel dropping multiple tables under heavy load
Improve long semaphore wait output to include all semaphore waits
and try to find out if there is a sequence of waiters.
2014-07-23 09:04:59 +03:00
Jan Lindström
67eb6f33a9 MDEV-5670: Assertion failure in file buf0lru.c line 2355
Add more status information if repeatable.
2014-07-22 22:08:06 +03:00
unknown
71a596b90c Makes innodb/xtradb compilable in 5.5 2014-07-15 12:37:34 +03:00
Jan Lindström
970163d0be MDEV-6348: mariadb crash signal 11
Analysis: sync array output function, should make sure that all 
used pointers are valid before using them.
2014-07-08 17:21:13 +03:00
Jan Lindström
8d8c456dbb MDEV-5621: Server random crash on ALTER TABLE
This is not a real fix, instead try to gather additional information
at the point when dictionary content is not what we expect it to be.
2014-07-04 12:25:32 +03:00
Jan Lindström
c922048368 MDEV-6191: row_search_for_mysql comment and code consistency about isolation level
and gap locks
2014-07-04 08:42:59 +03:00
Jan Lindström
838977e54d MDEV-6318: MariaDB with XtraDB uses times more of IO events
than with InnoDB plugin
  
  Fix: os0file.h in XtraDB had OS_AIO_N_PENDING_IOS_PER_THREAD 256
  when on InnoDB it is OS_AIO_N_PENDING_IOS_PER_THREAD 32. Changed
  XtraDB also to use 32.
2014-07-04 08:16:45 +03:00
Jan Lindström
6cc5e00586 MDEV-6225: Idle replication slave keeps crashing.
Analysis: Based on crashed the buffer pool instance identifier is
  not correct on block to be freed. Add LRU list mutex holding
  on functions calling free and add additional safety checks.
2014-06-30 14:06:28 +03:00
Sergei Golubchik
315a4efb91 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751805 typo fixed
use ascii 'x' not utf8 '×' for hex numbers
2014-06-16 22:11:54 +02:00
Sergei Golubchik
77ec219d58 cmake: mark AIO_LIBRARY, EVENT_LIBRARY, GROFF, NROFF as advanced;
use -ggdb3 if supported
2014-06-03 10:57:57 +02:00
Sergei Golubchik
2d687cad5d merge with XtraDB 5.5.37-35.0 2014-06-03 09:53:10 +02:00
Jan Lindström
1adf9e7984 MDEV-6257: MariaDB 5.5 fails to start with 10.0 InnoDB log files
Analysis: Can't disable the error message because you may get database
started with incorrect log file size. 

Fix: Thus only improve the error message to give more information 
to users.
2014-05-22 16:20:56 +03:00
Jan Lindström
75137522b9 MDEV-6257: MariaDB 5.5 fails to start with 10.0 InnoDB log files
Analysis: By default 10.0 creates 48M log files and 5.5 assumes they
are 5M.

Fix: Remove the error and do size comparison later.
2014-05-21 13:14:43 +03:00
Jan Lindström
124428a9e2 MDEV-4791: Assertion range_end >= range_start fails in log0online.c
on select from I_S.INNODB_CHANGED_PAGES

Analysis: limit_lsn_range_from_condition() incorrectly parses
start_lsn and/or end_lsn conditions.

Fix from SergeyP. Added some test cases.
2014-05-09 11:03:39 +03:00
Sergei Golubchik
2797f0c534 fix XtraDB version to tell the truth 2014-04-28 12:11:35 +02:00
Michael Widenius
a10a9448b0 Added new states to be able to better diagnose where server hangs.
- Table locks now ends with state "After table lock"
- Open table now ends with state "After opening tables"
- All calls to close_thread_tables(), not only from mysql_execute_command(), has state "closing tables"
- Added state "executing" for mysql admin commands, like CACHE INDEX, REPAIR TABLE etc.
- Added state "Finding key cache" for CACHE INDEX
- Added state "Filling schema table" when we generate temporary table for SHOW commands and information schema.

Other things:
Add limit from innobase for thread_sleep_delay. This fixed a failing tests case.
Added db.opt to support-files to make 'make package' work


mysql-test/suite/funcs_1/datadict/processlist_val.inc:
  Use new state
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
  Updated test result because of new state
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Updated test result because of new state
sql/CMakeLists.txt:
  Have option files in support-files
sql/lock.cc:
  Added new state 'After table lock'
sql/sql_admin.cc:
  Added state "executing" and "Sending data" for mysql admin commands, like CACHE INDEX, REPAIR TABLE etc.
  Added state "Finding key cache"
sql/sql_base.cc:
  open tables now ends with state "After table lock", instead of NULL
sql/sql_parse.cc:
  Moved state "closing tables" to close_thread_tables()
sql/sql_show.cc:
  Added state "Filling schema table" when we generate temporary table for SHOW commands and information schema.
storage/xtradb/buf/buf0buf.c:
  Removed compiler warning
storage/xtradb/handler/ha_innodb.cc:
  Add limit from innobase for thread_sleep_delay. This fixed a failing tests case.
support-files/db.opt:
  cmakes needs this to create data/test directory
2014-05-03 19:12:17 +03:00
Jan Lindström
772aa0c575 MDEV-6160: InnoDB: Failing assertion: page_is_comp(next_page) == page_is_comp(page)
This is not yet a fix. This is change to print additional information at the point
when this assertion is going to happen. Print as much information about the pages
and index to find out why next page is not a compact format.
2014-04-28 08:30:05 +03:00
Sergei Golubchik
cb67dcb618 mysql-5.5.37 selective merge 2014-03-27 22:26:58 +01:00
Sergei Golubchik
5ad18f1236 percona-server-5.5.36-34.0 2014-03-17 17:41:54 +01:00
Jan Lindström
752ba087c8 MDEV-5746: Slow file extend when innodb_use_fallocate=1 and SSD
file storage.

Analysis: posix_fallocate was called using 0 as offset and len as
desired size. This is not optimal for SSDs.

Fix: Call posix_fallocate with correct offset i.e. current file size
and extend the file from there len bytes.
2014-02-26 13:49:50 +02:00
Jan Lindström
e479829a15 MDEV-5742: Assertion failure node->n_pending on fil0fil.c line 5039
on debug build when innodb_use_fallocate=1

Analysis: There was merge error that caused additional call to 
fil_node_complete_io.

Fixed by removing incorrect call and fixed calculation of extended
file size.
2014-02-26 12:06:12 +02:00
Sergei Golubchik
3b5f66dbf9 fix XtraDB to compile on Windows 2014-01-23 00:02:08 +01:00
Sergei Golubchik
ec34edd9c3 Percona-Server-5.5.35-rel33.0.tar.gz 2014-01-22 15:35:42 +01:00
Jan Lindström
a5e236db54 Add additional srv_use_fallocate guard for completing the IO with
read.
2013-11-28 11:34:43 +02:00
Jan Lindström
57a70a635a MDEV-5355: InnoDB assertion at shutdown if posix_fallocate is used in ut_a(node->n_pending == 0 || node->space->stop_new_ops);
Analysis: When filespace is extended there is first prepare for IO. But if
posix_fallocate is used there was no complete IO causing assertion
at shutdown indicating that all IO is not finished.

Fix: If posix_fallocate is used to extend the filespace, there
is no need to wait for IO to complete, thus we treat this
operation as a read operation. We need to mark IO as
completed or there would be assertion on shutdown at
fil_node_close_file() because all pending IO is not finished.
2013-11-27 20:24:52 +02:00
Sergei Golubchik
af2848a423 Percona-Server-5.5.34-rel32.0 merge 2013-11-19 15:43:22 +01:00
Sergei Golubchik
efab095c7f MDEV-5236 Status variables are not all listed alphabetically
sort xtradb status variables
2013-11-19 13:11:42 +01:00
Jan Lindström
e730c91688 Added test case for new system variable innodb_use_stacktrace and made sure that it can be used only on startup. Fixed compiler problems on solaris and other platforms that do not contain necessary headers and functions. 2013-11-15 15:24:42 +02:00
Jan Lindström
338587d2f4 MDEV-5247: DB locked up at btr0cur.c line 568. Additional fixes to inconsistent usage of have_LRU_mutex and added additional debug assertions to guard incorrect usage of this mutex. Fixes issues found on additional testing and mysql test suite. 2013-11-15 11:32:02 +02:00
Jan Lindström
10467ec7b3 Fix compiler error introduced on revision 3937, make sure that stackdump is compiled only on __linux__. 2013-11-14 14:27:46 +02:00
Jan Lindström
5d1ec1b951 MDEV-5247: DB locked up at btr0cur.c line 568. There is inconsistent and non logical usage of have_LRU_mutex and incorrect value on ha_innodb.cc when buf_LRU_free_block is called. Additionally, for future long semaphore wait cases added a new configuration variable innodb_use_stacktrace. If this variable is true a signal handler for SIGUSR2 is installed when InnoDB server starts and when a long semaphore wait is detected at sync/sync0array.c we send SIGUSR2 signal to waiting thread and thread that has acuired RW-latch. For both threads a full stacktrace is produced as well as its is possible. 2013-11-14 12:57:28 +02:00
Michael Widenius
afa49d7919 Fixed core dump when doing "SET GLOBAL innodb_buffer_pool_evict='uncompressed'"
storage/xtradb/handler/ha_innodb.cc:
  Fixed wrong last argument to buf_LRU_free_block(): The LRU chain is already locked by this function.
2013-11-05 20:28:24 +02:00
Sergei Golubchik
1e24cdc85b fix for xtradb to compile on windows 2013-09-08 11:36:34 +02:00
Sergei Golubchik
dfc452217d fix xtradb to compile in both debug and optimized builds 2013-09-07 22:36:34 +02:00
Sergei Golubchik
1904a5d0cc Percona-Server-5.5.33-rel31.1.tar.gz 2013-09-07 13:49:15 +02:00
Sergei Golubchik
a73972bfea don't decide on extended keys by DB_TYPE_INNODB, use hton->flags 2013-08-26 21:13:17 +04:00
Jan Lindström
c97ae6b56f MDEV-4923 Incorrect merge on XtraDB os0file.c. Function os_file_set_atomic_writes returns TRUE when successfull and FALSE at failure. 2013-08-20 16:05:34 +03:00
Vladislav Vaintroub
3ef0157daa MDEV-4815 - allow multiple mysql_server_init() / mysql_server_end() in the same process, for embedded library.
- Reset  static variables that are used to signal "init done"  for DBUG, in dbug_end()
- Set string server variables to NULL after memory for the value is freed - avoids double free()
- fix DBUG_ASSERTs that happened during reinitialization.
2013-07-29 16:03:41 +02:00
unknown
9e13011efb Revert reverted patch (as workaround) to have no problem with ongoing fix. 2013-07-19 13:21:23 +03:00
unknown
c7973615e7 Revert of marko.makela@oracle.com-20130430103950-j353faze84zzk9xf for xtradb
(fix of http://bugs.mysql.com/bug.php?id=69623)
2013-07-17 17:03:59 +03:00
Sergei Golubchik
a5b534a08e merge Percona-Server-5.5.32-rel31.0.tar.gz 2013-07-16 19:30:39 +02:00
Vladislav Vaintroub
3b944843d2 Fix compile error 2013-05-09 23:25:57 +02:00
Sergei Golubchik
da846a153b Merge with XtraDB as of Percona-Server-5.5.30-rel30.2 2013-05-08 10:12:21 +02:00
Sergei Golubchik
e0a08c567a Compilation warnings.
openssl compilation problem.
2013-05-07 18:26:22 +02:00
Vladislav Vaintroub
4d78392be5 MDEV-4398 -
Change default for innodb_use_fallocate to FALSE, due to bugs in older Linux kernels (posix_fallocate() does not always guarantee that file size is like one specified)
2013-04-19 12:08:55 +02:00
Vladislav Vaintroub
0aa607a01a MDEV-4338 - Support FusionIO/directFS atomic writes 2013-04-06 00:35:45 +02:00
Sergei Golubchik
2901497b18 MDEV-4243 Warnings/errors while compiling with clang 2013-03-28 20:04:14 +01:00
Sergei Golubchik
e73f13a707 extend check_global_access() to avoid my_error when it's not needed
(in INFORMATION_SCHEMA).
2013-03-19 15:25:58 +01:00
Sergei Golubchik
0d9a6d52d7 merge with XtraDB as of Percona-Server-5.5.30-rel30.1 2013-03-08 19:08:45 +01:00
Sergei Golubchik
9d72bbf84c merge with XtraDB as of Percona-Server-5.5.29-rel30.0 2013-02-28 23:56:17 +01:00
Sergei Golubchik
8161c6772d merge with mysql-5.5.30 minus few incorrect or not applicable changesets 2013-02-28 18:42:49 +01:00
Sergei Golubchik
7925bf6b40 MDEV-4069 thd_wait_end does not called in some cases in buf_page_read_low in XtraDB engine 2013-01-21 12:20:54 +01:00
Sergei Golubchik
d41d43f421 MDEV-4065 thd_kill_statement service 2013-01-18 19:04:23 +01:00
Sergei Golubchik
cf013ff949 xtradb merge. Percona-Server-5.5.28-rel29.3 2013-01-16 11:13:08 +01:00
Sergei Golubchik
750b9147fc remove thd_mark_as_hard_kill()
(because it's conceptually wrong. only the user can decide whether the kill is
allowed to leave tables in the inconsistent state, storage engine has no say in that)
2013-01-15 17:46:46 +01:00
Michael Widenius
6e9a48b67f Fixed some race conditons and bugs related to killed queries
KILL now breaks locks inside InnoDB
Fixed possible deadlock when running INNODB STATUS
Added ha_kill_query() and kill_query() to send kill signal to all storage engines
Added reset_killed() to ensure we don't reset killed state while awake() is getting called


include/mysql/plugin.h:
  Added thd_mark_as_hard_kill()
include/mysql/plugin_audit.h.pp:
  Added thd_mark_as_hard_kill()
include/mysql/plugin_auth.h.pp:
  Added thd_mark_as_hard_kill()
include/mysql/plugin_ftparser.h.pp:
  Added thd_mark_as_hard_kill()
sql/handler.cc:
  Added ha_kill_query() to send kill signal to all storage engines
sql/handler.h:
  Added ha_kill_query() and kill_query() to send kill signal to all storage engines
sql/log_event.cc:
  Use reset_killed()
sql/mdl.cc:
  use thd->killed instead of thd_killed() to abort on soft kill
sql/sp_rcontext.cc:
  Use reset_killed()
sql/sql_class.cc:
  Fixed possible deadlock in INNODB STATUS by not getting thd->LOCK_thd_data if it's locked.
  Use reset_killed()
  Tell storge engines that KILL has been sent
sql/sql_class.h:
  Added reset_killed() to ensure we don't reset killed state while awake() is getting called.
  Added mark_as_hard_kill()
sql/sql_insert.cc:
  Use reset_killed()
sql/sql_parse.cc:
  Simplify detection of killed queries.
  Use reset_killed()
sql/sql_select.cc:
  Use reset_killed()
sql/sql_union.cc:
  Use reset_killed()
storage/innobase/handler/ha_innodb.cc:
  Added innobase_kill_query()
  Fixed error reporting for interrupted queries.
storage/xtradb/handler/ha_innodb.cc:
  Added innobase_kill_query()
  Fixed error reporting for interrupted queries.
2013-01-11 00:22:14 +02:00
Vladislav Vaintroub
ac45f3b38a Remove timed mutexes in XtraDB - obsolete feature that does not link on Windows, if plugin is build dynamically
It was already  removed from innobase in the past.
2013-01-05 23:52:25 +01:00
Sergei Golubchik
c499fa1ef3 XtraDB from Percona-Server-5.5.28-rel29.1 2012-11-22 11:43:55 +01:00
Vladislav Vaintroub
8d2c12a924 MDEV-3824 - xtradb file rename fails on Windows, if new name already exists.
Changed implementation os_file_rename() on Windows  such as it does not fail if destination file already exists. Now MoveFileEx() with MOVEFILE_REPLACE_EXISTING flag is used, instead of prior MoveFile().
This fixed implementation is better compatible with rename() on POSIX systems.
2012-10-30 19:13:39 +01:00
Sergei Golubchik
d9a8799205 XtraDB 1.1.8-29.0 2012-10-16 10:36:28 +02:00
Sergei Golubchik
c2da54ef26 simplify future xtradb merges (hopefully) 2012-10-12 18:15:38 +02:00
Michael Widenius
ea6a4eef3a Fixed issues found by buildbot & valgrind:
- Wrong thd uses in Item_subselect, could lead to crash
- Inititalize uninitialized variable in new autoincrement handling code


sql/handler.cc:
  More DBUG_PRINT
sql/item_subselect.cc:
  Wrong thd uses in Item_subselect, could lead to crash
storage/innobase/handler/ha_innodb.cc:
  Initialize variable needed by upper level. This only happens when auto-increment value wraps over.
storage/xtradb/handler/ha_innodb.cc:
  Initialize variable needed by upper level. This only happens when auto-increment value wraps over.
2012-10-04 23:52:11 +03:00
Michael Widenius
ae5bc05988 Fix for MDEV-533: Confusing error code when doing auto-increment insert for out-of-range values
create table t1 (a smallint primary key auto_increment);
insert into t1 values(32767);
insert into t1 values(NULL);
ERROR 1062 (23000): Duplicate entry '32767' for key 'PRIMARY

Now on always gets error HA_ERR_AUTOINC_RANGE=167 "Out of range value for column", independent of
store engine, SQL Mode or number of inserted rows. This is an unique error that is easier to test for in replication.

Another bug fix is that we now get an error when trying to insert a too big auto-generated value, even in non-strict mode.
Before one get insted the max column value inserted.
This patch also fixes some issues with inserting negative numbers in an auto-increment column.
Fixed the ER_DUP_ENTRY and HA_ERR_AUTOINC_ERANGE are compared the same between master and slave.
This ensures that replication works between an old server to a new slave for auto-increment overflow errors.
Added SQLSTATE errors for handler errors

Smaller bug fixes:
* Added warnings for duplicate key errors when using INSERT IGNORE
* Fixed bug when using --skip-log-bin followed by --log-bin, which did set log-bin to "0"
* Allow one to see how cmake is called by using --just-print --just-configure


BUILD/FINISH.sh:
  --just-print --just-configure now shows how cmake would be invoked. Good for understanding parameters to cmake.
cmake/configure.pl:
  --just-print --just-configure now shows how cmake would be invoked. Good for understanding parameters to cmake.
include/CMakeLists.txt:
  Added handler_state.h
include/handler_state.h:
  SQLSTATE for handler error messages.
  Required for HA_ERR_AUTOINC_ERANGE, but solves also some other cases.
mysql-test/extra/binlog_tests/binlog.test:
  Fixed old wrong behaviour
  Added more tests
mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
  Reset binary log to only print what's necessary in show_binlog_events
mysql-test/extra/rpl_tests/rpl_auto_increment.test:
  Update to new error codes
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
  Ignore warnings as this depends on how the test is run
mysql-test/include/strict_autoinc.inc:
  On now gets an error on overflow
mysql-test/r/auto_increment.result:
  Update results after fixing error message
mysql-test/r/auto_increment_ranges_innodb.result:
  Test new behaviour
mysql-test/r/auto_increment_ranges_myisam.result:
  Test new behaviour
mysql-test/r/commit_1innodb.result:
  Added warnings for duplicate key error
mysql-test/r/create.result:
  Added warnings for duplicate key error
mysql-test/r/insert.result:
  Added warnings for duplicate key error
mysql-test/r/insert_select.result:
  Added warnings for duplicate key error
mysql-test/r/insert_update.result:
  Added warnings for duplicate key error
mysql-test/r/mix2_myisam.result:
  Added warnings for duplicate key error
mysql-test/r/myisam_mrr.result:
  Added warnings for duplicate key error
mysql-test/r/null_key.result:
  Added warnings for duplicate key error
mysql-test/r/replace.result:
  Update to new error codes
mysql-test/r/strict_autoinc_1myisam.result:
  Update to new error codes
mysql-test/r/strict_autoinc_2innodb.result:
  Update to new error codes
mysql-test/r/strict_autoinc_3heap.result:
  Update to new error codes
mysql-test/r/trigger.result:
  Added warnings for duplicate key error
mysql-test/r/xtradb_mrr.result:
  Added warnings for duplicate key error
mysql-test/suite/binlog/r/binlog_innodb_row.result:
  Updated result
mysql-test/suite/binlog/r/binlog_row_binlog.result:
  Out of range data for auto-increment is not inserted anymore
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
  Updated result
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
  Out of range data for auto-increment is not inserted anymore
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Updated result
mysql-test/suite/innodb/r/innodb-autoinc.result:
  Update to new error codes
mysql-test/suite/innodb/r/innodb-lock.result:
  Updated results
mysql-test/suite/innodb/r/innodb.result:
  Updated results
mysql-test/suite/innodb/r/innodb_bug56947.result:
  Updated results
mysql-test/suite/innodb/r/innodb_mysql.result:
  Updated results
mysql-test/suite/innodb/t/innodb-autoinc.test:
  Update to new error codes
mysql-test/suite/maria/maria3.result:
  Updated result
mysql-test/suite/maria/mrr.result:
  Updated result
mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result:
  Updated result
mysql-test/suite/rpl/r/rpl_auto_increment.result:
  Update to new error codes
mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff:
  Updated results
mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
  Updated results
mysql-test/t/auto_increment.test:
  Update to new error codes
mysql-test/t/auto_increment_ranges.inc:
  Test new behaviour
mysql-test/t/auto_increment_ranges_innodb.test:
  Test new behaviour
mysql-test/t/auto_increment_ranges_myisam.test:
  Test new behaviour
mysql-test/t/replace.test:
  Update to new error codes
mysys/my_getopt.c:
  Fixed bug when using --skip-log-bin followed by --log-bin, which did set log-bin to "0"
sql/handler.cc:
  Ignore negative values for signed auto-increment columns
  Always give an error if we get an overflow for an auto-increment-column (instead of inserting the max value)
  Ensure that the row number is correct for the out-of-range-value error message.
  
  
  ******
  Fixed wrong printing of column namn for "Out of range value" errors
  Fixed that INSERT_ID is correctly replicated also for out-of-range autoincrement values
  Fixed that print_keydup_error() can also be used to generate warnings
  ******
  Return HA_ERR_AUTOINC_ERANGE (167) instead of ER_WARN_DATA_OUT_OF_RANGE for auto-increment overflow
sql/handler.h:
  Allow INSERT IGNORE to continue also after out-of-range inserts.
  Fixed that print_keydup_error() can also be used to generate warnings
sql/log_event.cc:
  Added DBUG_PRINT
  Fixed the ER_AUTOINC_READ_FAILED, ER_DUP_ENTRY and HA_ERR_AUTOINC_ERANGE are compared the same between master and slave.
  This ensures that replication works between an old server to a new slave for auto-increment overflow errors.
sql/sql_insert.cc:
  Add warnings for duplicate key errors when using INSERT IGNORE
sql/sql_state.c:
  Added handler errors
sql/sql_table.cc:
  Update call to print_keydup_error()
storage/innobase/handler/ha_innodb.cc:
  Fixed increment handling of auto-increment columns to be consistent with rest of MariaDB.
storage/xtradb/handler/ha_innodb.cc:
  Fixed increment handling of auto-increment columns to be consistent with rest of MariaDB.
2012-09-18 15:14:19 +03:00
Sergei Golubchik
6af914f8b9 XtraDB from Percona-Server-5.5.27-rel28.1 2012-09-05 13:14:37 +02:00
Sergei Golubchik
0af0e7a70a merge XtraDB 1.1.8-27.0 from Percona-Server-5.5.25a-rel27.1 2012-08-22 09:56:20 +02:00
Michael Widenius
75e8ce6d73 Ensure we don't assert with debug binaries if SHOW INNODB STATUS returns with an error.
sql/handler.cc:
  SHOW INNODB STATUS sometimes returns 0 even if it has generated an error.
  This code is here to catch it until InnoDB some day is fixed.
storage/innobase/handler/ha_innodb.cc:
  Catch at least one of the possible errors from SHOW INNODB STATUS to provide a correct return code.
storage/xtradb/handler/ha_innodb.cc:
  Catch at least one of the possible errors from SHOW INNODB STATUS to provide a correct return code.
support-files/my-huge.cnf.sh:
  Fixed typo
2012-08-20 22:54:15 +03:00
Michael Widenius
dd8bd2e4c3 Fixed compiler warnings
sql/item_subselect.cc:
  Added purecov info
sql/sql_select.cc:
  Added cast
storage/innobase/handler/ha_innodb.cc:
  Added cast
storage/xtradb/btr/btr0btr.c:
  Added buf_block_get_frame_fast() to avoid compiler warning
storage/xtradb/handler/ha_innodb.cc:
  Added cast
storage/xtradb/include/buf0buf.h:
  Innodb has buf_block_get_frame(block) defined as (block)->frame.
  Didn't want to do a big change to break xtradb as it may use block_get_frame() differently, so I mad this quick hack to patch one compiler warning.
2012-08-15 09:34:18 +03:00
Michael Widenius
b886cac712 Fixed compiler errors
Updated test to also work on 32 bit

mysql-test/suite/heap/heap.test:
  Updated test to also work on 32 bit
2012-08-14 19:59:28 +03:00
Michael Widenius
a7123f5075 Fixed compiler warnings
sql/log.h:
  Fixed compiler warnings reported for gcc 2.7.1
storage/xtradb/handler/ha_innodb.cc:
  Remove not used variables
2012-08-06 16:33:11 +03:00
Michael Widenius
44d8fe9646 Don't abort InnoDB/XtraDB if one can't allocate resources for AIO
- Better error messages

This fixes that one again can run the test systems with many threads without having to increase fs.aio-max-nr.


mysql-test/include/mtr_check.sql:
  Ignore the INNODB_USE_NATIVE_AIO variable (may change during execution)
mysql-test/mysql-test-run.pl:
  Ignore warnings for failure to setup AIO
storage/innobase/os/os0file.c:
  Continue without AIO even if we can't allocate resources for AIO
storage/xtradb/os/os0file.c:
  Continue without AIO even if we can't allocate resources for AIO
storage/xtradb/srv/srv0start.c:
  Give an error message (instead of core dump) if AIO can't be initialized
2012-06-27 17:13:12 +03:00
Sergei Golubchik
39005ea06f MDEV-349 5.5 xtradb innodb_prefix_index_liftedlimit crash with valgrind
This is XtraDB bug lp:1015109, introduced by innodb_split_buf_pool_mutex.patch

Comment the offending assertion, until the fixed XtraDB is available
2012-06-21 11:26:53 +02:00
Vladislav Vaintroub
49cadc9114 MDEV-361 - Fix handle leak in os_thread_create (Windows) 2012-06-21 00:49:24 +02:00
Sergei Golubchik
37f5632212 merged with XtraDB 1.1.8-26.0 2012-06-15 14:54:23 +02:00
Sergei Golubchik
13982b5a11 comments 2012-06-15 10:26:06 +02:00
Sergei Golubchik
d2ca6d2e7f apply mysql fix for bug#58421 to XtraDB 2012-06-08 14:50:50 +02:00
unknown
8efc63ba5d Merge 2012-06-06 16:19:48 +03:00
Sergei Golubchik
265d5aaa2e MDEV-308 lp:1008516 - Failing assertion: templ->mysql_col_len == len
remove the offending assert.
take the test case from mysql Bug#58015
2012-06-04 23:22:03 +02:00
Sergei Golubchik
44cf9ee5f7 5.3 merge 2012-05-04 07:16:38 +02:00
Vladislav Vaintroub
2004bd1736 merge 2012-04-16 23:35:38 +02:00
Vladislav Vaintroub
806df88cc6 merge 2012-04-16 23:32:50 +02:00