mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 08:01:23 +02:00
Fix pointer-advancement bugs in MS and US cases of new to_timestamp() code.
Alex Hunsaker
This commit is contained in:
parent
3d8fd75732
commit
b1e929f295
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
* formatting.c
|
* formatting.c
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.147 2008/09/11 17:32:34 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.148 2008/09/26 15:35:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
|
||||||
@ -2537,7 +2537,7 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
|
|||||||
out->ms *= len == 1 ? 100 :
|
out->ms *= len == 1 ? 100 :
|
||||||
len == 2 ? 10 : 1;
|
len == 2 ? 10 : 1;
|
||||||
|
|
||||||
s += len + SKIP_THth(n->suffix);
|
s += SKIP_THth(n->suffix);
|
||||||
break;
|
break;
|
||||||
case DCH_US: /* microsecond */
|
case DCH_US: /* microsecond */
|
||||||
len = from_char_parse_int_len(&out->us, &s, 6, n);
|
len = from_char_parse_int_len(&out->us, &s, 6, n);
|
||||||
@ -2548,7 +2548,7 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
|
|||||||
len == 4 ? 100 :
|
len == 4 ? 100 :
|
||||||
len == 5 ? 10 : 1;
|
len == 5 ? 10 : 1;
|
||||||
|
|
||||||
s += len + SKIP_THth(n->suffix);
|
s += SKIP_THth(n->suffix);
|
||||||
break;
|
break;
|
||||||
case DCH_SSSS:
|
case DCH_SSSS:
|
||||||
from_char_parse_int(&out->ssss, &s, n);
|
from_char_parse_int(&out->ssss, &s, n);
|
||||||
|
Loading…
Reference in New Issue
Block a user