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

Commit2e468aa

Browse files
committed
Fix core dump in error path of plpgsql_parse_tripwordtype. Somebody
introduced a copy-and-pasteo while trying to simplify the code.
1 parent07044f5 commit2e468aa

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* procedural language
44
*
55
* IDENTIFICATION
6-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.96 2005/11/22 18:17:33 momjian Exp $
6+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.97 2005/12/0917:08:49 tgl Exp $
77
*
88
* This software is copyrighted by Jan Wieck - Hamburg.
99
*
@@ -1316,25 +1316,25 @@ plpgsql_parse_dblwordtype(char *word)
13161316
0,0,0);
13171317
if (!HeapTupleIsValid(classtup))
13181318
gotodone;
1319+
classStruct= (Form_pg_class)GETSTRUCT(classtup);
13191320

13201321
/*
13211322
* It must be a relation, sequence, view, or type
13221323
*/
1323-
classStruct= (Form_pg_class)GETSTRUCT(classtup);
13241324
if (classStruct->relkind!=RELKIND_RELATION&&
13251325
classStruct->relkind!=RELKIND_SEQUENCE&&
13261326
classStruct->relkind!=RELKIND_VIEW&&
13271327
classStruct->relkind!=RELKIND_COMPOSITE_TYPE)
13281328
gotodone;
13291329

13301330
/*
1331-
* Fetch the named table field andit's type
1331+
* Fetch the named table field andits type
13321332
*/
13331333
attrtup=SearchSysCacheAttName(classOid,cp[1]);
13341334
if (!HeapTupleIsValid(attrtup))
13351335
gotodone;
1336-
13371336
attrStruct= (Form_pg_attribute)GETSTRUCT(attrtup);
1337+
13381338
typetup=SearchSysCache(TYPEOID,
13391339
ObjectIdGetDatum(attrStruct->atttypid),
13401340
0,0,0);
@@ -1373,10 +1373,10 @@ plpgsql_parse_tripwordtype(char *word)
13731373
{
13741374
OidclassOid;
13751375
HeapTupleclasstup=NULL;
1376-
Form_pg_classclassStruct;
13771376
HeapTupleattrtup=NULL;
1378-
Form_pg_attributeattrStruct;
13791377
HeapTupletypetup=NULL;
1378+
Form_pg_classclassStruct;
1379+
Form_pg_attributeattrStruct;
13801380
char*cp[2];
13811381
char*colname[1];
13821382
intqualified_att_len;
@@ -1421,26 +1421,26 @@ plpgsql_parse_tripwordtype(char *word)
14211421
0,0,0);
14221422
if (!HeapTupleIsValid(classtup))
14231423
gotodone;
1424+
classStruct= (Form_pg_class)GETSTRUCT(classtup);
14241425

14251426
/*
14261427
* It must be a relation, sequence, view, or type
14271428
*/
1428-
classStruct= (Form_pg_class)GETSTRUCT(classtup);
14291429
if (classStruct->relkind!=RELKIND_RELATION&&
14301430
classStruct->relkind!=RELKIND_SEQUENCE&&
14311431
classStruct->relkind!=RELKIND_VIEW&&
14321432
classStruct->relkind!=RELKIND_COMPOSITE_TYPE)
14331433
gotodone;
14341434

14351435
/*
1436-
* Fetch the named table field andit's type
1436+
* Fetch the named table field andits type
14371437
*/
14381438
plpgsql_convert_ident(cp[1],colname,1);
14391439
attrtup=SearchSysCacheAttName(classOid,colname[0]);
14401440
if (!HeapTupleIsValid(attrtup))
14411441
gotodone;
1442-
14431442
attrStruct= (Form_pg_attribute)GETSTRUCT(attrtup);
1443+
14441444
typetup=SearchSysCache(TYPEOID,
14451445
ObjectIdGetDatum(attrStruct->atttypid),
14461446
0,0,0);
@@ -1459,7 +1459,7 @@ plpgsql_parse_tripwordtype(char *word)
14591459
done:
14601460
if (HeapTupleIsValid(classtup))
14611461
ReleaseSysCache(classtup);
1462-
if (HeapTupleIsValid(classtup))
1462+
if (HeapTupleIsValid(attrtup))
14631463
ReleaseSysCache(attrtup);
14641464
if (HeapTupleIsValid(typetup))
14651465
ReleaseSysCache(typetup);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp