Changeset: af30a89b5029 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/af30a89b5029
Modified Files:
        monetdb5/modules/atoms/json.c
        monetdb5/modules/atoms/pg_jsonpath/jsonpath_exec.c
        monetdb5/modules/atoms/pg_jsonpath/postgres_defines.h
Branch: json-extend
Log Message:

get rid of jbvBinary


diffs (104 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -517,6 +517,9 @@ JSONstr2json(json *ret, const char *cons
 
        JSON *jt = NULL;
 
+       *ret = GDKstrdup(*j);
+       return MAL_SUCCEED; // TODO: temporary
+
        if (strNil(*j)) {
                buf = GDKstrdup(*j);
        } else {
@@ -1479,6 +1482,7 @@ static JSON *
 JSONparse(const char *j)
 {
        JSON *jt = JSONnewtree();
+       return jt;
 
        if (jt == NULL)
                return NULL;
diff --git a/monetdb5/modules/atoms/pg_jsonpath/jsonpath_exec.c 
b/monetdb5/modules/atoms/pg_jsonpath/jsonpath_exec.c
--- a/monetdb5/modules/atoms/pg_jsonpath/jsonpath_exec.c
+++ b/monetdb5/modules/atoms/pg_jsonpath/jsonpath_exec.c
@@ -515,11 +515,6 @@ executeItemOptUnwrapTarget(JsonPathExecC
                        {
                                bool            hasNext = (elem = jsp->next);
 
-                               if (JsonbType(jb) != jbvBinary) {
-                                       elog(ERROR, "invalid jsonb object type: 
%d", JsonbType(jb));
-                                       return jperError;
-                               }
-
                                return executeAnyItem
                                        (cxt, hasNext ? elem : NULL,
                                         jb, found, 1, 1, 1,
@@ -669,14 +664,13 @@ executeItemOptUnwrapTarget(JsonPathExecC
                                                break;
                                }
 
-                               if (JsonbType(jb) == jbvBinary)
-                                       res = executeAnyItem
-                                               (cxt, hasNext ? elem : NULL,
-                                                jb, found,
-                                                1,
-                                                jsp->value .anybounds.first,
-                                                jsp->value .anybounds.last,
-                                                true, jspAutoUnwrap(cxt));
+                               res = executeAnyItem
+                                       (cxt, hasNext ? elem : NULL,
+                                               jb, found,
+                                               1,
+                                               jsp->value .anybounds.first,
+                                               jsp->value .anybounds.last,
+                                               true, jspAutoUnwrap(cxt));
                                break;
                        }
 
@@ -1127,7 +1121,6 @@ executeItemOptUnwrapTarget(JsonPathExecC
                                        case jbvNull:
                                        case jbvArray:
                                        case jbvObject:
-                                       case jbvBinary:
                                                RETURN_ERROR(ereport(ERROR,
                                                                                
         (errcode(ERRCODE_NON_NUMERIC_SQL_JSON_ITEM),
                                                                                
          errmsg("jsonpath item method .%s() can only be applied to a boolean, 
string, numeric, or datetime value",
@@ -1220,8 +1213,6 @@ executeItemOptUnwrapResult(JsonPathExecC
                JsonValueListInitIterator(&seq, &it);
                while ((item = JsonValueListNext(&seq, &it)))
                {
-                       // TODO get rid of jbvBinary
-
                        if (JsonbType(item) == jbvArray)
                                executeItemUnwrapTargetArray(cxt, NULL, item, 
found, false);
                        else
@@ -2151,7 +2142,6 @@ compareItems(JsonPathExecContext *cxt, i
                        }
                        break;
 
-               case jbvBinary:
                case jbvArray:
                case jbvObject:
                        return jpbUnknown;      /* non-scalars are not 
comparable */
@@ -2330,7 +2320,7 @@ JsonValueListNext(const JsonValueList *j
 }
 
 /*
- * Returns jbv* type of JsonbValue. Note, it never returns jbvBinary as is.
+ * Returns jbv* type of JsonbValue.
  */
 static int
 JsonbType(JsonbValue *jb)
diff --git a/monetdb5/modules/atoms/pg_jsonpath/postgres_defines.h 
b/monetdb5/modules/atoms/pg_jsonpath/postgres_defines.h
--- a/monetdb5/modules/atoms/pg_jsonpath/postgres_defines.h
+++ b/monetdb5/modules/atoms/pg_jsonpath/postgres_defines.h
@@ -29,8 +29,6 @@ enum jbvType
        /* Composite types */
        jbvArray = 0x10,
        jbvObject,
-       /* Binary (i.e. struct Jsonb) jbvArray/jbvObject */
-       jbvBinary,
 
        /*
         * Virtual types.
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to