Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d759c1b

Browse files
committed
Fix dead assignments & some other issues reported by clang-analyzer, update gitignore
1 parent c9f7c99 commit d759c1b

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
.deps
2+
results/pg_pathman.out
3+
regression.diffs
4+
regression.out
25
*.o
36
*.so
4-
pg_pathman--*.sql
7+
pg_pathman--*.sql

dsm_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ resize_dsm_array(DsmArray *arr, size_t entry_size, size_t length)
290290
}
291291

292292
void *
293-
dsm_array_get_pointer(const DsmArray* arr)
293+
dsm_array_get_pointer(const DsmArray *arr)
294294
{
295295
return (char *) dsm_segment_address(segment) + arr->offset + sizeof(BlockHeader);
296296
}

pl_funcs.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,6 @@ find_or_create_range_partition(PG_FUNCTION_ARGS)
159159
/* Start background worker to create new partitions */
160160
child_oid = create_partitions_bg_worker(relid, value, value_type, &crashed);
161161

162-
// SPI_connect();
163-
// child_oid = create_partitions(relid, value, value_type, &crashed);
164-
// SPI_finish();
165-
// elog(WARNING, "Worker finished");
166-
167162
/* Release locks */
168163
if (!crashed)
169164
{
@@ -172,8 +167,7 @@ find_or_create_range_partition(PG_FUNCTION_ARGS)
172167
}
173168

174169
/* Repeat binary search */
175-
ranges = dsm_array_get_pointer(&rangerel->ranges);
176-
pos = range_binary_search(rangerel, &cmp_func, value, &found);
170+
(void) range_binary_search(rangerel, &cmp_func, value, &found);
177171
if (found)
178172
PG_RETURN_OID(child_oid);
179173
}

worker.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ create_partitions_bg_worker(Oid relid, Datum value, Oid value_type, bool *crashe
9999

100100
/* Wait till the worker finishes its job */
101101
status = WaitForBackgroundWorkerShutdown(worker_handle);
102+
if (status == BGWH_POSTMASTER_DIED)
103+
{
104+
ereport(WARNING,
105+
(errmsg("Postmaster died during the pg_pathman background worker process"),
106+
errhint("More details may be available in the server log.")));
107+
}
102108
*crashed = args->crashed;
103109
child_oid = args->result;
104110

@@ -170,7 +176,6 @@ create_partitions(Oid relid, Datum value, Oid value_type, bool *crashed)
170176

171177
prel = get_pathman_relation_info(relid, NULL);
172178
rangerel = get_pathman_range_relation(relid, NULL);
173-
ranges = dsm_array_get_pointer(&rangerel->ranges);
174179

175180
/* Comparison function */
176181
cmp_func = *get_cmp_func(value_type, prel->atttype);

0 commit comments

Comments
 (0)