Skip to content

Commit 9d97e5a

Browse files
committed
remove parenthesis inside ereport
1 parent 46251e9 commit 9d97e5a

8 files changed

Lines changed: 82 additions & 82 deletions

File tree

src/client/kv_client.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ static KVWorkerClient* GetKVWorkerClient(KVWorkerId workerId) {
5656
return worker;
5757
}
5858

59-
ereport(ERROR, (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
59+
ereport(ERROR, errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
6060
errmsg("too many background workers"),
6161
errhint("Up to %d background workers can be registered with"
6262
" the current settings.", max_worker_processes),
6363
errhint("Consider increasing the configuration parameter "
64-
"\"max_worker_processes\".")));
64+
"\"max_worker_processes\"."));
6565
return nullptr;
6666
}
6767

src/ipc/kv_mq.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void KVMessageQueue::Send(const KVMessage& msg) {
5555

5656
if (isServer_) {
5757
if (msg.hdr.rpsId == 0) {
58-
ereport(WARNING, (errmsg("invalid response channel")));
58+
ereport(WARNING, errmsg("invalid response channel"));
5959
return;
6060
}
6161

@@ -74,7 +74,7 @@ void KVMessageQueue::Recv(KVMessage& msg, int flag) {
7474
channel = request_;
7575
} else {
7676
if (msg.hdr.rpsId == 0) {
77-
ereport(WARNING, (errmsg("invalid response channel")));
77+
ereport(WARNING, errmsg("invalid response channel"));
7878
return;
7979
}
8080

src/ipc/kv_posix.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,61 +23,61 @@ extern "C" {
2323
int ShmOpen(const char* name, int flag, mode_t mode, const char* func) {
2424
int fd = shm_open(name, flag, mode);
2525
if (fd == -1) {
26-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
26+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
2727
}
2828
return fd;
2929
}
3030

3131
void ShmUnlink(const char* name, const char* func) {
3232
if (shm_unlink(name) == -1) {
33-
ereport(WARNING, (errmsg("%s %s failed", func, __func__),
34-
errhint("maybe no shared memory to unlink")));
33+
ereport(WARNING, errmsg("%s %s failed", func, __func__),
34+
errhint("maybe no shared memory to unlink"));
3535
}
3636
}
3737

3838
void* Mmap(void* addr, size_t len, int prot, int flag, int fd, off_t offset,
3939
const char* func) {
4040
void* ptr = mmap(addr, len, prot, flag, fd, offset);
4141
if (ptr == MAP_FAILED) {
42-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
42+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
4343
}
4444
return ptr;
4545
}
4646

4747
void Munmap(void* addr, size_t len, const char* func) {
4848
if (munmap(addr, len) == -1) {
49-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
49+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
5050
}
5151
}
5252

5353
void Ftruncate(int fd, off_t length, const char* func) {
5454
if (ftruncate(fd, length) == -1) {
55-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
55+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
5656
}
5757
}
5858

5959
void Fclose(int fd, const char* func) {
6060
if (close(fd) == -1) {
61-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
61+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
6262
}
6363
}
6464

6565
void SemInit(volatile sem_t* sem, int pshared, unsigned int value,
6666
const char* func) {
6767
if (sem_init((sem_t*) sem, pshared, value) == -1) {
68-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
68+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
6969
}
7070
}
7171

7272
void SemDestroy(volatile sem_t* sem, const char* func) {
7373
if (sem_destroy((sem_t*) sem) == -1) {
74-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
74+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
7575
}
7676
}
7777

7878
void SemPost(volatile sem_t* sem, const char* func) {
7979
if (sem_post((sem_t*) sem) == -1) {
80-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
80+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
8181
}
8282
}
8383

@@ -86,15 +86,15 @@ int SemWait(volatile sem_t* sem, const char* func) {
8686
if (errno == EINTR) {
8787
return -1;
8888
}
89-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
89+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
9090
}
9191
return 0;
9292
}
9393

9494
int SemTryWait(volatile sem_t* sem, const char* func) {
9595
int ret = sem_trywait((sem_t*) sem);
9696
if (ret == -1 && errno != EAGAIN) {
97-
ereport(ERROR, (errmsg("%s %s failed", func, __func__)));
97+
ereport(ERROR, errmsg("%s %s failed", func, __func__));
9898
}
9999
return ret;
100100
}

src/kv_fdw.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static void GetForeignRelSize(PlannerInfo* root, RelOptInfo* baserel,
114114
* can compute a better estimate of the average result row width.
115115
*/
116116

117-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
117+
ereport(DEBUG1, errmsg("entering function %s", __func__));
118118

119119
/*
120120
* min & max will call GetForeignRelSize & GetForeignPaths multiple times,
@@ -162,7 +162,7 @@ static void GetForeignRelSize(PlannerInfo* root, RelOptInfo* baserel,
162162
/* bit numbers are offset by FirstLowInvalidHeapAttributeNumber */
163163
AttrNumber attr = col + FirstLowInvalidHeapAttributeNumber;
164164
if (attr <= InvalidAttrNumber) { /* shouldn't happen */
165-
ereport(ERROR, (errmsg("InvalidAttrNumber in %s", __func__)));
165+
ereport(ERROR, errmsg("InvalidAttrNumber in %s", __func__));
166166
}
167167
planState->targetAttrs = lappend_int(planState->targetAttrs, attr);
168168
printf(" %d ", attr);
@@ -204,7 +204,7 @@ static void GetForeignPaths(PlannerInfo* root, RelOptInfo* baserel,
204204
* that is needed to identify the specific scan method intended.
205205
*/
206206

207-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
207+
ereport(DEBUG1, errmsg("entering function %s", __func__));
208208

209209
Cost startupCost = 0;
210210
Cost totalCost = startupCost + baserel->rows;
@@ -238,7 +238,7 @@ static ForeignScan* GetForeignPlan(PlannerInfo* root, RelOptInfo* baserel,
238238
*
239239
*/
240240

241-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
241+
ereport(DEBUG1, errmsg("entering function %s", __func__));
242242

243243
/*
244244
* We have no native ability to evaluate restriction clauses, so we just
@@ -309,7 +309,7 @@ static void GetKeyBasedQual(Node* node, ForeignScanState* scanState,
309309
/* get the name of the operator according to PG_OPERATOR OID */
310310
HeapTuple opertup = SearchSysCache1(OPEROID, ObjectIdGetDatum(op->opno));
311311
if (!HeapTupleIsValid(opertup)) {
312-
ereport(ERROR, (errmsg("cache lookup failed for operator %u", op->opno)));
312+
ereport(ERROR, errmsg("cache lookup failed for operator %u", op->opno));
313313
}
314314
Form_pg_operator operform = (Form_pg_operator) GETSTRUCT(opertup);
315315
char* oprname = NameStr(operform->oprname);
@@ -367,7 +367,7 @@ static void BeginForeignScan(ForeignScanState* scanState, int executorFlags) {
367367
*
368368
*/
369369

370-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
370+
ereport(DEBUG1, errmsg("entering function %s", __func__));
371371

372372
TableReadState* readState = palloc0(sizeof(TableReadState));
373373
readState->execExplainOnly = false;
@@ -611,7 +611,7 @@ static TupleTableSlot* IterateForeignScan(ForeignScanState* scanState) {
611611
* (just as you would need to do in the case of a data type mismatch).
612612
*/
613613

614-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
614+
ereport(DEBUG1, errmsg("entering function %s", __func__));
615615

616616
TupleTableSlot* tupleSlot = scanState->ss.ss_ScanTupleSlot;
617617
ExecClearTuple(tupleSlot);
@@ -666,7 +666,7 @@ static void ReScanForeignScan(ForeignScanState* scanState) {
666666
* return exactly the same rows.
667667
*/
668668

669-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
669+
ereport(DEBUG1, errmsg("entering function %s", __func__));
670670
}
671671

672672
static void EndForeignScan(ForeignScanState* scanState) {
@@ -677,7 +677,7 @@ static void EndForeignScan(ForeignScanState* scanState) {
677677
* remote servers should be cleaned up.
678678
*/
679679

680-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
680+
ereport(DEBUG1, errmsg("entering function %s", __func__));
681681

682682
TableReadState* readState = (TableReadState*) scanState->fdw_state;
683683
Assert(readState);
@@ -748,7 +748,7 @@ static void AddForeignUpdateTargets(Query* parsetree, RangeTblEntry* tableEntry,
748748
* relies on an unchanging primary key to identify rows.)
749749
*/
750750

751-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
751+
ereport(DEBUG1, errmsg("entering function %s", __func__));
752752

753753
/*
754754
* We are using first column as row identification column, so we are adding
@@ -792,7 +792,7 @@ static List* PlanForeignModify(PlannerInfo* root, ModifyTable* plan,
792792
* BeginForeignModify will be NIL.
793793
*/
794794

795-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
795+
ereport(DEBUG1, errmsg("entering function %s", __func__));
796796

797797
#ifdef VIDARDB
798798
if (plan->operation == CMD_INSERT) {
@@ -829,11 +829,11 @@ static List* PlanForeignModify(PlannerInfo* root, ModifyTable* plan,
829829
while ((col = bms_first_member(attrs)) >= 0) {
830830
col += FirstLowInvalidHeapAttributeNumber;
831831
if (col <= InvalidAttrNumber) { /* shouldn't happen */
832-
ereport(ERROR, (errmsg("InvalidAttrNumber in %s", __func__)));
832+
ereport(ERROR, errmsg("InvalidAttrNumber in %s", __func__));
833833
}
834834
if (col == 1) {
835-
ereport(ERROR, (errmsg("row identifier column update is "
836-
"not supported.")));
835+
ereport(ERROR, errmsg("row identifier column update is "
836+
"not supported."));
837837
}
838838
if (col > 1) {
839839
break;
@@ -878,7 +878,7 @@ static void BeginForeignModify(ModifyTableState* modifyTableState,
878878
* during executor startup.
879879
*/
880880

881-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
881+
ereport(DEBUG1, errmsg("entering function %s", __func__));
882882

883883
if (executorFlags & EXEC_FLAG_EXPLAIN_ONLY) {
884884
return;
@@ -929,7 +929,7 @@ static void SerializeTuple(StringInfo key, StringInfo val,
929929
Datum datum = tupleSlot->tts_values[index];
930930
if (tupleSlot->tts_isnull[index]) {
931931
if (index == 0) {
932-
ereport(ERROR, (errmsg("first column cannot be null!")));
932+
ereport(ERROR, errmsg("first column cannot be null!"));
933933
}
934934

935935
SerializeNullAttribute(tupleDescriptor, index, val);
@@ -971,7 +971,7 @@ static TupleTableSlot* ExecForeignInsert(EState* executorState,
971971
* the foreign table will fail with an error message.
972972
*/
973973

974-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
974+
ereport(DEBUG1, errmsg("entering function %s", __func__));
975975

976976
TupleDesc tupleDescriptor = slot->tts_tupleDescriptor;
977977

@@ -1040,7 +1040,7 @@ static TupleTableSlot* ExecForeignUpdate(EState* executorState,
10401040
*
10411041
*/
10421042

1043-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1043+
ereport(DEBUG1, errmsg("entering function %s", __func__));
10441044

10451045
TupleDesc tupleDescriptor = slot->tts_tupleDescriptor;
10461046
bool shouldFree;
@@ -1105,7 +1105,7 @@ static TupleTableSlot* ExecForeignDelete(EState* executorState,
11051105
* from the foreign table will fail with an error message.
11061106
*/
11071107

1108-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1108+
ereport(DEBUG1, errmsg("entering function %s", __func__));
11091109

11101110
slot_getallattrs(planSlot);
11111111

@@ -1167,7 +1167,7 @@ static void EndForeignModify(EState* executorState, ResultRelInfo* resultRelInfo
11671167
* executor shutdown.
11681168
*/
11691169

1170-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1170+
ereport(DEBUG1, errmsg("entering function %s", __func__));
11711171

11721172
TableWriteState* writeState = (TableWriteState*) resultRelInfo->ri_FdwState;
11731173

@@ -1201,7 +1201,7 @@ static void ExplainForeignScan(ForeignScanState* scanState,
12011201
* information is printed during EXPLAIN.
12021202
*/
12031203

1204-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1204+
ereport(DEBUG1, errmsg("entering function %s", __func__));
12051205
}
12061206

12071207
static void ExplainForeignModify(ModifyTableState* modifyTableState,
@@ -1221,7 +1221,7 @@ static void ExplainForeignModify(ModifyTableState* modifyTableState,
12211221
* information is printed during EXPLAIN.
12221222
*/
12231223

1224-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1224+
ereport(DEBUG1, errmsg("entering function %s", __func__));
12251225
}
12261226

12271227
static bool AnalyzeForeignTable(Relation relation,
@@ -1255,7 +1255,7 @@ static bool AnalyzeForeignTable(Relation relation,
12551255
* ----
12561256
*/
12571257

1258-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1258+
ereport(DEBUG1, errmsg("entering function %s", __func__));
12591259

12601260
return false;
12611261
}
@@ -1264,7 +1264,7 @@ Datum kv_fdw_handler(PG_FUNCTION_ARGS) {
12641264
printf("\n-----------------%s----------------------\n", __func__);
12651265
FdwRoutine* routine = makeNode(FdwRoutine);
12661266

1267-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1267+
ereport(DEBUG1, errmsg("entering function %s", __func__));
12681268

12691269
/*
12701270
* assign the handlers for the FDW
@@ -1308,16 +1308,16 @@ Datum kv_fdw_validator(PG_FUNCTION_ARGS) {
13081308
printf("\n-----------------%s----------------------\n", __func__);
13091309
//List *options_list = untransformRelOptions(PG_GETARG_DATUM(0));
13101310

1311-
ereport(DEBUG1, (errmsg("entering function %s", __func__)));
1311+
ereport(DEBUG1, errmsg("entering function %s", __func__));
13121312

13131313
/* make sure the options are valid */
13141314

13151315
/* no options are supported */
13161316

13171317
/*if (list_length(options_list) > 0) {
1318-
ereport(ERROR, (errcode(ERRCODE_FDW_INVALID_OPTION_NAME),
1319-
errmsg("invalid options"),
1320-
errhint("FDW does not support any options")));
1318+
ereport(ERROR, errcode(ERRCODE_FDW_INVALID_OPTION_NAME),
1319+
errmsg("invalid options"),
1320+
errhint("FDW does not support any options"));
13211321
}*/
13221322

13231323
PG_RETURN_VOID();

0 commit comments

Comments
 (0)