Skip to content

Commit ce77462

Browse files
committed
Cause inheritance patch to meet minimum coding standards (no gcc
warnings).
1 parent 7fca3f0 commit ce77462

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.81 2000/06/09 01:44:14 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.82 2000/06/09 03:17:13 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -23,6 +23,7 @@
2323
#include "optimizer/clauses.h"
2424
#include "optimizer/internal.h"
2525
#include "optimizer/paths.h"
26+
#include "optimizer/plancat.h"
2627
#include "optimizer/planmain.h"
2728
#include "optimizer/planner.h"
2829
#include "optimizer/prep.h"

src/backend/optimizer/util/plancat.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
*
1111
* IDENTIFICATION
1212
<<<<<<< plancat.c
13-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.54 2000/06/09 01:44:16 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.55 2000/06/09 03:17:12 tgl Exp $
1414
=======
15-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.54 2000/06/09 01:44:16 momjian Exp $
15+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.55 2000/06/09 03:17:12 tgl Exp $
1616
>>>>>>> 1.53
1717
*
1818
*-------------------------------------------------------------------------
@@ -292,13 +292,18 @@ find_inheritance_children(Oid inhparent)
292292
* Currently has_subclass is only used as an efficiency hack, so this
293293
* is ok.
294294
*/
295-
bool has_subclass(Oid relationId)
295+
bool
296+
has_subclass(Oid relationId)
296297
{
297-
HeapTuple tuple =
298-
SearchSysCacheTuple(RELOID,
299-
ObjectIdGetDatum(relationId),
300-
0, 0, 0);
301-
return ((Form_pg_class) GETSTRUCT(tuple))->relhassubclass;
298+
HeapTuple tuple =
299+
SearchSysCacheTuple(RELOID,
300+
ObjectIdGetDatum(relationId),
301+
0, 0, 0);
302+
303+
if (!HeapTupleIsValid(tuple))
304+
elog(ERROR, "has_subclass: Relation %u not found",
305+
relationId);
306+
return ((Form_pg_class) GETSTRUCT(tuple))->relhassubclass;
302307
}
303308

304309
#ifdef NOT_USED

src/include/optimizer/plancat.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: plancat.h,v 1.18 2000/04/12 17:16:42 momjian Exp $
10+
* $Id: plancat.h,v 1.19 2000/06/09 03:17:11 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -24,6 +24,8 @@ extern List *find_secondary_indexes(Query *root, Index relid);
2424

2525
extern List *find_inheritance_children(Oid inhparent);
2626

27+
extern bool has_subclass(Oid relationId);
28+
2729
extern Selectivity restriction_selectivity(Oid functionObjectId,
2830
Oid operatorObjectId,
2931
Oid relationObjectId,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy