[Groonga-commit] groonga/groonga at 6f4acab [master] sharding: fix too big time

Back to archive index

Kouhei Sutou null+****@clear*****
Thu May 25 10:56:07 JST 2017


Kouhei Sutou	2017-05-25 10:56:07 +0900 (Thu, 25 May 2017)

  New Revision: 6f4acab12559ad71c5c8f21513dbfaf1a6062ae3
  https://github.com/groonga/groonga/commit/6f4acab12559ad71c5c8f21513dbfaf1a6062ae3

  Message:
    sharding: fix too big time
    
    max_day is over time.

  Added files:
    test/command/suite/sharding/logical_select/range/min_last_month_day_month_mix.expected
    test/command/suite/sharding/logical_select/range/min_last_month_day_month_mix.test
  Modified files:
    plugins/sharding/logical_enumerator.rb

  Modified: plugins/sharding/logical_enumerator.rb (+1 -1)
===================================================================
--- plugins/sharding/logical_enumerator.rb    2017-05-25 10:50:33 +0900 (cecceb3)
+++ plugins/sharding/logical_enumerator.rb    2017-05-25 10:56:07 +0900 (d05a220)
@@ -196,7 +196,7 @@ module Groonga
               Time.local(@year, @month + 1, 1)
             end
           else
-            Time.local(@year, @month, @max_day, 23, 59, 59, 999999)
+            Time.local(@year, @month, @max_day)
           end
         end
 

  Added: test/command/suite/sharding/logical_select/range/min_last_month_day_month_mix.expected (+113 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/range/min_last_month_day_month_mix.expected    2017-05-25 10:56:07 +0900 (f75ec21)
@@ -0,0 +1,113 @@
+plugin_register sharding
+[[0,0.0,0.0],true]
+table_create Logs_201512 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201512 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_201512 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Times_201512 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_201512 timestamp_index COLUMN_INDEX Logs_201512 timestamp
+[[0,0.0,0.0],true]
+table_create Logs_20151231 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_20151231 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_20151231 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Times_20151231 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_20151231 timestamp_index COLUMN_INDEX Logs_20151231 timestamp
+[[0,0.0,0.0],true]
+table_create Logs_201601 TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Logs_201601 timestamp COLUMN_SCALAR Time
+[[0,0.0,0.0],true]
+column_create Logs_201601 memo COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Times_201601 TABLE_PAT_KEY Time
+[[0,0.0,0.0],true]
+column_create Times_201601 timestamp_index COLUMN_INDEX Logs_201601 timestamp
+[[0,0.0,0.0],true]
+load --table Logs_201512
+[
+{
+  "timestamp": "2015-12-30 00:00:00",
+  "memo":      "2015-12-30 00:00:00"
+},
+{
+  "timestamp": "2015-12-30 23:59:59.999999",
+  "memo":      "2015-12-30 23:59:59.999999"
+}
+]
+[[0,0.0,0.0],2]
+load --table Logs_20151231
+[
+{
+  "timestamp": "2015-12-31 00:00:00",
+  "memo":      "2015-12-31 00:00:00"
+},
+{
+  "timestamp": "2015-12-31 23:59:59.999999",
+  "memo":      "2015-12-31 23:59:59.999999"
+}
+]
+[[0,0.0,0.0],2]
+load --table Logs_201601
+[
+{
+  "timestamp": "2016-01-01 00:00:00",
+  "memo":      "2016-01-01 00:00:00"
+}
+]
+[[0,0.0,0.0],1]
+logical_select Logs timestamp   --min "2015-12-30 23:59:59.999999"   --min_border "include"
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        4
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "memo",
+          "ShortText"
+        ],
+        [
+          "timestamp",
+          "Time"
+        ]
+      ],
+      [
+        2,
+        "2015-12-30 23:59:59.999999",
+        1451487599.999999
+      ],
+      [
+        1,
+        "2015-12-31 00:00:00",
+        1451487600.0
+      ],
+      [
+        2,
+        "2015-12-31 23:59:59.999999",
+        1451573999.999999
+      ],
+      [
+        1,
+        "2016-01-01 00:00:00",
+        1451574000.0
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/sharding/logical_select/range/min_last_month_day_month_mix.test (+57 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/sharding/logical_select/range/min_last_month_day_month_mix.test    2017-05-25 10:56:07 +0900 (4864e53)
@@ -0,0 +1,57 @@
+#@on-error omit
+plugin_register sharding
+#@on-error default
+
+table_create Logs_201512 TABLE_NO_KEY
+column_create Logs_201512 timestamp COLUMN_SCALAR Time
+column_create Logs_201512 memo COLUMN_SCALAR ShortText
+table_create Times_201512 TABLE_PAT_KEY Time
+column_create Times_201512 timestamp_index COLUMN_INDEX Logs_201512 timestamp
+
+table_create Logs_20151231 TABLE_NO_KEY
+column_create Logs_20151231 timestamp COLUMN_SCALAR Time
+column_create Logs_20151231 memo COLUMN_SCALAR ShortText
+table_create Times_20151231 TABLE_PAT_KEY Time
+column_create Times_20151231 timestamp_index COLUMN_INDEX Logs_20151231 timestamp
+
+table_create Logs_201601 TABLE_NO_KEY
+column_create Logs_201601 timestamp COLUMN_SCALAR Time
+column_create Logs_201601 memo COLUMN_SCALAR ShortText
+table_create Times_201601 TABLE_PAT_KEY Time
+column_create Times_201601 timestamp_index COLUMN_INDEX Logs_201601 timestamp
+
+load --table Logs_201512
+[
+{
+  "timestamp": "2015-12-30 00:00:00",
+  "memo":      "2015-12-30 00:00:00"
+},
+{
+  "timestamp": "2015-12-30 23:59:59.999999",
+  "memo":      "2015-12-30 23:59:59.999999"
+}
+]
+
+load --table Logs_20151231
+[
+{
+  "timestamp": "2015-12-31 00:00:00",
+  "memo":      "2015-12-31 00:00:00"
+},
+{
+  "timestamp": "2015-12-31 23:59:59.999999",
+  "memo":      "2015-12-31 23:59:59.999999"
+}
+]
+
+load --table Logs_201601
+[
+{
+  "timestamp": "2016-01-01 00:00:00",
+  "memo":      "2016-01-01 00:00:00"
+}
+]
+
+logical_select Logs timestamp \
+  --min "2015-12-30 23:59:59.999999" \
+  --min_border "include"
-------------- next part --------------
HTML����������������������������...
Télécharger 



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