Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45d146a

Browse files
committed
Fix 'Q' format char parsing in the new to_timestamp() code. Used to crash.
1 parent6462e7b commit45d146a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/utils/adt/formatting.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------
22
* formatting.c
33
*
4-
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.149 2008/10/06 05:03:27 tgl Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.150 2008/11/10 17:36:53 heikki Exp $
55
*
66
*
77
* Portions Copyright (c) 1999-2008, PostgreSQL Global Development Group
@@ -1771,7 +1771,7 @@ from_char_set_int(int *dest, const int value, const FormatNode *node)
17711771

17721772
/*
17731773
* Read a single integer from the source string, into the int pointed to by
1774-
* 'dest'.
1774+
* 'dest'. If 'dest' is NULL, the result is discarded.
17751775
*
17761776
* In fixed-width mode (the node does not have the FM suffix), consume at most
17771777
* 'len' characters.
@@ -1862,7 +1862,8 @@ from_char_parse_int_len(int *dest, char **src, const int len, FormatNode *node)
18621862
errdetail("Value must be in the range %d to %d.",
18631863
INT_MIN,INT_MAX)));
18641864

1865-
from_char_set_int(dest, (int)result,node);
1865+
if (dest!=NULL)
1866+
from_char_set_int(dest, (int)result,node);
18661867
return*src-init;
18671868
}
18681869

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp