rroonga 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Rakefile +1 -10
- data/ext/groonga/extconf.rb +3 -1
- data/ext/groonga/rb-grn-array.c +1 -1
- data/ext/groonga/rb-grn-column.c +33 -67
- data/ext/groonga/rb-grn-context.c +5 -5
- data/ext/groonga/rb-grn-database.c +2 -2
- data/ext/groonga/rb-grn-double-array-trie.c +4 -2
- data/ext/groonga/rb-grn-encoding-support.c +7 -1
- data/ext/groonga/rb-grn-equal-operator.c +85 -0
- data/ext/groonga/rb-grn-exception.c +17 -0
- data/ext/groonga/rb-grn-expression.c +85 -43
- data/ext/groonga/rb-grn-greater-equal-operator.c +88 -0
- data/ext/groonga/rb-grn-greater-operator.c +85 -0
- data/ext/groonga/rb-grn-hash.c +1 -1
- data/ext/groonga/rb-grn-index-column.c +150 -11
- data/ext/groonga/rb-grn-less-equal-operator.c +88 -0
- data/ext/groonga/rb-grn-less-operator.c +85 -0
- data/ext/groonga/rb-grn-logger.c +5 -5
- data/ext/groonga/rb-grn-match-operator.c +86 -0
- data/ext/groonga/rb-grn-normalizer.c +8 -1
- data/ext/groonga/rb-grn-not-equal-operator.c +85 -0
- data/ext/groonga/rb-grn-object.c +170 -36
- data/ext/groonga/rb-grn-operator.c +395 -172
- data/ext/groonga/rb-grn-patricia-trie.c +10 -8
- data/ext/groonga/rb-grn-plugin.c +51 -3
- data/ext/groonga/rb-grn-prefix-operator.c +86 -0
- data/ext/groonga/rb-grn-procedure-type.c +4 -0
- data/ext/groonga/rb-grn-query-logger.c +4 -4
- data/ext/groonga/rb-grn-regexp-operator.c +85 -0
- data/ext/groonga/rb-grn-snippet.c +1 -1
- data/ext/groonga/rb-grn-table-key-support.c +9 -5
- data/ext/groonga/rb-grn-table.c +52 -66
- data/ext/groonga/rb-grn-type.c +1 -1
- data/ext/groonga/rb-grn-utils.c +22 -3
- data/ext/groonga/rb-grn.h +31 -4
- data/ext/groonga/rb-groonga.c +9 -9
- data/lib/groonga/context.rb +31 -0
- data/lib/groonga/expression-builder.rb +14 -1
- data/lib/groonga/record.rb +10 -8
- data/lib/groonga/schema.rb +3 -1
- data/rroonga-build.rb +2 -2
- data/rroonga.gemspec +3 -3
- data/test/groonga-test-utils.rb +4 -0
- data/test/test-column.rb +28 -26
- data/test/test-exception.rb +1 -0
- data/test/test-expression-builder.rb +83 -1
- data/test/test-expression.rb +80 -48
- data/test/test-index-column.rb +102 -29
- data/test/test-normalizer.rb +35 -29
- data/test/test-operator.rb +214 -0
- data/test/test-plugin.rb +24 -6
- data/test/test-procedure.rb +29 -0
- data/test/test-schema-type.rb +14 -0
- data/test/test-table-select-mecab.rb +1 -4
- data/test/test-table.rb +7 -0
- data/test/test-token-regexp.rb +30 -0
- data/test/test-type.rb +24 -0
- metadata +61 -49
- data/doc/text/news.textile +0 -1217
data/ext/groonga/rb-grn-type.c
CHANGED
@@ -124,7 +124,7 @@ rb_grn_type_initialize (int argc, VALUE *argv, VALUE self)
|
|
124
124
|
|
125
125
|
type = grn_type_create(context, name, name_size, flags, size);
|
126
126
|
rb_grn_object_assign(Qnil, self, rb_context, context, type);
|
127
|
-
rb_grn_context_check(context,
|
127
|
+
rb_grn_context_check(context, rb_ary_new_from_values(argc, argv));
|
128
128
|
|
129
129
|
return Qnil;
|
130
130
|
}
|
data/ext/groonga/rb-grn-utils.c
CHANGED
@@ -146,7 +146,7 @@ rb_grn_equal_option (VALUE option, const char *key)
|
|
146
146
|
{
|
147
147
|
VALUE key_string, key_symbol;
|
148
148
|
|
149
|
-
key_string =
|
149
|
+
key_string = rb_str_new_cstr(key);
|
150
150
|
if (RVAL2CBOOL(rb_funcall(option, rb_intern("=="), 1, key_string)))
|
151
151
|
return GRN_TRUE;
|
152
152
|
|
@@ -171,6 +171,12 @@ rb_grn_equal_string (const char *string1, const char *string2)
|
|
171
171
|
return strcmp(string1, string2) == 0;
|
172
172
|
}
|
173
173
|
|
174
|
+
VALUE
|
175
|
+
rb_grn_convert_to_string (VALUE object)
|
176
|
+
{
|
177
|
+
return rb_convert_type(object, RUBY_T_STRING, "String", "to_str");
|
178
|
+
}
|
179
|
+
|
174
180
|
VALUE
|
175
181
|
rb_grn_convert_to_array (VALUE object)
|
176
182
|
{
|
@@ -364,6 +370,8 @@ rb_grn_bulk_to_ruby_object (grn_ctx *context, grn_obj *bulk,
|
|
364
370
|
grn_obj *
|
365
371
|
rb_grn_bulk_from_ruby_object (VALUE object, grn_ctx *context, grn_obj *bulk)
|
366
372
|
{
|
373
|
+
int object_type;
|
374
|
+
|
367
375
|
if (bulk && bulk->header.domain == GRN_DB_TIME)
|
368
376
|
return RVAL2GRNBULK_WITH_TYPE(object, context, bulk,
|
369
377
|
bulk->header.domain,
|
@@ -374,13 +382,24 @@ rb_grn_bulk_from_ruby_object (VALUE object, grn_ctx *context, grn_obj *bulk)
|
|
374
382
|
rb_grn_context_check(context, object);
|
375
383
|
}
|
376
384
|
|
377
|
-
|
385
|
+
object_type = TYPE(object);
|
386
|
+
switch (object_type) {
|
378
387
|
case T_NIL:
|
379
388
|
grn_obj_reinit(context, bulk, GRN_DB_VOID, 0);
|
380
389
|
break;
|
381
390
|
case T_SYMBOL:
|
382
|
-
|
391
|
+
case T_REGEXP:
|
383
392
|
case T_STRING:
|
393
|
+
switch (object_type) {
|
394
|
+
case T_SYMBOL:
|
395
|
+
object = rb_funcall(object, rb_intern("to_s"), 0);
|
396
|
+
break;
|
397
|
+
case T_REGEXP:
|
398
|
+
object = rb_funcall(object, rb_intern("source"), 0);
|
399
|
+
break;
|
400
|
+
default:
|
401
|
+
break;
|
402
|
+
}
|
384
403
|
grn_obj_reinit(context, bulk, GRN_DB_TEXT, 0);
|
385
404
|
rb_grn_context_text_set(context, bulk, object);
|
386
405
|
break;
|
data/ext/groonga/rb-grn.h
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2
2
|
/*
|
3
3
|
Copyright (C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
|
4
|
-
Copyright (C) 2009-
|
4
|
+
Copyright (C) 2009-2015 Kouhei Sutou <kou@clear-code.com>
|
5
5
|
|
6
6
|
This library is free software; you can redistribute it and/or
|
7
7
|
modify it under the terms of the GNU Lesser General Public
|
@@ -49,6 +49,14 @@
|
|
49
49
|
# define rb_to_symbol(rb_string) (rb_str_intern(rb_string))
|
50
50
|
#endif
|
51
51
|
|
52
|
+
#ifndef HAVE_RB_ARY_NEW_FROM_ARGS
|
53
|
+
# define rb_ary_new_from_args(n, ...) rb_ary_new3((n), __VA_ARGS__)
|
54
|
+
#endif
|
55
|
+
|
56
|
+
#ifndef HAVE_RB_ARY_NEW_FROM_VALUES
|
57
|
+
# define rb_ary_new_from_values(n, values) rb_ary_new4((n), (values))
|
58
|
+
#endif
|
59
|
+
|
52
60
|
#include <groonga.h>
|
53
61
|
|
54
62
|
#if defined(__cplusplus)
|
@@ -93,7 +101,7 @@ RB_GRN_BEGIN_DECLS
|
|
93
101
|
|
94
102
|
#define RB_GRN_MAJOR_VERSION 5
|
95
103
|
#define RB_GRN_MINOR_VERSION 0
|
96
|
-
#define RB_GRN_MICRO_VERSION
|
104
|
+
#define RB_GRN_MICRO_VERSION 1
|
97
105
|
|
98
106
|
#define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
|
99
107
|
|
@@ -104,7 +112,7 @@ RB_GRN_BEGIN_DECLS
|
|
104
112
|
#define RB_GRN_TABLE(object) ((RbGrnTable *)(object))
|
105
113
|
#define RB_GRN_TABLE_KEY_SUPPORT(object) ((RbGrnTableKeySupport *)(object))
|
106
114
|
#define RB_GRN_DOUBLE_ARRAY_TRIE(object) ((RbGrnDoubleArrayTrie *)(object))
|
107
|
-
#define RB_GRN_TABLE_CURSOR(object) ((
|
115
|
+
#define RB_GRN_TABLE_CURSOR(object) ((RbGrnTableCursor *)(object))
|
108
116
|
#define RB_GRN_COLUMN(object) ((RbGrnColumn *)(object))
|
109
117
|
#define RB_GRN_VARIABLE_SIZE_COLUMN(object) ((RbGrnVariableSizeColumn *)(object))
|
110
118
|
#define RB_GRN_INDEX_COLUMN(object) ((RbGrnIndexColumn *)(object))
|
@@ -278,6 +286,15 @@ RB_GRN_VAR VALUE rb_cGrnLogger;
|
|
278
286
|
RB_GRN_VAR VALUE rb_cGrnSnippet;
|
279
287
|
RB_GRN_VAR VALUE rb_cGrnVariable;
|
280
288
|
RB_GRN_VAR VALUE rb_cGrnOperator;
|
289
|
+
RB_GRN_VAR VALUE rb_cGrnEqualOperator;
|
290
|
+
RB_GRN_VAR VALUE rb_cGrnNotEqualOperator;
|
291
|
+
RB_GRN_VAR VALUE rb_cGrnLessOperator;
|
292
|
+
RB_GRN_VAR VALUE rb_cGrnGreaterOperator;
|
293
|
+
RB_GRN_VAR VALUE rb_cGrnLessEqualOperator;
|
294
|
+
RB_GRN_VAR VALUE rb_cGrnGreaterEqualOperator;
|
295
|
+
RB_GRN_VAR VALUE rb_cGrnMatchOperator;
|
296
|
+
RB_GRN_VAR VALUE rb_cGrnPrefixOperator;
|
297
|
+
RB_GRN_VAR VALUE rb_cGrnRegexpOperator;
|
281
298
|
RB_GRN_VAR VALUE rb_cGrnExpression;
|
282
299
|
RB_GRN_VAR VALUE rb_cGrnRecordExpressionBuilder;
|
283
300
|
RB_GRN_VAR VALUE rb_cGrnColumnExpressionBuilder;
|
@@ -317,6 +334,15 @@ void rb_grn_init_geo_point (VALUE mGrn);
|
|
317
334
|
void rb_grn_init_record (VALUE mGrn);
|
318
335
|
void rb_grn_init_variable (VALUE mGrn);
|
319
336
|
void rb_grn_init_operator (VALUE mGrn);
|
337
|
+
void rb_grn_init_equal_operator (VALUE mGrn);
|
338
|
+
void rb_grn_init_not_equal_operator (VALUE mGrn);
|
339
|
+
void rb_grn_init_less_operator (VALUE mGrn);
|
340
|
+
void rb_grn_init_greater_operator (VALUE mGrn);
|
341
|
+
void rb_grn_init_less_equal_operator (VALUE mGrn);
|
342
|
+
void rb_grn_init_greater_equal_operator (VALUE mGrn);
|
343
|
+
void rb_grn_init_match_operator (VALUE mGrn);
|
344
|
+
void rb_grn_init_prefix_operator (VALUE mGrn);
|
345
|
+
void rb_grn_init_regexp_operator (VALUE mGrn);
|
320
346
|
void rb_grn_init_expression (VALUE mGrn);
|
321
347
|
void rb_grn_init_expression_builder (VALUE mGrn);
|
322
348
|
void rb_grn_init_logger (VALUE mGrn);
|
@@ -359,6 +385,7 @@ grn_bool rb_grn_equal_option (VALUE option,
|
|
359
385
|
const char *key);
|
360
386
|
grn_bool rb_grn_equal_string (const char *string1,
|
361
387
|
const char *string2);
|
388
|
+
VALUE rb_grn_convert_to_string (VALUE object);
|
362
389
|
VALUE rb_grn_convert_to_array (VALUE object);
|
363
390
|
VALUE rb_grn_check_convert_to_string (VALUE object);
|
364
391
|
VALUE rb_grn_check_convert_to_array (VALUE object);
|
@@ -603,7 +630,7 @@ VALUE rb_grn_column_expression_builder_build
|
|
603
630
|
(VALUE self);
|
604
631
|
|
605
632
|
|
606
|
-
#define RB_GRN_INTERN(c_string) (rb_to_symbol(
|
633
|
+
#define RB_GRN_INTERN(c_string) (rb_to_symbol(rb_str_new_cstr(c_string)))
|
607
634
|
|
608
635
|
#define RVAL2CBOOL(object) (RTEST(object))
|
609
636
|
#define CBOOL2RVAL(boolean) ((boolean) ? Qtrue : Qfalse)
|
data/ext/groonga/rb-groonga.c
CHANGED
@@ -62,7 +62,7 @@ rb_grn_init_runtime_version (VALUE mGrn)
|
|
62
62
|
rb_ary_push(runtime_version, rb_Integer(micro));
|
63
63
|
|
64
64
|
if (component_end) {
|
65
|
-
tag =
|
65
|
+
tag = rb_str_new_cstr(component_end + 1);
|
66
66
|
} else {
|
67
67
|
tag = Qnil;
|
68
68
|
}
|
@@ -84,10 +84,10 @@ rb_grn_init_version (VALUE mGrn)
|
|
84
84
|
|
85
85
|
rb_grn_init_runtime_version(mGrn);
|
86
86
|
|
87
|
-
build_version =
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
build_version = rb_ary_new_from_args(3,
|
88
|
+
INT2NUM(GRN_MAJOR_VERSION),
|
89
|
+
INT2NUM(GRN_MINOR_VERSION),
|
90
|
+
INT2NUM(GRN_MICRO_VERSION));
|
91
91
|
rb_obj_freeze(build_version);
|
92
92
|
/*
|
93
93
|
* ビルドしたgroongaのバージョン。 @[メジャーバージョン,
|
@@ -95,10 +95,10 @@ rb_grn_init_version (VALUE mGrn)
|
|
95
95
|
*/
|
96
96
|
rb_define_const(mGrn, "BUILD_VERSION", build_version);
|
97
97
|
|
98
|
-
bindings_version =
|
99
|
-
|
100
|
-
|
101
|
-
|
98
|
+
bindings_version = rb_ary_new_from_args(3,
|
99
|
+
INT2NUM(RB_GRN_MAJOR_VERSION),
|
100
|
+
INT2NUM(RB_GRN_MINOR_VERSION),
|
101
|
+
INT2NUM(RB_GRN_MICRO_VERSION));
|
102
102
|
rb_obj_freeze(bindings_version);
|
103
103
|
/*
|
104
104
|
* rroongaのバージョン。 @[メジャーバージョン, マ
|
data/lib/groonga/context.rb
CHANGED
@@ -119,6 +119,37 @@ module Groonga
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
+
# Unregister a registered `name` plugin.
|
123
|
+
#
|
124
|
+
# You can unregister `name` plugin by name if
|
125
|
+
# `name` plugin is installed to plugin directory.
|
126
|
+
#
|
127
|
+
# @example Unregister a registerd plugin by name.
|
128
|
+
# context.register_plugin("token_filters/stop_word")
|
129
|
+
# context.unregister_plugin("token_filters/stop_word")
|
130
|
+
#
|
131
|
+
# You can also specify the path of `name` plugin explicitly.
|
132
|
+
#
|
133
|
+
# @example Unregister a registerd plugin by path.
|
134
|
+
# context.register_plugin("token_filters/stop_word")
|
135
|
+
# context.unregister_plugin("/usr/local/lib/groonga/plugins/token_filters/stop_word.so")
|
136
|
+
#
|
137
|
+
# @overload unregister_plugin(name)
|
138
|
+
# Unregister a registerd plugin by name.
|
139
|
+
#
|
140
|
+
# @param [String] name The plugin name.
|
141
|
+
#
|
142
|
+
# @overload unregister_plugin(path)
|
143
|
+
# Unregister a registerd plugin by path.
|
144
|
+
#
|
145
|
+
# @param [String] path The path to plugin.
|
146
|
+
#
|
147
|
+
# @since 5.0.1
|
148
|
+
def unregister_plugin(name_or_path)
|
149
|
+
options = {:context => self}
|
150
|
+
Plugin.unregister(name_or_path, options)
|
151
|
+
end
|
152
|
+
|
122
153
|
# _table_ から指定した条件にマッチするレコードの値を取得
|
123
154
|
# する。 _table_ はテーブル名かテーブルオブジェクトを指定
|
124
155
|
# する。
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
+
# Copyright (C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
|
3
4
|
# Copyright (C) 2009-2012 Kouhei Sutou <kou@clear-code.com>
|
4
5
|
#
|
5
6
|
# This library is free software; you can redistribute it and/or
|
@@ -173,7 +174,12 @@ module Groonga
|
|
173
174
|
raise ArgumentError,
|
174
175
|
"match word should not be nil: #{full_column_name}"
|
175
176
|
end
|
176
|
-
|
177
|
+
|
178
|
+
if other.is_a?(Regexp)
|
179
|
+
RegexpExpressionBuilder.new(self, normalize(other.source))
|
180
|
+
else
|
181
|
+
MatchExpressionBuilder.new(self, normalize(other))
|
182
|
+
end
|
177
183
|
end
|
178
184
|
|
179
185
|
def <(other)
|
@@ -332,6 +338,13 @@ module Groonga
|
|
332
338
|
end
|
333
339
|
end
|
334
340
|
|
341
|
+
# @private
|
342
|
+
class RegexpExpressionBuilder < BinaryExpressionBuilder
|
343
|
+
def initialize(column_value_builder, value)
|
344
|
+
super(Groonga::Operation::REGEXP, column_value_builder, value)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
335
348
|
# @private
|
336
349
|
class LessExpressionBuilder < BinaryExpressionBuilder
|
337
350
|
def initialize(column_value_builder, value)
|
data/lib/groonga/record.rb
CHANGED
@@ -366,18 +366,20 @@ module Groonga
|
|
366
366
|
@table.unlock(options.merge(:id => @id))
|
367
367
|
end
|
368
368
|
|
369
|
-
#
|
369
|
+
# Forces to clear lock of the table to which the record belongs.
|
370
370
|
#
|
371
|
-
#
|
372
|
-
def clear_lock
|
373
|
-
@table.clear_lock
|
371
|
+
# @return [void]
|
372
|
+
def clear_lock
|
373
|
+
@table.clear_lock
|
374
374
|
end
|
375
375
|
|
376
|
-
#
|
376
|
+
# Checks whether the table to which the record belongs is locked
|
377
|
+
# or not.
|
377
378
|
#
|
378
|
-
#
|
379
|
-
|
380
|
-
|
379
|
+
# @return [Boolean] `true` if the table to which the record
|
380
|
+
# belongs is locked, `false` otherwise.
|
381
|
+
def locked?
|
382
|
+
@table.locked?
|
381
383
|
end
|
382
384
|
|
383
385
|
# レコードが持つIDが有効なIDであれば +true+ を返す。
|
data/lib/groonga/schema.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
# Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
|
4
|
-
# Copyright (C) 2014 Masafumi Yokoyama <
|
4
|
+
# Copyright (C) 2014-2015 Masafumi Yokoyama <yokoyama@clear-code.com>
|
5
5
|
#
|
6
6
|
# This library is free software; you can redistribute it and/or
|
7
7
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -598,6 +598,8 @@ module Groonga
|
|
598
598
|
"token_trigram" => "TokenTrigram",
|
599
599
|
"mecab" => "TokenMecab",
|
600
600
|
"token_mecab"=> "TokenMecab",
|
601
|
+
"regexp" => "TokenRegexp",
|
602
|
+
"token_regexp"=> "TokenRegexp",
|
601
603
|
}
|
602
604
|
# @private
|
603
605
|
def normalize_type(type, options={})
|
data/rroonga-build.rb
CHANGED
@@ -20,7 +20,7 @@ module RroongaBuild
|
|
20
20
|
module RequiredGroongaVersion
|
21
21
|
MAJOR = 5
|
22
22
|
MINOR = 0
|
23
|
-
MICRO =
|
23
|
+
MICRO = 2
|
24
24
|
VERSION = [MAJOR, MINOR, MICRO]
|
25
25
|
RELEASED_DATE = Time.utc(2015, 2, 9)
|
26
26
|
end
|
@@ -28,7 +28,7 @@ module RroongaBuild
|
|
28
28
|
module LatestGroongaVersion
|
29
29
|
MAJOR = 5
|
30
30
|
MINOR = 0
|
31
|
-
MICRO =
|
31
|
+
MICRO = 2
|
32
32
|
VERSION = [MAJOR, MINOR, MICRO]
|
33
33
|
end
|
34
34
|
|
data/rroonga.gemspec
CHANGED
@@ -76,7 +76,7 @@ Gem::Specification.new do |s|
|
|
76
76
|
end
|
77
77
|
|
78
78
|
s.homepage = "http://ranguba.org/#about-rroonga"
|
79
|
-
s.licenses = ["
|
79
|
+
s.licenses = ["LGPL-2.1"]
|
80
80
|
s.require_paths = ["lib", "ext/groonga"]
|
81
81
|
s.rubyforge_project = "groonga"
|
82
82
|
|
@@ -89,10 +89,10 @@ Gem::Specification.new do |s|
|
|
89
89
|
s.add_development_dependency("test-unit", [">= 3.0.0"])
|
90
90
|
s.add_development_dependency("test-unit-notify")
|
91
91
|
s.add_development_dependency("rake")
|
92
|
-
s.add_development_dependency("rake-compiler")
|
92
|
+
s.add_development_dependency("rake-compiler", [">= 0.9.5"])
|
93
93
|
s.add_development_dependency("bundler")
|
94
94
|
s.add_development_dependency("yard")
|
95
95
|
s.add_development_dependency("packnga", [">= 1.0.0"])
|
96
|
-
s.add_development_dependency("
|
96
|
+
s.add_development_dependency("kramdown")
|
97
97
|
end
|
98
98
|
|
data/test/groonga-test-utils.rb
CHANGED
data/test/test-column.rb
CHANGED
@@ -170,16 +170,15 @@ class ColumnTest < Test::Unit::TestCase
|
|
170
170
|
record["body"]
|
171
171
|
end)
|
172
172
|
assert_equal(<<-INSPECTED.chomp, result.expression.inspect)
|
173
|
-
#<Groonga::Expression
|
173
|
+
#<Groonga::Expression
|
174
174
|
vars:{
|
175
175
|
$1:#<record:hash:Posts id:(no value)>
|
176
176
|
},
|
177
177
|
codes:{
|
178
|
-
0:<get_value
|
179
|
-
1:<push
|
180
|
-
2:<match
|
181
|
-
}
|
182
|
-
>>
|
178
|
+
0:<get_value n_args:1, flags:0, modify:2, value:#<column:var_size Posts.body range:Text type:scalar compress:none>>,
|
179
|
+
1:<push n_args:1, flags:0, modify:0, value:"drive">,
|
180
|
+
2:<match n_args:2, flags:0, modify:0, value:(NULL)>
|
181
|
+
}>
|
183
182
|
INSPECTED
|
184
183
|
end
|
185
184
|
|
@@ -210,16 +209,15 @@ class ColumnTest < Test::Unit::TestCase
|
|
210
209
|
record["body"]
|
211
210
|
end)
|
212
211
|
assert_equal(<<-INSPECTED.chomp, result.expression.inspect)
|
213
|
-
#<Groonga::Expression
|
212
|
+
#<Groonga::Expression
|
214
213
|
vars:{
|
215
214
|
$1:#<record:hash:Posts id:(no value)>
|
216
215
|
},
|
217
216
|
codes:{
|
218
|
-
0:<get_value
|
219
|
-
1:<push
|
220
|
-
2:<match
|
221
|
-
}
|
222
|
-
>>
|
217
|
+
0:<get_value n_args:1, flags:0, modify:2, value:#<column:var_size Posts.body range:Text type:scalar compress:none>>,
|
218
|
+
1:<push n_args:1, flags:0, modify:0, value:"drive">,
|
219
|
+
2:<match n_args:2, flags:0, modify:0, value:(NULL)>
|
220
|
+
}>
|
223
221
|
INSPECTED
|
224
222
|
end
|
225
223
|
|
@@ -237,17 +235,16 @@ class ColumnTest < Test::Unit::TestCase
|
|
237
235
|
record["body"]
|
238
236
|
end)
|
239
237
|
assert_equal(<<-INSPECTED.chomp, result.expression.inspect)
|
240
|
-
#<Groonga::Expression
|
238
|
+
#<Groonga::Expression
|
241
239
|
vars:{
|
242
240
|
$1:#<record:hash:Posts id:(no value)>
|
243
241
|
},
|
244
242
|
codes:{
|
245
|
-
0:<push
|
246
|
-
1:<get_value
|
247
|
-
2:<push
|
248
|
-
3:<match
|
249
|
-
}
|
250
|
-
>>
|
243
|
+
0:<push n_args:1, flags:0, modify:0, value:#<record:hash:Posts id:(no value)>>,
|
244
|
+
1:<get_value n_args:1, flags:0, modify:2, value:#<column:var_size Posts.body range:Text type:scalar compress:none>>,
|
245
|
+
2:<push n_args:1, flags:0, modify:0, value:"drive">,
|
246
|
+
3:<match n_args:2, flags:0, modify:0, value:(NULL)>
|
247
|
+
}>
|
251
248
|
INSPECTED
|
252
249
|
end
|
253
250
|
|
@@ -262,17 +259,16 @@ class ColumnTest < Test::Unit::TestCase
|
|
262
259
|
record["body"]
|
263
260
|
end)
|
264
261
|
assert_equal(<<-INSPECTED.chomp, result.expression.inspect)
|
265
|
-
#<Groonga::Expression
|
262
|
+
#<Groonga::Expression
|
266
263
|
vars:{
|
267
264
|
$1:#<record:hash:Posts id:(no value)>
|
268
265
|
},
|
269
266
|
codes:{
|
270
|
-
0:<push
|
271
|
-
1:<get_value
|
272
|
-
2:<push
|
273
|
-
3:<match
|
274
|
-
}
|
275
|
-
>>
|
267
|
+
0:<push n_args:1, flags:0, modify:1, value:#<record:hash:Posts id:(no value)>>,
|
268
|
+
1:<get_value n_args:2, flags:0, modify:2, value:#<column:var_size Posts.body range:Text type:scalar compress:none>>,
|
269
|
+
2:<push n_args:1, flags:0, modify:0, value:"drive">,
|
270
|
+
3:<match n_args:2, flags:0, modify:0, value:(NULL)>
|
271
|
+
}>
|
276
272
|
INSPECTED
|
277
273
|
end
|
278
274
|
|
@@ -344,6 +340,12 @@ class ColumnTest < Test::Unit::TestCase
|
|
344
340
|
assert_not_predicate(@users_name_column, :builtin?)
|
345
341
|
end
|
346
342
|
|
343
|
+
def test_table?
|
344
|
+
assert do
|
345
|
+
not @users_name_column.table?
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
347
349
|
private
|
348
350
|
def assert_content_search(expected_records, term)
|
349
351
|
records = @bookmarks_index_content.search(term).records
|