Skip to content

Commit f19a764

Browse files
committed
remove useless and obsolete functions, fix format string in pathman_workers.c
1 parent 1d8c48b commit f19a764

File tree

3 files changed

+1
-90
lines changed

3 files changed

+1
-90
lines changed

src/pathman_workers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ bgw_main_concurrent_part(Datum main_arg)
540540
part_slot->total_rows += rows;
541541
/* Report debug message */
542542
#ifdef USE_ASSERT_CHECKING
543-
elog(DEBUG1, "%s: relocated %d rows, total: %lu [%u]",
543+
elog(DEBUG1, "%s: relocated %d rows, total: " UINT64_FORMAT " [%u]",
544544
concurrent_part_bgw, rows, part_slot->total_rows, MyProcPid);
545545
#endif
546546
SpinLockRelease(&part_slot->mutex);

src/utils.c

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -176,65 +176,6 @@ bms_print(Bitmapset *bms)
176176
return str.data;
177177
}
178178

179-
/*
180-
* Copied from util/plancat.c
181-
*
182-
* Build a targetlist representing the columns of the specified index.
183-
*/
184-
List *
185-
build_index_tlist(PlannerInfo *root, IndexOptInfo *index,
186-
Relation heapRelation)
187-
{
188-
List *tlist = NIL;
189-
Index varno = index->rel->relid;
190-
ListCell *indexpr_item;
191-
int i;
192-
193-
indexpr_item = list_head(index->indexprs);
194-
for (i = 0; i < index->ncolumns; i++)
195-
{
196-
int indexkey = index->indexkeys[i];
197-
Expr *indexvar;
198-
199-
if (indexkey != 0)
200-
{
201-
/* simple column */
202-
Form_pg_attribute att_tup;
203-
204-
if (indexkey < 0)
205-
att_tup = SystemAttributeDefinition(indexkey,
206-
heapRelation->rd_rel->relhasoids);
207-
else
208-
att_tup = heapRelation->rd_att->attrs[indexkey - 1];
209-
210-
indexvar = (Expr *) makeVar(varno,
211-
indexkey,
212-
att_tup->atttypid,
213-
att_tup->atttypmod,
214-
att_tup->attcollation,
215-
0);
216-
}
217-
else
218-
{
219-
/* expression column */
220-
if (indexpr_item == NULL)
221-
elog(ERROR, "wrong number of index expressions");
222-
indexvar = (Expr *) lfirst(indexpr_item);
223-
indexpr_item = lnext(indexpr_item);
224-
}
225-
226-
tlist = lappend(tlist,
227-
makeTargetEntry(indexvar,
228-
i + 1,
229-
NULL,
230-
false));
231-
}
232-
if (indexpr_item != NULL)
233-
elog(ERROR, "wrong number of index expressions");
234-
235-
return tlist;
236-
}
237-
238179
/*
239180
* Get BTORDER_PROC for two types described by Oids
240181
*/
@@ -583,16 +524,6 @@ is_date_type_internal(Oid typid)
583524
typid == DATEOID;
584525
}
585526

586-
/*
587-
* Check if this is a string type.
588-
*/
589-
bool
590-
is_string_type_internal(Oid typid)
591-
{
592-
return typid == TEXTOID ||
593-
typid == CSTRINGOID;
594-
}
595-
596527

597528
/*
598529
* Try to find binary operator.
@@ -652,20 +583,6 @@ get_rel_name_or_relid(Oid relid)
652583
return relname;
653584
}
654585

655-
/*
656-
* Try to get opname or at least opid as cstring.
657-
*/
658-
char *
659-
get_op_name_or_opid(Oid opid)
660-
{
661-
char *opname = get_opname(opid);
662-
663-
if (!opname)
664-
return DatumGetCString(DirectFunctionCall1(oidout,
665-
ObjectIdGetDatum(opid)));
666-
return opname;
667-
}
668-
669586

670587
#if PG_VERSION_NUM < 90600
671588
/*

src/utils.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ typedef struct
3232
void plan_tree_walker(Plan *plan,
3333
void (*visitor) (Plan *plan, void *context),
3434
void *context);
35-
List * build_index_tlist(PlannerInfo *root,
36-
IndexOptInfo *index,
37-
Relation heapRelation);
3835
void change_varnos(Node *node, Oid old_varno, Oid new_varno);
3936

4037
/*
@@ -48,7 +45,6 @@ void postprocess_lock_rows(List *rtable, Plan *plan);
4845
*/
4946
bool clause_contains_params(Node *clause);
5047
bool is_date_type_internal(Oid typid);
51-
bool is_string_type_internal(Oid typid);
5248
bool validate_on_part_init_cb(Oid procid, bool emit_error);
5349
bool check_security_policy_internal(Oid relid, Oid role);
5450

@@ -67,8 +63,6 @@ Oid get_rel_owner(Oid relid);
6763
* Handy execution-stage functions.
6864
*/
6965
char * get_rel_name_or_relid(Oid relid);
70-
char * get_op_name_or_opid(Oid opid);
71-
7266
Oid get_binary_operator_oid(char *opname, Oid arg1, Oid arg2);
7367
void fill_type_cmp_fmgr_info(FmgrInfo *finfo,
7468
Oid type1,

0 commit comments

Comments
 (0)