diff options
author | Noah Misch <noah@leadboat.com> | 2013-06-26 20:00:08 -0400 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2013-06-26 20:22:25 -0400 |
commit | 19085116eeecfde0a3fc1611eaffccc35bcec204 (patch) | |
tree | 415f6a5e558f735c107cda09a81709898ee1f028 /src/backend/tcop/postgres.c | |
parent | a855148a29b786b179308b3bd5c59fe5b67110d8 (diff) | |
download | postgresql-19085116eeecfde0a3fc1611eaffccc35bcec204.tar.gz postgresql-19085116eeecfde0a3fc1611eaffccc35bcec204.zip |
Cooperate with the Valgrind instrumentation framework.
Valgrind "client requests" in aset.c and mcxt.c teach Valgrind and its
Memcheck tool about the PostgreSQL allocator. This makes Valgrind
roughly as sensitive to memory errors involving palloc chunks as it is
to memory errors involving malloc chunks. Further client requests in
PageAddItem() and printtup() verify that all bits being added to a
buffer page or furnished to an output function are predictably-defined.
Those tests catch failures of C-language functions to fully initialize
the bits of a Datum, which in turn stymie optimizations that rely on
_equalConst(). Define the USE_VALGRIND symbol in pg_config_manual.h to
enable these additions. An included "suppression file" silences nominal
errors we don't plan to fix.
Reviewed in earlier versions by Peter Geoghegan and Korry Douglas.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 31ea31304b4..ad258b74fd9 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -69,6 +69,7 @@ #include "tcop/tcopprot.h" #include "tcop/utility.h" #include "utils/lsyscache.h" +#include "utils/memdebug.h" #include "utils/memutils.h" #include "utils/ps_status.h" #include "utils/snapmgr.h" @@ -846,6 +847,10 @@ exec_simple_query(const char *query_string) TRACE_POSTGRESQL_QUERY_START(query_string); +#ifdef USE_VALGRIND + VALGRIND_PRINTF("statement: %s\n", query_string); +#endif + /* * We use save_log_statement_stats so ShowUsage doesn't report incorrect * results because ResetUsage wasn't called. |