Skip to content

Commit d22f73f

Browse files
committed
Fix DockerHub warning messages for latest
Fixed DockerHub warning messages for the build 'latest'. These were due to Assert statements that used variables that were not used for anything else. I changed them to ifs with error log outputs.
1 parent 4817f8a commit d22f73f

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

src/backend/parser/cypher_analyze.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static Query *analyze_cypher_and_coerce(List *stmt, RangeTblFunction *rtfunc,
802802
lateral, true);
803803

804804
rtindex = list_length(pstate->p_rtable);
805-
Assert(rtindex == 1); // rte is the only RangeTblEntry in pstate
805+
// rte is the only RangeTblEntry in pstate
806806
if (rtindex !=1 )
807807
{
808808
ereport(ERROR,

src/backend/parser/cypher_clause.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ static Query *transform_cypher_unwind(cypher_parsestate *cpstate,
13401340

13411341
pnsi = transform_prev_cypher_clause(cpstate, clause->prev, true);
13421342
rtindex = list_length(pstate->p_rtable);
1343-
Assert(rtindex == 1); // rte is the first RangeTblEntry in pstate
1343+
// rte is the first RangeTblEntry in pstate
13441344
if (rtindex != 1)
13451345
{
13461346
ereport(ERROR,
@@ -2325,7 +2325,7 @@ static Query *transform_cypher_clause_with_where(cypher_parsestate *cpstate,
23252325
NULL, true);
23262326
Assert(pnsi != NULL);
23272327
rtindex = list_length(pstate->p_rtable);
2328-
Assert(rtindex == 1); // rte is the only RangeTblEntry in pstate
2328+
// rte is the only RangeTblEntry in pstate
23292329
if (rtindex != 1)
23302330
{
23312331
ereport(ERROR,
@@ -2605,7 +2605,7 @@ static Query *transform_cypher_match_pattern(cypher_parsestate *cpstate,
26052605
pnsi = transform_prev_cypher_clause(cpstate, clause->prev, true);
26062606
rte = pnsi->p_rte;
26072607
rtindex = list_length(pstate->p_rtable);
2608-
Assert(rtindex == 1); // rte is the first RangeTblEntry in pstate
2608+
// rte is the first RangeTblEntry in pstate
26092609
if (rtindex != 1)
26102610
{
26112611
ereport(ERROR,
@@ -7016,7 +7016,6 @@ static void handle_prev_clause(cypher_parsestate *cpstate, Query *query,
70167016
// rte is the first RangeTblEntry in pstate
70177017
if (first_rte)
70187018
{
7019-
Assert(rtindex == 1);
70207019
if (rtindex != 1)
70217020
{
70227021
ereport(ERROR,

src/backend/parser/cypher_expr.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,17 @@ static Node *transform_AEXPR_IN(cypher_parsestate *cpstate, A_Expr *a)
565565

566566
scalar_type = AGTYPEOID;
567567

568-
Assert (verify_common_type(scalar_type, allexprs));
568+
/* verify they are a common type */
569+
if (!verify_common_type(scalar_type, allexprs))
570+
{
571+
ereport(ERROR,
572+
errmsg_internal("not a common type: %d", scalar_type));
573+
}
574+
569575
/*
570576
* coerce all the right-hand non-Var inputs to the common type
571577
* and build an ArrayExpr for them.
572578
*/
573-
574579
aexprs = NIL;
575580
foreach(l, rnonvars)
576581
{

src/backend/utils/adt/agtype_gin.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ Datum gin_extract_agtype_query(PG_FUNCTION_ARGS)
242242

243243
/* it should be WAGT_BEGIN_ARRAY */
244244
itok = agtype_iterator_next(&it, &elem, true);
245-
Assert(itok == WAGT_BEGIN_ARRAY);
245+
if (itok != WAGT_BEGIN_ARRAY)
246+
{
247+
elog(ERROR, "unexpected iterator token: %d", itok);
248+
}
246249

247250
while (WAGT_END_ARRAY != agtype_iterator_next(&it, &elem, true))
248251
{

src/include/utils/agtype.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/* Tokens used when sequentially processing an agtype value */
4747
typedef enum
4848
{
49-
WAGT_DONE,
49+
WAGT_DONE = 0x0,
5050
WAGT_KEY,
5151
WAGT_VALUE,
5252
WAGT_ELEM,

0 commit comments

Comments
 (0)