Skip to content

Commit 49451ae

Browse files
committed
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.
1 parent 4fe1a12 commit 49451ae

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/backend/tcop/postgres.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.523 2007/02/15 23:23:23 alvherre Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.524 2007/02/17 19:33:32 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -540,6 +540,19 @@ pg_parse_query(const char *query_string)
540540
if (log_parser_stats)
541541
ShowUsage("PARSER STATISTICS");
542542

543+
#ifdef COPY_PARSE_PLAN_TREES
544+
/* Optional debugging check: pass raw parsetrees through copyObject() */
545+
{
546+
List *new_list = (List *) copyObject(raw_parsetree_list);
547+
548+
/* This checks both copyObject() and the equal() routines... */
549+
if (!equal(new_list, raw_parsetree_list))
550+
elog(WARNING, "copyObject() failed to produce an equal raw parse tree");
551+
else
552+
raw_parsetree_list = new_list;
553+
}
554+
#endif
555+
543556
return raw_parsetree_list;
544557
}
545558

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy