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

Commitdfbd5d6

Browse files
committed
plpgsql's private copy of xlateSqlType was out of sync. Again. This
is clearly not maintainable, so dike it out in favor of calling the realversion in the backend's gram.y.
1 parent467f43d commitdfbd5d6

File tree

3 files changed

+13
-51
lines changed

3 files changed

+13
-51
lines changed

‎src/backend/parser/gram.y

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.219 2001/01/24 19:43:01 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.220 2001/02/09 03:26:28 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHORDATEMAJOR EVENT
@@ -81,8 +81,6 @@ static intpfunc_num_args;
8181
*/
8282
/*#define __YYSCLASS*/
8383

84-
staticchar *xlateSqlFunc(char *);
85-
staticchar *xlateSqlType(char *);
8684
static Node *makeA_Expr(int oper,char *opname, Node *lexpr, Node *rexpr);
8785
static Node *makeTypeCast(Node *arg, TypeName *typename);
8886
static Node *makeRowExpr(char *opr, List *largs, List *rargs);
@@ -5879,7 +5877,7 @@ makeSetOp(SetOperation op, bool all, Node *larg, Node *rarg)
58795877
* is a temporary expedient for pre-7.0 to 7.0 compatibility;
58805878
* these should go away for v7.1.
58815879
*/
5882-
staticchar *
5880+
char *
58835881
xlateSqlFunc(char *name)
58845882
{
58855883
if (strcmp(name,"character_length") ==0)
@@ -5906,7 +5904,7 @@ xlateSqlFunc(char *name)
59065904
* the undocumented "lztext" type in 7.0. This can go away in 7.2 or later
59075905
* - tgl 2000-07-30
59085906
*/
5909-
staticchar *
5907+
char *
59105908
xlateSqlType(char *name)
59115909
{
59125910
if ((strcmp(name,"int") ==0)

‎src/include/parser/gramparse.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: gramparse.h,v 1.14 2001/01/24 19:43:27momjian Exp $
10+
* $Id: gramparse.h,v 1.15 2001/02/09 03:26:27tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -27,5 +27,7 @@ extern void yyerror(const char *message);
2727
externvoidparser_init(Oid*typev,intnargs);
2828
externOidparam_type(intt);
2929
externintyyparse(void);
30+
externchar*xlateSqlFunc(char*name);
31+
externchar*xlateSqlType(char*name);
3032

3133
#endif/* GRAMPARSE_H */

‎src/pl/plpgsql/src/pl_comp.c

Lines changed: 7 additions & 45 deletions
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.25 2000/12/08 00:03:02 tgl Exp $
6+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.26 2001/02/0903:26:28 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -46,19 +46,19 @@
4646
#include"plpgsql.h"
4747
#include"pl.tab.h"
4848

49-
#include"executor/spi.h"
50-
#include"commands/trigger.h"
51-
#include"utils/builtins.h"
52-
#include"fmgr.h"
5349
#include"access/heapam.h"
54-
55-
#include"utils/syscache.h"
5650
#include"catalog/catname.h"
5751
#include"catalog/pg_proc.h"
5852
#include"catalog/pg_type.h"
5953
#include"catalog/pg_class.h"
6054
#include"catalog/pg_attribute.h"
6155
#include"catalog/pg_attrdef.h"
56+
#include"commands/trigger.h"
57+
#include"executor/spi.h"
58+
#include"fmgr.h"
59+
#include"parser/gramparse.h"
60+
#include"utils/builtins.h"
61+
#include"utils/syscache.h"
6262

6363

6464
/* ----------
@@ -85,13 +85,6 @@ intplpgsql_DumpExecTree = 0;
8585
PLpgSQL_function*plpgsql_curr_compile;
8686

8787

88-
/* ----------
89-
* Local function declarations
90-
* ----------
91-
*/
92-
staticchar*xlateSqlType(char*name);
93-
94-
9588
/* ----------
9689
* plpgsql_compileGiven a pg_proc's oid, make
9790
*an execution tree for it.
@@ -1386,34 +1379,3 @@ plpgsql_yyerror(const char *s)
13861379
plpgsql_comperrinfo();
13871380
elog(ERROR,"%s at or near \"%s\"",s,plpgsql_yytext);
13881381
}
1389-
1390-
1391-
/* ----------
1392-
* xlateSqlType()
1393-
* Convert alternate type names to internal Postgres types.
1394-
*
1395-
* Stolen from backend's main parser
1396-
* ----------
1397-
*/
1398-
staticchar*
1399-
xlateSqlType(char*name)
1400-
{
1401-
if ((strcmp(name,"int")==0)
1402-
|| (strcmp(name,"integer")==0))
1403-
return"int4";
1404-
elseif (strcmp(name,"smallint")==0)
1405-
return"int2";
1406-
elseif ((strcmp(name,"real")==0)
1407-
|| (strcmp(name,"float")==0))
1408-
return"float8";
1409-
elseif (strcmp(name,"decimal")==0)
1410-
return"numeric";
1411-
elseif (strcmp(name,"datetime")==0)
1412-
return"timestamp";
1413-
elseif (strcmp(name,"timespan")==0)
1414-
return"interval";
1415-
elseif (strcmp(name,"boolean")==0)
1416-
return"bool";
1417-
else
1418-
returnname;
1419-
}/* xlateSqlType() */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp