diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-17 19:33:32 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-17 19:33:32 +0000 |
commit | 49451ae03e7b240b4403b4a37a8f8a7107dc1a76 (patch) | |
tree | b8244557e79afa5c6e038cd001bd062d90a258cc | |
parent | 4fe1a12c54f31697dfc1ed09ad6716cefb4aa8bf (diff) | |
download | postgresql-49451ae03e7b240b4403b4a37a8f8a7107dc1a76.tar.gz postgresql-49451ae03e7b240b4403b4a37a8f8a7107dc1a76.zip |
Add code so that when COPY_PARSE_PLAN_TREES is defined, the copy and
equal functions are checked for raw parse trees as well as post-analysis
trees. This was never very important before, but the upcoming plan cache
control module will need to be able to do copyObject() on raw parse trees.
-rw-r--r-- | src/backend/tcop/postgres.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 9ca8b981ee7..f00897ee622 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.523 2007/02/15 23:23:23 alvherre Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.524 2007/02/17 19:33:32 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -540,6 +540,19 @@ pg_parse_query(const char *query_string) if (log_parser_stats) ShowUsage("PARSER STATISTICS"); +#ifdef COPY_PARSE_PLAN_TREES + /* Optional debugging check: pass raw parsetrees through copyObject() */ + { + List *new_list = (List *) copyObject(raw_parsetree_list); + + /* This checks both copyObject() and the equal() routines... */ + if (!equal(new_list, raw_parsetree_list)) + elog(WARNING, "copyObject() failed to produce an equal raw parse tree"); + else + raw_parsetree_list = new_list; + } +#endif + return raw_parsetree_list; } |