From: Toshihiro Kitagawa Date: Tue, 21 Jun 2011 07:24:00 +0000 (+0000) Subject: Fix bug which does not rewrite timestamp. X-Git-Tag: V3_1_0_ALPHA3~17 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=26be6efc7844d10c33aca8ed4f70c6ae5d366630;p=pgpool2.git Fix bug which does not rewrite timestamp. Fix rewrite_timestamp_walker so that it can process 2 cell list. This used to work but was broken in 3.1.0 alpha2 using 9.0 parser. Change history of functions to create lists in gram.y: SystemFuncName() SystemTypeName() 8.1.3 original list_make2() list_make2() 8.1 import list_make1() list_make1() 8.3 import list_make1() list_make1() 8.4 import list_make1() list_make2() 9.0 import list_make2() list_make2() --- diff --git a/pool_timestamp.c b/pool_timestamp.c index 3ca7ef2d4..0ece78faf 100644 --- a/pool_timestamp.c +++ b/pool_timestamp.c @@ -239,8 +239,9 @@ rewrite_timestamp_walker(Node *node, void *context) /* `now()' FuncCall */ FuncCall *fcall = (FuncCall *) node; - if (list_length(fcall->funcname) == 1 && - strcmp("now", strVal(linitial(fcall->funcname))) == 0) + if (list_length(fcall->funcname) == 2 && + strcmp("pg_catalog", strVal(linitial(fcall->funcname))) == 0 && + strcmp("now", strVal(lsecond(fcall->funcname))) == 0) { TypeCast *tc = makeNode(TypeCast); tc->arg = makeTsExpr(ctx);