diff options
Diffstat (limited to 'storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/constant.rb')
-rw-r--r-- | storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/constant.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/constant.rb b/storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/constant.rb new file mode 100644 index 00000000000..228a1fc84f5 --- /dev/null +++ b/storage/mroonga/vendor/groonga/lib/mrb/scripts/expression_tree/constant.rb @@ -0,0 +1,22 @@ +module Groonga + module ExpressionTree + class Constant + attr_reader :value + def initialize(value) + @value = value + end + + def build(expression) + expression.append_constant(@value, Operator::PUSH, 1) + end + + def estimate_size(table) + if Bulk.true?(@value) + table.size + else + 0 + end + end + end + end +end |