Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 992e7dd

Browse files
committed
Oops, plpgsql didn't have the datetime->timestamp and timespan->interval
mappings. In fact, it had them backward because it was using the 6.5.* code. Copied them from parser/gram.y, so it is fixed now. Looks like our first 7.0.1 fix. Oops, seems Tom has beat me to it as I was typing this.
1 parent 37c652f commit 992e7dd

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/pl/plpgsql/src/pl_comp.c

+14-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.19 2000/04/16 04:16:55 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.20 2000/05/11 04:00:00 momjian Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -1355,18 +1355,22 @@ plpgsql_yyerror(const char *s)
13551355
static char *
13561356
xlateSqlType(char *name)
13571357
{
1358-
if (!strcasecmp(name, "int")
1359-
|| !strcasecmp(name, "integer"))
1358+
if ((strcmp(name,"int") == 0)
1359+
|| (strcmp(name,"integer") == 0))
13601360
return "int4";
1361-
else if (!strcasecmp(name, "smallint"))
1361+
else if (strcmp(name, "smallint") == 0)
13621362
return "int2";
1363-
else if (!strcasecmp(name, "real")
1364-
|| !strcasecmp(name, "float"))
1363+
else if ((strcmp(name, "real") == 0)
1364+
|| (strcmp(name, "float") == 0))
13651365
return "float8";
1366-
else if (!strcasecmp(name, "interval"))
1367-
return "timespan";
1368-
else if (!strcasecmp(name, "boolean"))
1366+
else if (strcmp(name, "decimal") == 0)
1367+
return "numeric";
1368+
else if (strcmp(name, "datetime") == 0)
1369+
return "timestamp";
1370+
else if (strcmp(name, "timespan") == 0)
1371+
return "interval";
1372+
else if (strcmp(name, "boolean") == 0)
13691373
return "bool";
13701374
else
13711375
return name;
1372-
} /* xlateSqlType() */
1376+
} /* xlateSqlType() */

0 commit comments

Comments
 (0)