Changeset: 423b3e448048 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/423b3e448048
Modified Files:
        sql/backends/monet5/sql.c
Branch: nested
Log Message:

do some more checking


diffs (36 lines):

diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5833,7 +5833,8 @@ insert_json_object(char **msg, JSON *js,
                                        elm = insert_json_object(msg, js, bats, 
&bat_offset, nr, elm, nt);
                                else if (nt && nt->type->localtype == 
ATOMindex("json")){
                                        // json string value
-                                       insert_json_value(jt, nt, 
bats[bat_offset]);
+                                       if ((*msg = insert_json_value(jt, nt, 
bats[bat_offset])) != MAL_SUCCEED)
+                                               return -1;
                                        // set term offset
                                        elm = ((jt - 1)->next) - 1; // ? is 
this right
                                        bat_offset ++;
@@ -5853,7 +5854,8 @@ insert_json_object(char **msg, JSON *js,
                                        elm = insert_json_array(msg, js, bats, 
&bat_offset, nr, elm, nt);
                                else if (nt && nt->type->localtype == 
ATOMindex("json")) {
                                        // json string value
-                                       insert_json_value(jt, nt, 
bats[bat_offset]);
+                                       if ((*msg = insert_json_value(jt, nt, 
bats[bat_offset])) != MAL_SUCCEED)
+                                               return -1;
                                        // set term offset
                                        elm = ((jt - 1)->next) - 1; // ? is 
this right
                                        bat_offset ++;
@@ -5884,9 +5886,10 @@ insert_json_object(char **msg, JSON *js,
                                        if ((*msg = insert_json_value(jt, nt, 
bats[bat_offset])) != MAL_SUCCEED)
                                                return -1;
                                        bat_offset ++;
+                               } else {
+                                       *msg = "field name missing";
+                                       return -1;
                                }
-                               else
-                                       *msg = "field name missing";
                        }
                }
        }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to