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

add timestamp support


diffs (34 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
@@ -5731,6 +5731,9 @@ jsonv2local(const ValPtr t, char *v)
                case TYPE_str:
                        t->val.sval = v;
                        break;
+               case TYPE_timestamp:
+                       sql_timestamp_fromstr(v+1, &t->val.lval, 0, 0);
+                       break;
                default:
                        return NULL;
        }
@@ -5847,12 +5850,14 @@ insert_json_array(char **msg, JSON *js, 
                        switch (jt->kind) {
                        case JSON_OBJECT:
                                // FIX assumes array of composite?
-                               n = t->type->d.fields->h;
-                               if (n) {
-                                       sql_arg *a = n->data;
-                                       sql_subtype *atype = &a->type;
-                                       if (atype->type->composite)
-                                               t = atype;
+                               if (t->type->composite && 
list_length(t->type->d.fields) == 1) {
+                                       n = t->type->d.fields->h;
+                                       if (n) {
+                                               sql_arg *a = n->data;
+                                               sql_subtype *atype = &a->type;
+                                               if (atype->type->composite)
+                                                       t = atype;
+                                       }
                                }
                                elm = insert_json_object(msg, js, bats, 
bat_offset + 1, nr, elm, id, anr++, t);
                                (void)oanr; // outer array number
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to