Fix incorrect time stamp rewriting in replication mode for certain time zones.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 11 Sep 2013 14:21:51 +0000 (23:21 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 11 Sep 2013 14:21:51 +0000 (23:21 +0900)
Time stamp rewriting calls "SELECT now()" to get current
time. Unfortunately the buffer for the current time is too small for
certain time zones such as "02:30". Note that non-30-minutes-time-zone
such as "0900" does not reveal the problem. This explains why we
haven't the bug report until today. Bug reported in [pgpool-general:
2113] and fix provided by Sean Hogan.

src/rewrite/pool_timestamp.c

index 6d68a884203ec1c2d1ced0fe54b0da44ff9d7f85..14346f2646104d4b582264b08c61cb6192ecc1ae 100644 (file)
@@ -5,7 +5,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2011     PgPool Global Development Group
+ * Copyright (c) 2003-2013     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -312,7 +312,7 @@ get_current_timestamp(POOL_CONNECTION_POOL *backend)
 {
        POOL_SELECT_RESULT *res;
        POOL_STATUS              status;
-       static char             timestamp[32];
+       static char             timestamp[64];
 
        status = do_query(MASTER(backend), "SELECT now()", &res, MAJOR(backend));
        if (status != POOL_CONTINUE)