[Groonga-commit] groonga/groonga at a0ebac8 [master] test: add optimize expression having function

Back to archive index

Naoya Murakami null+****@clear*****
Fri Jun 24 19:05:45 JST 2016


Naoya Murakami	2016-06-24 19:05:45 +0900 (Fri, 24 Jun 2016)

  New Revision: a0ebac8d5cdd3823e5896ed85ba1a07b714a64d9
  https://github.com/groonga/groonga/commit/a0ebac8d5cdd3823e5896ed85ba1a07b714a64d9

  Merged c710b7d: Merge pull request #562 from naoa/support-expr-have-func

  Message:
    test: add optimize expression having function

  Modified files:
    test/mruby/suite/expression_rewriter/test_between.rb

  Modified: test/mruby/suite/expression_rewriter/test_between.rb (+29 -0)
===================================================================
--- test/mruby/suite/expression_rewriter/test_between.rb    2016-06-24 19:03:56 +0900 (fc21af3)
+++ test/mruby/suite/expression_rewriter/test_between.rb    2016-06-24 19:05:45 +0900 (fcd598a)
@@ -71,4 +71,33 @@ class TestBetween < ExpressionRewriterTestCase
   expr:       <11..11>
     DUMP
   end
+
+  def test_function
+    code =
+      "between(timestamp, '2015-09-01 00:00:00', 'include', '2015-10-15 00:00:00', 'include') && " +
+      "timestamp >= '2015-10-01 00:00:00' && " +
+      "timestamp <  '2015-11-00 00:00:00'"
+    assert_equal(<<-DUMP, dump_rewritten_plan(code))
+[0]
+  op:         <call>
+  logical_op: <or>
+  args[0]:    <#<proc:function between arguments:[]>>
+  args[1]:    <#<column:fix_size Logs.timestamp range:Time type:scalar compress:none>>
+  args[2]:    <"2015-09-01 00:00:00">
+  args[3]:    <"include">
+  args[4]:    <"2015-10-15 00:00:00">
+  args[5]:    <"include">
+  expr:       <0..6>
+[1]
+  op:         <call>
+  logical_op: <and>
+  args[0]:    <#<proc:function between arguments:[]>>
+  args[1]:    <#<column:fix_size Logs.timestamp range:Time type:scalar compress:none>>
+  args[2]:    <"2015-10-01 00:00:00">
+  args[3]:    <"include">
+  args[4]:    <"2015-11-00 00:00:00">
+  args[5]:    <"exclude">
+  expr:       <7..13>
+    DUMP
+  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index