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

Commit648029e

Browse files
committed
Repair unforgivably brain-dead representation of CaseExpr nodes in
stored rules. Bump catversion to reflect incompatibility.
1 parentfca9295 commit648029e

File tree

3 files changed

+36
-23
lines changed

3 files changed

+36
-23
lines changed

‎src/backend/nodes/outfuncs.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
*$Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.118 2000/06/14 18:17:32 petere Exp $
9+
*$Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.119 2000/06/16 05:27:02 tgl Exp $
1010
*
1111
* NOTES
1212
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -1385,10 +1385,14 @@ _outConstraint(StringInfo str, Constraint *node)
13851385
staticvoid
13861386
_outCaseExpr(StringInfostr,CaseExpr*node)
13871387
{
1388-
appendStringInfo(str,"CASE ");
1388+
appendStringInfo(str," CASE :casetype %u :arg ",
1389+
node->casetype);
1390+
_outNode(str,node->arg);
1391+
1392+
appendStringInfo(str," :args ");
13891393
_outNode(str,node->args);
13901394

1391-
appendStringInfo(str," :default ");
1395+
appendStringInfo(str," :defresult ");
13921396
_outNode(str,node->defresult);
13931397
}
13941398

‎src/backend/nodes/readfuncs.c

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.89 2000/05/30 00:49:45 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.90 2000/06/16 05:27:03 tgl Exp $
1212
*
1313
* NOTES
1414
* Most of the read functions for plan nodes are tested. (In fact, they
@@ -670,7 +670,7 @@ _readResdom()
670670

671671
token=lsptok(NULL,&length);/* eat :restype */
672672
token=lsptok(NULL,&length);/* get restype */
673-
local_node->restype=atol(token);
673+
local_node->restype=(Oid)atol(token);
674674

675675
token=lsptok(NULL,&length);/* eat :restypmod */
676676
token=lsptok(NULL,&length);/* get restypmod */
@@ -762,8 +762,17 @@ _readCaseExpr()
762762

763763
local_node=makeNode(CaseExpr);
764764

765+
token=lsptok(NULL,&length);/* eat :casetype */
766+
token=lsptok(NULL,&length);/* get casetype */
767+
local_node->casetype= (Oid)atol(token);
768+
769+
token=lsptok(NULL,&length);/* eat :arg */
770+
local_node->arg=nodeRead(true);
771+
772+
token=lsptok(NULL,&length);/* eat :args */
765773
local_node->args=nodeRead(true);
766-
token=lsptok(NULL,&length);/* eat :default */
774+
775+
token=lsptok(NULL,&length);/* eat :defresult */
767776
local_node->defresult=nodeRead(true);
768777

769778
returnlocal_node;
@@ -824,15 +833,15 @@ _readVar()
824833

825834
token=lsptok(NULL,&length);/* eat :varlevelsup */
826835
token=lsptok(NULL,&length);/* get varlevelsup */
827-
local_node->varlevelsup= (Oid)atol(token);
836+
local_node->varlevelsup= (Index)atoi(token);
828837

829838
token=lsptok(NULL,&length);/* eat :varnoold */
830839
token=lsptok(NULL,&length);/* get varnoold */
831-
local_node->varnoold= (Oid)atol(token);
840+
local_node->varnoold= (Index)atoi(token);
832841

833842
token=lsptok(NULL,&length);/* eat :varoattno */
834843
token=lsptok(NULL,&length);/* eat :varoattno */
835-
local_node->varoattno=(int)atol(token);
844+
local_node->varoattno=atoi(token);
836845

837846
returnlocal_node;
838847
}
@@ -942,7 +951,7 @@ _readConst()
942951

943952
token=lsptok(NULL,&length);/* get :consttype */
944953
token=lsptok(NULL,&length);/* now read it */
945-
local_node->consttype=atol(token);
954+
local_node->consttype=(Oid)atol(token);
946955

947956

948957
token=lsptok(NULL,&length);/* get :constlen */
@@ -1001,11 +1010,11 @@ _readFunc()
10011010

10021011
token=lsptok(NULL,&length);/* get :funcid */
10031012
token=lsptok(NULL,&length);/* now read it */
1004-
local_node->funcid=atol(token);
1013+
local_node->funcid=(Oid)atol(token);
10051014

10061015
token=lsptok(NULL,&length);/* get :functype */
10071016
token=lsptok(NULL,&length);/* now read it */
1008-
local_node->functype=atol(token);
1017+
local_node->functype=(Oid)atol(token);
10091018

10101019
token=lsptok(NULL,&length);/* get :funcisindex */
10111020
token=lsptok(NULL,&length);/* now read it */
@@ -1051,15 +1060,15 @@ _readOper()
10511060

10521061
token=lsptok(NULL,&length);/* get :opno */
10531062
token=lsptok(NULL,&length);/* now read it */
1054-
local_node->opno=atol(token);
1063+
local_node->opno=(Oid)atol(token);
10551064

10561065
token=lsptok(NULL,&length);/* get :opid */
10571066
token=lsptok(NULL,&length);/* now read it */
1058-
local_node->opid=atol(token);
1067+
local_node->opid=(Oid)atol(token);
10591068

10601069
token=lsptok(NULL,&length);/* get :opresulttype */
10611070
token=lsptok(NULL,&length);/* now read it */
1062-
local_node->opresulttype=atol(token);
1071+
local_node->opresulttype=(Oid)atol(token);
10631072

10641073
/*
10651074
* NOTE: Alternatively we can call 'replace_opid' which initializes
@@ -1102,8 +1111,8 @@ _readParam()
11021111

11031112
token=lsptok(NULL,&length);/* get :paramtype */
11041113
token=lsptok(NULL,&length);/* now read it */
1114+
local_node->paramtype= (Oid)atol(token);
11051115

1106-
local_node->paramtype=atol(token);
11071116
token=lsptok(NULL,&length);/* get :param_tlist */
11081117
local_node->param_tlist=nodeRead(true);/* now read it */
11091118

@@ -1711,7 +1720,7 @@ _readPathKeyItem()
17111720
token=lsptok(NULL,&length);/* get :sortop */
17121721
token=lsptok(NULL,&length);/* now read it */
17131722

1714-
local_node->sortop=atol(token);
1723+
local_node->sortop=(Oid)atol(token);
17151724

17161725
token=lsptok(NULL,&length);/* get :key */
17171726
local_node->key=nodeRead(true);/* now read it */
@@ -1742,19 +1751,19 @@ _readRestrictInfo()
17421751

17431752
token=lsptok(NULL,&length);/* get :mergejoinoperator */
17441753
token=lsptok(NULL,&length);/* now read it */
1745-
local_node->mergejoinoperator=atol(token);
1754+
local_node->mergejoinoperator=(Oid)atol(token);
17461755

17471756
token=lsptok(NULL,&length);/* get :left_sortop */
17481757
token=lsptok(NULL,&length);/* now read it */
1749-
local_node->left_sortop=atol(token);
1758+
local_node->left_sortop=(Oid)atol(token);
17501759

17511760
token=lsptok(NULL,&length);/* get :right_sortop */
17521761
token=lsptok(NULL,&length);/* now read it */
1753-
local_node->right_sortop=atol(token);
1762+
local_node->right_sortop=(Oid)atol(token);
17541763

17551764
token=lsptok(NULL,&length);/* get :hashjoinoperator */
17561765
token=lsptok(NULL,&length);/* now read it */
1757-
local_node->hashjoinoperator=atol(token);
1766+
local_node->hashjoinoperator=(Oid)atol(token);
17581767

17591768
returnlocal_node;
17601769
}

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $Id: catversion.h,v 1.31 2000/06/13 07:35:19 tgl Exp $
40+
* $Id: catversion.h,v 1.32 2000/06/16 05:27:01 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200006131
56+
#defineCATALOG_VERSION_NO200006161
5757

5858
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp