mariadb/include
Alfranio Correia 5280dc82c1 WL#4828 and BUG#45747
NOTE: Backporting the patch to next-mr.

WL#4828 Augment DBUG_ENTER/DBUG_EXIT to crash MySQL in different functions
-------

The assessment of the replication code in the presence of faults is extremely
import to increase reliability. In particular, one needs to know if servers
will either correctly recovery or print out appropriate error messages thus
avoiding unexpected problems in a production environment.

In order to accomplish this, the current patch refactories the debug macros
already provided in the source code and introduces three new macros that
allows to inject faults, specifically crashes, while entering or exiting a
function or method. For instance, to crash a server while returning from
the init_slave function (see module sql/slave.cc), one needs to do what
follows:

1 - Modify the source replacing DBUG_RETURN by DBUG_CRASH_RETURN;

  DBUG_CRASH_RETURN(0);

2 - Use the debug variable to activate dbug instructions:

  SET SESSION debug="+d,init_slave_crash_return";

The new macros are briefly described below:

DBUG_CRASH_ENTER (function) is equivalent to DBUG_ENTER which registers the
beginning of a function but in addition to it allows for crashing the server
while entering the function if the appropriate dbug instruction is activate.
In this case, the dbug instruction should be "+d,function_crash_enter".

DBUG_CRASH_RETURN (value) is equivalent to DBUG_RETURN which notifies the
end of a function but in addition to it allows for crashing the server
while returning from the function if the appropriate dbug instruction is
activate. In this case, the dbug instruction should be
"+d,function_crash_return". Note that "function" should be the same string
used by either the DBUG_ENTER or DBUG_CRASH_ENTER.

DBUG_CRASH_VOID_RETURN (value) is equivalent to DBUG_VOID_RETURN which
notifies the end of a function but in addition to it allows for crashing
the server while returning from the function if the appropriate dbug
instruction is activate. In this case, the dbug instruction should be
"+d,function_crash_return". Note that "function" should be the same string
used by either the DBUG_ENTER or DBUG_CRASH_ENTER.

To inject other faults, for instance, wrong return values, one should rely
on the macros already available. The current patch also removes a set of
macros that were either not being used or were redundant as other macros
could be used to provide the same feature. In the future, we also consider
dynamic instrumentation of the code.


BUG#45747 DBUG_CRASH_* is not setting the strict option
---------
      
When combining DBUG_CRASH_* with "--debug=d:t:i:A,file" the server crashes
due to a call to the abort function in the DBUG_CRASH_* macro althought the
appropriate keyword has not been set.
2009-09-29 14:55:36 +01:00
..
atomic WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
mysql Backport WL#3653 to 5.1 to enable bundled innodb plugin. 2009-06-10 10:59:49 +02:00
.cvsignore
base64.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
config-netware.h Auto-merge 2009-07-31 15:28:15 -04:00
config-win.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
decimal.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
errmsg.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
ft_global.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
hash.h merging with mysql-5.0-bugteam 2009-06-19 17:58:46 +05:30
heap.h Added support for 'internal temporary tables' in HEAP tables. 2007-07-25 01:58:12 +03:00
help_end.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
help_start.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
keycache.h Backport of the keycache changes from http://lists.mysql.com/commits/31517 to make keycache 64-bit safe in 5.0. This is for bug #5731. 2007-08-29 20:45:04 +04:00
m_ctype.h Backport WL#3653 to 5.1 to enable bundled innodb plugin. 2009-06-10 10:59:49 +02:00
m_string.h Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main 2008-02-08 12:13:33 +01:00
Makefile.am reverting a bogus fix into 5.1-bugteam 2009-03-20 13:18:29 +02:00
my_aes.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_alarm.h Many files: 2006-12-23 20:17:15 +01:00
my_alloc.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_atomic.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_attribute.h Bug#25118 ATTRIBUTE_FORMAT_FPTR undeclared in m_ctype.h 2007-04-12 00:43:25 +02:00
my_base.h merge 5.0-bugteam to 5.1-bugteam 2009-07-24 12:15:06 +05:30
my_bit.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_bitmap.h Bug#31552 Replication breaks when deleting rows from out-of-sync table 2007-12-12 12:14:59 +02:00
my_dbug.h WL#4828 and BUG#45747 2009-09-29 14:55:36 +01:00
my_dir.h Many files: 2006-12-23 20:17:15 +01:00
my_getopt.h Bug#39289 libmysqld.a calls exit() upon error 2008-10-27 13:57:59 +04:00
my_global.h Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
my_handler.h Fixed problem with non-synchronous error lists 2008-03-28 18:45:03 +02:00
my_libwrap.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_list.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_md5.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_net.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_no_pthread.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_nosys.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_pthread.h Bug#38477: my_pthread_setprio can change dispatch class on Solaris, not just priority 2008-10-15 19:28:26 -03:00
my_stacktrace.h Bug#37003 Tests sporadically crashes with embedded server 2008-06-19 11:02:32 -03:00
my_sys.h Bug #45287: phase 2 : 5.0 64 bit compilation warnings 2009-07-16 15:37:38 +03:00
my_time.h Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26294/my50-bug26294 2008-04-03 13:14:57 -04:00
my_tree.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_trie.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_uctype.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
my_user.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_vle.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_xml.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
myisam.h Bug#43940 64-bit windows myisamchk doesn't support key_buffer_size > 4G 2009-05-27 13:11:28 +05:00
myisammrg.h Bug#45800 crash when replacing into a merge table and there is a duplicate 2009-07-30 16:04:41 +05:30
myisampack.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
mysql.h Merge mysql.com:/Users/davi/mysql/bugs/29592-5.0 2007-11-26 16:10:26 -02:00
mysql.h.pp WL#4380 2008-08-08 14:30:05 +05:30
mysql_com.h Bug#27430 "Crash in subquery code when in PS and table DDL changed after 2008-05-20 20:36:26 +04:00
mysql_embed.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
mysql_time.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql_version.h.in Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
mysys_err.h WL#2936 2007-03-02 08:43:45 -08:00
queues.h Bug #31890 Partitions: ORDER BY DESC in InnoDB not working. 2007-11-14 22:20:31 +04:00
rijndael.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sha1.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sql_common.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sslopt-case.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sslopt-longopts.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
sslopt-vars.h WL#5016: Fix header file include guards 2009-09-23 23:32:31 +02:00
t_ctype.h Many files: 2006-12-23 20:17:15 +01:00
thr_alarm.h fixes for build failures due to my yesterday's changeset forbidding 2008-02-19 18:45:11 +01:00
thr_lock.h Bug#44164: TL_WRITE has no description in lock_descriptions[] 2009-04-14 14:05:32 +02:00
typelib.h Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines 2007-04-27 19:09:39 +02:00
violite.h Merge from 5.0 2009-07-23 13:53:28 +02:00