Fix DockerHub warning messages for latest (#1380)

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.
diff --git a/src/backend/parser/cypher_analyze.c b/src/backend/parser/cypher_analyze.c
index 64725a2..9f4836c 100644
--- a/src/backend/parser/cypher_analyze.c
+++ b/src/backend/parser/cypher_analyze.c
@@ -802,7 +802,7 @@
                                         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,
diff --git a/src/backend/parser/cypher_clause.c b/src/backend/parser/cypher_clause.c
index c38570c..e60fc28 100644
--- a/src/backend/parser/cypher_clause.c
+++ b/src/backend/parser/cypher_clause.c
@@ -1340,7 +1340,7 @@
 
         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,
@@ -2325,7 +2325,7 @@
                                                    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,
@@ -2605,7 +2605,7 @@
             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,
@@ -7016,7 +7016,6 @@
     // rte is the first RangeTblEntry in pstate
     if (first_rte)
     {
-        Assert(rtindex == 1);
         if (rtindex != 1)
         {
             ereport(ERROR,
diff --git a/src/backend/parser/cypher_expr.c b/src/backend/parser/cypher_expr.c
index a3ea59c..4e3e9d4 100644
--- a/src/backend/parser/cypher_expr.c
+++ b/src/backend/parser/cypher_expr.c
@@ -565,12 +565,17 @@
 
         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)
         {
diff --git a/src/backend/utils/adt/agtype_gin.c b/src/backend/utils/adt/agtype_gin.c
index 1a1f267..ceceeaa 100644
--- a/src/backend/utils/adt/agtype_gin.c
+++ b/src/backend/utils/adt/agtype_gin.c
@@ -242,7 +242,10 @@
 
         /* 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))
         {
diff --git a/src/include/utils/agtype.h b/src/include/utils/agtype.h
index 75712dd..18b01f6 100644
--- a/src/include/utils/agtype.h
+++ b/src/include/utils/agtype.h
@@ -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,