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

Commite481d26

Browse files
committed
Clean up minor warnings from buildfarm.
Be more consistent about use of XXXGetDatum macros in new jsonpathcode. This is mostly to avoid having code that looks randomlydifferent from everyplace else that's doing the exact same thing.In pg_regress.c, avoid an unreferenced-function warning fromcompilers that don't understand pg_attribute_unused(). Puttingthe function inside the same #ifdef as its only caller is morestraightforward coding anyway.In be-secure-openssl.c, avoid use of pg_attribute_unused() on a label.That's pretty creative, but there's no good reason to suppose thatit's portable, and there's absolutely no need to use goto's here in thefirst place. (This wasn't actually causing any buildfarm complaints,but it's new code in v12 so it has no portability track record.)
1 parentac86237 commite481d26

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

‎src/backend/libpq/be-secure-openssl.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,24 +1287,22 @@ ssl_protocol_version_to_openssl(int v, const char *guc_name, int loglevel)
12871287
#ifdefTLS1_1_VERSION
12881288
returnTLS1_1_VERSION;
12891289
#else
1290-
gotoerror;
1290+
break;
12911291
#endif
12921292
casePG_TLS1_2_VERSION:
12931293
#ifdefTLS1_2_VERSION
12941294
returnTLS1_2_VERSION;
12951295
#else
1296-
gotoerror;
1296+
break;
12971297
#endif
12981298
casePG_TLS1_3_VERSION:
12991299
#ifdefTLS1_3_VERSION
13001300
returnTLS1_3_VERSION;
13011301
#else
1302-
gotoerror;
1302+
break;
13031303
#endif
13041304
}
13051305

1306-
error:
1307-
pg_attribute_unused();
13081306
ereport(loglevel,
13091307
(errmsg("%s setting %s not supported by this build",
13101308
guc_name,

‎src/backend/utils/adt/jsonpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey,
499499
casejpiNumeric:
500500
appendStringInfoString(buf,
501501
DatumGetCString(DirectFunctionCall1(numeric_out,
502-
PointerGetDatum(jspGetNumeric(v)))));
502+
NumericGetDatum(jspGetNumeric(v)))));
503503
break;
504504
casejpiBool:
505505
if (jspGetBool(v))

‎src/backend/utils/adt/jsonpath_exec.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,8 +1742,7 @@ executeNumericItemMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
17421742
"be applied to a numeric value",
17431743
jspOperationName(jsp->type)))));
17441744

1745-
datum=NumericGetDatum(jb->val.numeric);
1746-
datum=DirectFunctionCall1(func,datum);
1745+
datum=DirectFunctionCall1(func,NumericGetDatum(jb->val.numeric));
17471746

17481747
if (!jspGetNext(jsp,&next)&& !found)
17491748
returnjperOk;
@@ -2109,8 +2108,8 @@ static int
21092108
compareNumeric(Numerica,Numericb)
21102109
{
21112110
returnDatumGetInt32(DirectFunctionCall2(numeric_cmp,
2112-
PointerGetDatum(a),
2113-
PointerGetDatum(b)));
2111+
NumericGetDatum(a),
2112+
NumericGetDatum(b)));
21142113
}
21152114

21162115
staticJsonbValue*

‎src/backend/utils/adt/jsonpath_gram.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ makeItemNumeric(JsonPathString *s)
359359
v =makeItemType(jpiNumeric);
360360
v->value.numeric =
361361
DatumGetNumeric(DirectFunctionCall3(numeric_in,
362-
CStringGetDatum(s->val),0, -1));
362+
CStringGetDatum(s->val),
363+
ObjectIdGetDatum(InvalidOid),
364+
Int32GetDatum(-1)));
363365

364366
return v;
365367
}

‎src/test/regress/pg_regress.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,9 @@ initialize_environment(void)
881881
load_resultmap();
882882
}
883883

884-
pg_attribute_unused()
884+
#ifdefENABLE_SSPI
885+
886+
/* support for config_sspi_auth() */
885887
staticconstchar*
886888
fmtHba(constchar*raw)
887889
{
@@ -904,7 +906,6 @@ fmtHba(const char *raw)
904906
returnret;
905907
}
906908

907-
#ifdefENABLE_SSPI
908909
/*
909910
* Get account and domain/realm names for the current user. This is based on
910911
* pg_SSPI_recvauth(). The returned strings use static storage.
@@ -1072,7 +1073,8 @@ config_sspi_auth(const char *pgdata)
10721073
accountname,domainname,fmtHba(sl->str)) >=0);
10731074
CW(fclose(ident)==0);
10741075
}
1075-
#endif
1076+
1077+
#endif/* ENABLE_SSPI */
10761078

10771079
/*
10781080
* Issue a command via psql, connecting to the specified database

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp