From: adam Date: Sat, 10 Aug 2013 19:15:57 +0000 (+0700) Subject: #15 X-Git-Tag: v1.2.12~211 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8a2d2d79d041fbfd12b4a7ee02b4e57bac62ea0;p=platform%2Fupstream%2Fejdb.git #15 --- diff --git a/tcejdb/bson.c b/tcejdb/bson.c index cb9e529..fe43fd8 100644 --- a/tcejdb/bson.c +++ b/tcejdb/bson.c @@ -464,7 +464,8 @@ bson_type bson_find_fieldpath_value2(const char *fpath, int fplen, bson_iterator .fplen = fplen, .input = it, .stopnestedarr = false, - .stopos = 0 + .stopos = 0, + .marrind = -1 }; return bson_find_fieldpath_value3(&ffctx); } diff --git a/tcejdb/bson.h b/tcejdb/bson.h index 1b7907a..ab6e69b 100644 --- a/tcejdb/bson.h +++ b/tcejdb/bson.h @@ -188,6 +188,7 @@ typedef struct { /**< Find field path context */ bson_iterator *input; int stopos; bool stopnestedarr; + int marrind; /**< Index of first matched array field */ } FFPCTX; diff --git a/tcejdb/ejdb.c b/tcejdb/ejdb.c index 95b1e58..8881c22 100644 --- a/tcejdb/ejdb.c +++ b/tcejdb/ejdb.c @@ -2090,7 +2090,9 @@ static bool _qrybsmatch(EJQF *qf, const void *bsbuf, int bsbufsz) { .fplen = qf->fpathsz, .input = &it, .stopnestedarr = true, - .stopos = 0 + .stopos = 0, + .marrind = -1 + }; return _qrybsrecurrmatch(qf, &ffpctx, 0); } @@ -2527,8 +2529,10 @@ static bool _pushprocessedbson(EJDB *jb, EJQ *q, TCLIST *res, TCMAP *dfields, TC EJQF *qf = TCLISTVALPTR(q->qobjlist, i); const char *fpath = tcmapget(q->$ifields, qf->fpath, qf->fpathsz, &sp); if (fpath) { - //todo!!!!! - fprintf(stderr, "\n\nfpath=%s", fpath); + + //todo... + //static bool _qrybsrecurrmatch(EJQF *qf, FFPCTX *ffpctx, int currpos) { + } } } @@ -3753,7 +3757,7 @@ static bool _qrypreprocess(EJCOLL *jcoll, EJQ *ejq, int qflags, EJQF **mqf, EJQF *qf = TCLISTVALPTR(qlist, i); int j; for (j = 0; *(key + j) != '\0' && *(key + j) == *(qf->fpath + j); ++j); - if (key + j == pptr || key + j == pptr + 1) { //existing QF matched $(projection) prefix + if (key + j == pptr || key + j == pptr + 1) { //existing QF matched the $(projection) prefix if (!ejq->$ifields) { ejq->$ifields = tcmapnew2(TCMAPTINYBNUM); }