Commit f3f8499b authored by Tom Lane's avatar Tom Lane

Repair case-conversion error in to_date's handling of roman numerals.

From Manuel Sugawara, approved by Karel Zak.
parent 0a7a8256
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* formatting.c * formatting.c
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.46 2001/12/05 02:06:19 ishii Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.47 2001/12/10 15:34:05 tgl Exp $
* *
* *
* Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group * Portions Copyright (c) 1999-2000, PostgreSQL Global Development Group
...@@ -1476,7 +1476,7 @@ seq_search(char *name, char **array, int type, int max, int *len) ...@@ -1476,7 +1476,7 @@ seq_search(char *name, char **array, int type, int max, int *len)
return -1; return -1;
/* set first char */ /* set first char */
if (type == ONE_UPPER || ALL_UPPER) if (type == ONE_UPPER || type == ALL_UPPER)
*name = toupper((unsigned char) *name); *name = toupper((unsigned char) *name);
else if (type == ALL_LOWER) else if (type == ALL_LOWER)
*name = tolower((unsigned char) *name); *name = tolower((unsigned char) *name);
...@@ -2521,7 +2521,7 @@ dch_date(int arg, char *inout, int suf, int flag, FormatNode *node, void *data) ...@@ -2521,7 +2521,7 @@ dch_date(int arg, char *inout, int suf, int flag, FormatNode *node, void *data)
} }
else if (flag == FROM_CHAR) else if (flag == FROM_CHAR)
{ {
tmfc->mm = 12 - seq_search(inout, rm_months_lower, ALL_UPPER, FULL_SIZ, &len); tmfc->mm = 12 - seq_search(inout, rm_months_lower, ALL_LOWER, FULL_SIZ, &len);
CHECK_SEQ_SEARCH(len, "rm"); CHECK_SEQ_SEARCH(len, "rm");
if (S_FM(suf)) if (S_FM(suf))
return len - 1; return len - 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment