Skip to content

Commit

Permalink
Fix DockerHub warning messages for latest (apache#1380)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrgemignani authored Nov 8, 2023
1 parent 4817f8a commit 689fa75
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/backend/parser/cypher_analyze.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ static Query *analyze_cypher_and_coerce(List *stmt, RangeTblFunction *rtfunc,
lateral, true);

rtindex = list_length(pstate->p_rtable);
Assert(rtindex == 1); // rte is the only RangeTblEntry in pstate
// rte is the only RangeTblEntry in pstate
if (rtindex !=1 )
{
ereport(ERROR,
Expand Down
7 changes: 3 additions & 4 deletions src/backend/parser/cypher_clause.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ static Query *transform_cypher_unwind(cypher_parsestate *cpstate,

pnsi = transform_prev_cypher_clause(cpstate, clause->prev, true);
rtindex = list_length(pstate->p_rtable);
Assert(rtindex == 1); // rte is the first RangeTblEntry in pstate
// rte is the first RangeTblEntry in pstate
if (rtindex != 1)
{
ereport(ERROR,
Expand Down Expand Up @@ -2325,7 +2325,7 @@ static Query *transform_cypher_clause_with_where(cypher_parsestate *cpstate,
NULL, true);
Assert(pnsi != NULL);
rtindex = list_length(pstate->p_rtable);
Assert(rtindex == 1); // rte is the only RangeTblEntry in pstate
// rte is the only RangeTblEntry in pstate
if (rtindex != 1)
{
ereport(ERROR,
Expand Down Expand Up @@ -2605,7 +2605,7 @@ static Query *transform_cypher_match_pattern(cypher_parsestate *cpstate,
pnsi = transform_prev_cypher_clause(cpstate, clause->prev, true);
rte = pnsi->p_rte;
rtindex = list_length(pstate->p_rtable);
Assert(rtindex == 1); // rte is the first RangeTblEntry in pstate
// rte is the first RangeTblEntry in pstate
if (rtindex != 1)
{
ereport(ERROR,
Expand Down Expand Up @@ -7016,7 +7016,6 @@ static void handle_prev_clause(cypher_parsestate *cpstate, Query *query,
// rte is the first RangeTblEntry in pstate
if (first_rte)
{
Assert(rtindex == 1);
if (rtindex != 1)
{
ereport(ERROR,
Expand Down
9 changes: 7 additions & 2 deletions src/backend/parser/cypher_expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,17 @@ static Node *transform_AEXPR_IN(cypher_parsestate *cpstate, A_Expr *a)

scalar_type = AGTYPEOID;

Assert (verify_common_type(scalar_type, allexprs));
/* verify they are a common type */
if (!verify_common_type(scalar_type, allexprs))
{
ereport(ERROR,
errmsg_internal("not a common type: %d", scalar_type));
}

/*
* coerce all the right-hand non-Var inputs to the common type
* and build an ArrayExpr for them.
*/

aexprs = NIL;
foreach(l, rnonvars)
{
Expand Down
5 changes: 4 additions & 1 deletion src/backend/utils/adt/agtype_gin.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ Datum gin_extract_agtype_query(PG_FUNCTION_ARGS)

/* it should be WAGT_BEGIN_ARRAY */
itok = agtype_iterator_next(&it, &elem, true);
Assert(itok == WAGT_BEGIN_ARRAY);
if (itok != WAGT_BEGIN_ARRAY)
{
elog(ERROR, "unexpected iterator token: %d", itok);
}

while (WAGT_END_ARRAY != agtype_iterator_next(&it, &elem, true))
{
Expand Down
2 changes: 1 addition & 1 deletion src/include/utils/agtype.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/* Tokens used when sequentially processing an agtype value */
typedef enum
{
WAGT_DONE,
WAGT_DONE = 0x0,
WAGT_KEY,
WAGT_VALUE,
WAGT_ELEM,
Expand Down

0 comments on commit 689fa75

Please sign in to comment.