pgpool2.git / summary / log / commit / refs

commit    ad77fabaa63e4d0ce4c826fd977cbfa41ef3243a
Author:   Toshihiro Kitagawa <kitagawa at sraoss.co.jp>
Date:     Mon Sep 05 09:49:37 2011 +0000

    Fix bug with timestamp rewriting.
    The fix in rev.1.17 was insufficient.


pool_timestamp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pool_timestamp.c b/pool_timestamp.c index 6d0bd2533..9090e4f20 100644 --- a/pool_timestamp.c +++ b/pool_timestamp.c @@ -256,9 +256,11 @@ rewrite_timestamp_walker(Node *node, void *context) /* `now()' FuncCall */ FuncCall *fcall = (FuncCall *) node; - if (list_length(fcall->funcname) == 2 && - strcmp("pg_catalog", strVal(linitial(fcall->funcname))) == 0 && - strcmp("now", strVal(lsecond(fcall->funcname))) == 0) + if ((list_length(fcall->funcname) == 1 && + strcmp("now", strVal(linitial(fcall->funcname))) == 0) || + (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); [parent: 51c432c67605]