From 2f757580d7d7ce34d36ff49456e17ffbf6356d8b Mon Sep 17 00:00:00 2001 From: yudanov Date: Tue, 16 Jul 2013 17:21:30 +0700 Subject: [PATCH] #77 --- rbejdb/src/rbejdb.c | 8 +------- rbejdb/test/t3.rb | 4 +++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/rbejdb/src/rbejdb.c b/rbejdb/src/rbejdb.c index ec93a42..b5b292f 100644 --- a/rbejdb/src/rbejdb.c +++ b/rbejdb/src/rbejdb.c @@ -631,13 +631,7 @@ VALUE EJDB_find(int argc, VALUE* argv, VALUE self) { rbquery->orarrbson = NULL; rbquery->orarrlng = 0; - VALUE params = rb_ary_new(); - rb_ary_push(params, self); - rb_ary_push(params, collName); - rb_ary_push(params, queryWrap); - rb_ary_push(params, q); - rb_ary_push(params, orarr); - rb_ary_push(params, hints); + VALUE params = rb_ary_new3(6, self, collName, queryWrap, q, orarr, hints); // Even if exception raised during find() we will free memory, taken for query return rb_ensure(EJDB_find_internal_wrapper, params, EJDB_find_ensure, queryWrap); diff --git a/rbejdb/test/t3.rb b/rbejdb/test/t3.rb index e6a5445..9db0beb 100644 --- a/rbejdb/test/t3.rb +++ b/rbejdb/test/t3.rb @@ -13,7 +13,7 @@ $jb = EJDB.open("tdbt3", EJDB::JBOWRITER | EJDB::JBOCREAT | EJDB::JBOTRUNC) class EJDBAdvancedTestUnit < Test::Unit::TestCase RS = 100000 - QRS = 10000 + QRS = 100 def test_ejdbadv1_performance assert_not_nil $jb @@ -46,6 +46,8 @@ class EJDBAdvancedTestUnit < Test::Unit::TestCase assert_equal(1, $jb.find("pcoll1", rec, :onlycount => true)) } + $jb.drop_string_index("pcoll1", "rstring") + puts "Quering..." st = Time.now -- 2.7.4