diff options
author | Tom Lane | 2005-09-09 02:31:50 +0000 |
---|---|---|
committer | Tom Lane | 2005-09-09 02:31:50 +0000 |
commit | a239af02c3585f4355737230bc54902e8217f76e (patch) | |
tree | 0b14018187b6cd72bc07d0212b8089566dffa9dd /src/timezone/pgtz.c | |
parent | 48123de71792c367313542883f0e9df7d850c994 (diff) |
Fix the various forms of AT TIME ZONE to accept either timezones found
in the zic database or zone names found in the date token table. This
preserves the old ability to do AT TIME ZONE 'PST' along with the new
ability to do AT TIME ZONE 'PST8PDT'. Per gripe from Bricklen Anderson.
Also, fix some inconsistencies in usage of TZ_STRLEN_MAX --- the old
code had the potential for one-byte buffer overruns, though given
alignment considerations it's unlikely there was any real risk.
Diffstat (limited to 'src/timezone/pgtz.c')
-rw-r--r-- | src/timezone/pgtz.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c index 305bea2e5eb..2512061222a 100644 --- a/src/timezone/pgtz.c +++ b/src/timezone/pgtz.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.36 2005/06/26 23:32:34 tgl Exp $ + * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.37 2005/09/09 02:31:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -974,7 +974,7 @@ init_timezone_hashtable(void) MemSet(&hash_ctl, 0, sizeof(hash_ctl)); - hash_ctl.keysize = TZ_STRLEN_MAX; + hash_ctl.keysize = TZ_STRLEN_MAX + 1; hash_ctl.entrysize = sizeof(pg_tz); timezone_cache = hash_create("Timezones", @@ -997,7 +997,7 @@ pg_tzset(const char *name) pg_tz *tzp; pg_tz tz; - if (strlen(name) >= TZ_STRLEN_MAX) + if (strlen(name) > TZ_STRLEN_MAX) return NULL; /* not going to fit */ if (!timezone_cache) |