提交 4111340a 编写于 作者: H Hao Wu 提交者: Asim R P

Make the macro of FAULT_INJECTOR configurable

Definition FAULT_INJECTOR is hardcoded in a header(pg_config_manual.h)
file.  Fault injector is useful, but it may introduce some issues in
production stage, like runtime cost, security problems.  It's better
to enable this feature in development and disable it in release.  The
--enable-debug-extensions configure option is used to control this
feature.
上级 085c3b25
......@@ -3414,7 +3414,9 @@ if test "${enable_debug_extensions+set}" = set; then :
enableval=$enable_debug_extensions;
case $enableval in
yes)
:
$as_echo "#define FAULT_INJECTOR 1" >>confdefs.h
;;
no)
:
......@@ -3426,7 +3428,7 @@ if test "${enable_debug_extensions+set}" = set; then :
else
enable_debug_extensions=yes
$as_echo "#define FAULT_INJECTOR 1" >>confdefs.h
fi
......
......@@ -229,8 +229,10 @@ AC_SUBST(enable_pxf)
#
# include debug extensions in gpcontrib
#
PGAC_ARG_BOOL(enable, debug-extensions, yes,
[exclude debug extensions in gpcontrib])
PGAC_ARG_BOOL (enable, debug-extensions, yes,
[exclude debug extensions in gpcontrib],
[AC_DEFINE([FAULT_INJECTOR], 1,
[Define to 1 to build with fault injector. (--enable-faultinjector)])])
AC_SUBST(enable_debug_extensions)
#
......
......@@ -61,6 +61,9 @@
(--enable-thread-safety) */
#undef ENABLE_THREAD_SAFETY
/* Define to 1 to build with fault injector. (--enable-debug-extensions) */
#undef FAULT_INJECTOR
/* Define to nothing if C supports flexible array members, and to 1 if it does
not. That way, with a declaration like `struct s { int n; double
d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
......
......@@ -315,11 +315,6 @@
*/
/* #define WAL_DEBUG */
/*
* Enable injecting faults.
*/
#define FAULT_INJECTOR 1
/*
* Enable tracing of resource consumption during sort operations;
* see also the trace_sort GUC var. For 8.1 this is enabled by default.
......
......@@ -9,7 +9,7 @@
#ifndef FAULTINJECTOR_H
#define FAULTINJECTOR_H
#include "pg_config_manual.h"
#include "pg_config.h"
#define FAULTINJECTOR_MAX_SLOTS 16
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册