#16
authoradam <adamansky@gmail.com>
Tue, 25 Dec 2012 16:24:07 +0000 (23:24 +0700)
committeradam <adamansky@gmail.com>
Tue, 25 Dec 2012 16:24:07 +0000 (23:24 +0700)
Changelog
package.json
tcejdb/configure
tcejdb/configure.ac
tcejdb/ejdb.c
tcejdb/testejdb/t2.c

index bb8fa0c..68ffb7c 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,8 @@
+2012-12-26 Anton Adamansky. <adamansky@gmail.com>
+    * Fixed crash on collection remove (ticket: #18)
+    * Incorrect dropping of all field indexes (ticket: #16)
+    - Release 1.0.35
+
 2012-12-25 Anton Adamansky. <adamansky@gmail.com>
     * Nodejs database cursors more GC friendly
     - Release 1.0.34
index 5dad40b..a258e2c 100644 (file)
@@ -1,6 +1,6 @@
 {
     "name" : "ejdb",
-    "version" : "1.0.34",
+    "version" : "1.0.35",
     "main" : "node/ejdb.js",
     "homepage" : "http://ejdb.org",
     "description" : "EJDB - Embedded JSON Database engine",
index fbc5a5b..7d32ccd 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tcejdb 1.0.34.
+# Generated by GNU Autoconf 2.69 for tcejdb 1.0.35.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -577,8 +577,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tcejdb'
 PACKAGE_TARNAME='tcejdb'
-PACKAGE_VERSION='1.0.34'
-PACKAGE_STRING='tcejdb 1.0.34'
+PACKAGE_VERSION='1.0.35'
+PACKAGE_STRING='tcejdb 1.0.35'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1257,7 +1257,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tcejdb 1.0.34 to adapt to many kinds of systems.
+\`configure' configures tcejdb 1.0.35 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1318,7 +1318,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tcejdb 1.0.34:";;
+     short | recursive ) echo "Configuration of tcejdb 1.0.35:";;
    esac
   cat <<\_ACEOF
 
@@ -1424,7 +1424,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tcejdb configure 1.0.34
+tcejdb configure 1.0.35
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1722,7 +1722,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tcejdb $as_me 1.0.34, which was
+It was created by tcejdb $as_me 1.0.35, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2344,7 +2344,7 @@ fi
 
 # Messages
 printf '#================================================================\n'
-printf '# Configuring Tokyo Cabinet version %s%s.\n' "$PACKAGE_VERSION" "$enables"
+printf '# Configuring EJDB version %s%s.\n' "$PACKAGE_VERSION" "$enables"
 printf '#================================================================\n'
 
 
@@ -4870,7 +4870,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tcejdb $as_me 1.0.34, which was
+This file was extended by tcejdb $as_me 1.0.35, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4923,7 +4923,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-tcejdb config.status 1.0.34
+tcejdb config.status 1.0.35
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 7e25966..5a19460 100644 (file)
@@ -11,7 +11,7 @@ test -n "$CPPFLAGS" && MYCPPFLAGS="$CPPFLAGS $MYCPPFLAGS"
 test -n "$LDFLAGS" && MYLDFLAGS="$LDFLAGS $MYLDFLAGS"
 
 # Package name
-AC_INIT(tcejdb, 1.0.34)
+AC_INIT(tcejdb, 1.0.35)
 
 # Package information
 MYLIBVER=9
@@ -233,7 +233,7 @@ fi
 
 # Messages
 printf '#================================================================\n'
-printf '# Configuring Tokyo Cabinet version %s%s.\n' "$PACKAGE_VERSION" "$enables"
+printf '# Configuring EJDB version %s%s.\n' "$PACKAGE_VERSION" "$enables"
 printf '#================================================================\n'
 
 
index e0ec698..32fc55f 100644 (file)
@@ -579,7 +579,7 @@ EJDB_EXPORT bool ejdbsetindex(EJCOLL *jcoll, const char *fpath, int flags) {
         if (!idrop && oldiflags != flags) { //Update index meta
             bson imetadelta;
             bson_init(&imetadelta);
-            bson_append_int(&imetadelta, "iflags", flags);
+            bson_append_int(&imetadelta, "iflags", (flags | oldiflags));
             bson_finish(&imetadelta);
             rv = _metasetbson2(jcoll, ikey, &imetadelta, true, true);
             bson_destroy(&imetadelta);
index 121765e..7291cf0 100644 (file)
@@ -3635,7 +3635,6 @@ void test$elemMatch() {
     tcxstrdel(log);
     ejdbquerydel(q1);
 
-
     bson_init_as_query(&bsq1);
     bson_append_start_object(&bsq1, "complexarr");
     bson_append_start_object(&bsq1, "$elemMatch");
@@ -3675,6 +3674,17 @@ void test$elemMatch() {
     ejdbquerydel(q1);
 }
 
+void testTicket16() {
+    EJCOLL *coll = ejdbcreatecoll(jb, "abcd", NULL);
+    CU_ASSERT_PTR_NOT_NULL_FATAL(coll);
+    CU_ASSERT_EQUAL(coll->tdb->inum, 0);
+    CU_ASSERT_TRUE(ejdbsetindex(coll, "abcd", JBIDXISTR));
+    CU_ASSERT_TRUE(ejdbsetindex(coll, "abcd", JBIDXNUM));
+    CU_ASSERT_EQUAL(coll->tdb->inum, 2);
+    CU_ASSERT_TRUE(ejdbsetindex(coll, "abcd", JBIDXDROPALL));
+    CU_ASSERT_EQUAL(coll->tdb->inum, 0);
+}
+
 int main() {
 
     setlocale(LC_ALL, "en_US.UTF-8");
@@ -3735,7 +3745,8 @@ int main() {
             (NULL == CU_add_test(pSuite, "test$addToSet", test$addToSet)) ||
             (NULL == CU_add_test(pSuite, "test$pull", test$pull)) ||
             (NULL == CU_add_test(pSuite, "testFindInComplexArray", testFindInComplexArray)) ||
-            (NULL == CU_add_test(pSuite, "test$elemMatch", test$elemMatch))
+            (NULL == CU_add_test(pSuite, "test$elemMatch", test$elemMatch)) ||
+            (NULL == CU_add_test(pSuite, "testTicket16", testTicket16))
             ) {
         CU_cleanup_registry();
         return CU_get_error();