diff options
Diffstat (limited to 'src/include/utils')
-rw-r--r-- | src/include/utils/.gitignore | 1 | ||||
-rw-r--r-- | src/include/utils/guc.h | 24 | ||||
-rw-r--r-- | src/include/utils/inval.h | 18 | ||||
-rw-r--r-- | src/include/utils/meson.build | 7 | ||||
-rw-r--r-- | src/include/utils/numeric.h | 22 | ||||
-rw-r--r-- | src/include/utils/pg_lsn.h | 5 |
6 files changed, 64 insertions, 13 deletions
diff --git a/src/include/utils/.gitignore b/src/include/utils/.gitignore index c1b4c662139..30f921429c6 100644 --- a/src/include/utils/.gitignore +++ b/src/include/utils/.gitignore @@ -1,5 +1,6 @@ /fmgroids.h /fmgrprotos.h +/guc_tables.inc.c /probes.h /errcodes.h /header-stamp diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index f619100467d..756e80a2c2f 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -247,6 +247,7 @@ typedef enum /* GUC vars that are actually defined in guc_tables.c, rather than elsewhere */ extern PGDLLIMPORT bool Debug_print_plan; extern PGDLLIMPORT bool Debug_print_parse; +extern PGDLLIMPORT bool Debug_print_raw_parse; extern PGDLLIMPORT bool Debug_print_rewritten; extern PGDLLIMPORT bool Debug_pretty_print; @@ -254,8 +255,31 @@ extern PGDLLIMPORT bool Debug_pretty_print; extern PGDLLIMPORT bool Debug_copy_parse_plan_trees; extern PGDLLIMPORT bool Debug_write_read_parse_plan_trees; extern PGDLLIMPORT bool Debug_raw_expression_coverage_test; + +/* + * support for legacy compile-time settings + */ + +#ifdef COPY_PARSE_PLAN_TREES +#define DEFAULT_DEBUG_COPY_PARSE_PLAN_TREES true +#else +#define DEFAULT_DEBUG_COPY_PARSE_PLAN_TREES false +#endif + +#ifdef READ_WRITE_PARSE_PLAN_TREES +#define DEFAULT_DEBUG_READ_WRITE_PARSE_PLAN_TREES true +#else +#define DEFAULT_DEBUG_READ_WRITE_PARSE_PLAN_TREES false +#endif + +#ifdef RAW_EXPRESSION_COVERAGE_TEST +#define DEFAULT_DEBUG_RAW_EXPRESSION_COVERAGE_TEST true +#else +#define DEFAULT_DEBUG_RAW_EXPRESSION_COVERAGE_TEST false #endif +#endif /* DEBUG_NODE_TESTS_ENABLED */ + extern PGDLLIMPORT bool log_parser_stats; extern PGDLLIMPORT bool log_planner_stats; extern PGDLLIMPORT bool log_executor_stats; diff --git a/src/include/utils/inval.h b/src/include/utils/inval.h index 9b871caef62..af466252578 100644 --- a/src/include/utils/inval.h +++ b/src/include/utils/inval.h @@ -20,6 +20,24 @@ extern PGDLLIMPORT int debug_discard_caches; +#define MIN_DEBUG_DISCARD_CACHES 0 + +#ifdef DISCARD_CACHES_ENABLED + /* Set default based on older compile-time-only cache clobber macros */ +#if defined(CLOBBER_CACHE_RECURSIVELY) +#define DEFAULT_DEBUG_DISCARD_CACHES 3 +#elif defined(CLOBBER_CACHE_ALWAYS) +#define DEFAULT_DEBUG_DISCARD_CACHES 1 +#else +#define DEFAULT_DEBUG_DISCARD_CACHES 0 +#endif +#define MAX_DEBUG_DISCARD_CACHES 5 +#else /* not DISCARD_CACHES_ENABLED */ +#define DEFAULT_DEBUG_DISCARD_CACHES 0 +#define MAX_DEBUG_DISCARD_CACHES 0 +#endif /* not DISCARD_CACHES_ENABLED */ + + typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, uint32 hashvalue); typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid); typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid); diff --git a/src/include/utils/meson.build b/src/include/utils/meson.build index 78c6b9b0a23..0a2ea8fa32c 100644 --- a/src/include/utils/meson.build +++ b/src/include/utils/meson.build @@ -30,6 +30,13 @@ errcodes = custom_target('errcodes', ) generated_headers += errcodes +guc_tables = custom_target('guc_tables', + input: files('../../backend/utils/misc/guc_parameters.dat'), + output: ['guc_tables.inc.c'], + depend_files: catalog_pm, + command: [perl, files('../../backend/utils/misc/gen_guc_tables.pl'), '@INPUT@', '@OUTPUT@']) +generated_headers += guc_tables + if dtrace.found() probes_tmp = custom_target('probes.h.tmp', input: files('../../backend/utils/probes.d'), diff --git a/src/include/utils/numeric.h b/src/include/utils/numeric.h index 9e79fc376cb..215f1ea4f53 100644 --- a/src/include/utils/numeric.h +++ b/src/include/utils/numeric.h @@ -17,6 +17,9 @@ #include "common/pg_prng.h" #include "fmgr.h" +/* forward declaration to avoid node.h include */ +typedef struct Node Node; + /* * Limits on the precision and scale specifiable in a NUMERIC typmod. The * precision is strictly positive, but the scale may be positive or negative. @@ -91,18 +94,13 @@ extern char *numeric_normalize(Numeric num); extern Numeric int64_to_numeric(int64 val); extern Numeric int64_div_fast_to_numeric(int64 val1, int log10val2); -extern Numeric numeric_add_opt_error(Numeric num1, Numeric num2, - bool *have_error); -extern Numeric numeric_sub_opt_error(Numeric num1, Numeric num2, - bool *have_error); -extern Numeric numeric_mul_opt_error(Numeric num1, Numeric num2, - bool *have_error); -extern Numeric numeric_div_opt_error(Numeric num1, Numeric num2, - bool *have_error); -extern Numeric numeric_mod_opt_error(Numeric num1, Numeric num2, - bool *have_error); -extern int32 numeric_int4_opt_error(Numeric num, bool *have_error); -extern int64 numeric_int8_opt_error(Numeric num, bool *have_error); +extern Numeric numeric_add_safe(Numeric num1, Numeric num2, Node *escontext); +extern Numeric numeric_sub_safe(Numeric num1, Numeric num2, Node *escontext); +extern Numeric numeric_mul_safe(Numeric num1, Numeric num2, Node *escontext); +extern Numeric numeric_div_safe(Numeric num1, Numeric num2, Node *escontext); +extern Numeric numeric_mod_safe(Numeric num1, Numeric num2, Node *escontext); +extern int32 numeric_int4_safe(Numeric num, Node *escontext); +extern int64 numeric_int8_safe(Numeric num, Node *escontext); extern Numeric random_numeric(pg_prng_state *state, Numeric rmin, Numeric rmax); diff --git a/src/include/utils/pg_lsn.h b/src/include/utils/pg_lsn.h index ae198af7450..461a4fdcba9 100644 --- a/src/include/utils/pg_lsn.h +++ b/src/include/utils/pg_lsn.h @@ -18,6 +18,9 @@ #include "access/xlogdefs.h" #include "fmgr.h" +/* forward declaration to avoid node.h include */ +typedef struct Node Node; + static inline XLogRecPtr DatumGetLSN(Datum X) { @@ -33,6 +36,6 @@ LSNGetDatum(XLogRecPtr X) #define PG_GETARG_LSN(n) DatumGetLSN(PG_GETARG_DATUM(n)) #define PG_RETURN_LSN(x) return LSNGetDatum(x) -extern XLogRecPtr pg_lsn_in_internal(const char *str, bool *have_error); +extern XLogRecPtr pg_lsn_in_safe(const char *str, Node *escontext); #endif /* PG_LSN_H */ |