Kouhei Sutou
null+****@clear*****
Mon Feb 19 23:25:25 JST 2018
Kouhei Sutou 2018-02-19 23:25:25 +0900 (Mon, 19 Feb 2018) New Revision: e296c85093131c04f4bbdabc81bf9de21a24527b https://github.com/groonga/groonga/commit/e296c85093131c04f4bbdabc81bf9de21a24527b Message: logical_select: fix a bug that wrong cache is used If there is only "drilldowns[LABEL].table" difference between 2 queries, latter query uses wrong cache. Modified files: plugins/sharding/logical_select.rb test/command/suite/sharding/logical_select/cache/drilldowns/table.expected test/command/suite/sharding/logical_select/cache/drilldowns/table.test Modified: plugins/sharding/logical_select.rb (+1 -0) =================================================================== --- plugins/sharding/logical_select.rb 2018-02-19 23:19:16 +0900 (30f95cf89) +++ plugins/sharding/logical_select.rb 2018-02-19 23:25:25 +0900 (3d57010dd) @@ -92,6 +92,7 @@ module Groonga labeled_drilldowns = LabeledDrilldowns.parse(input).sort_by(&:label) labeled_drilldowns.each do |drilldown| key << "#{drilldown.label}\0" + key << "#{drilldown.table}\0" key << "#{drilldown.keys.join(',')}\0" key << "#{drilldown.output_columns}\0" key << "#{drilldown.offset}\0" Modified: test/command/suite/sharding/logical_select/cache/drilldowns/table.expected (+22 -0) =================================================================== --- test/command/suite/sharding/logical_select/cache/drilldowns/table.expected 2018-02-19 23:19:16 +0900 (7b26dd2b9) +++ test/command/suite/sharding/logical_select/cache/drilldowns/table.expected 2018-02-19 23:25:25 +0900 (dc846513b) @@ -154,6 +154,17 @@ logical_select Logs --shard_key timestamp --limit 0 --output_columns _id } ] ] +#>logical_select --drilldowns[action].keys "_key" --drilldowns[action].table "restart" --drilldowns[restart].filter "_key @ 'Restart'" --drilldowns[restart].keys "action" --drilldowns[restart].output_columns "_key" --drilldowns[restart].stage "initial" --drilldowns[start].filter "_key @ 'Start'" --drilldowns[start].keys "action" --drilldowns[start].output_columns "_key" --drilldowns[start].stage "initial" --limit "0" --logical_table "Logs" --output_columns "_id" --shard_key "timestamp" +#:000000000000000 select(2)[Logs_20150203] +#:000000000000000 select(3)[Logs_20150204] +#:000000000000000 select(4)[Logs_20150205] +#:000000000000000 filter(1) +#:000000000000000 filter(2) +#:000000000000000 output(0) +#:000000000000000 output.drilldowns(1) +#:000000000000000 output.drilldowns(1) +#:000000000000000 output.drilldowns(2) +#<000000000000000 rc=0 logical_select Logs --shard_key timestamp --limit 0 --output_columns _id --drilldowns[action].table start --drilldowns[action].keys _key --drilldowns[restart].stage initial --drilldowns[restart].keys 'action' --drilldowns[restart].filter "_key @ 'Restart'" --drilldowns[restart].output_columns _key --drilldowns[start].stage initial --drilldowns[start].keys 'action' --drilldowns[start].filter "_key @ 'Start'" --drilldowns[start].output_columns _key [ [ @@ -231,3 +242,14 @@ logical_select Logs --shard_key timestamp --limit 0 --output_columns _id } ] ] +#>logical_select --drilldowns[action].keys "_key" --drilldowns[action].table "start" --drilldowns[restart].filter "_key @ 'Restart'" --drilldowns[restart].keys "action" --drilldowns[restart].output_columns "_key" --drilldowns[restart].stage "initial" --drilldowns[start].filter "_key @ 'Start'" --drilldowns[start].keys "action" --drilldowns[start].output_columns "_key" --drilldowns[start].stage "initial" --limit "0" --logical_table "Logs" --output_columns "_id" --shard_key "timestamp" +#:000000000000000 select(2)[Logs_20150203] +#:000000000000000 select(3)[Logs_20150204] +#:000000000000000 select(4)[Logs_20150205] +#:000000000000000 filter(2) +#:000000000000000 filter(1) +#:000000000000000 output(0) +#:000000000000000 output.drilldowns(2) +#:000000000000000 output.drilldowns(1) +#:000000000000000 output.drilldowns(2) +#<000000000000000 rc=0 Modified: test/command/suite/sharding/logical_select/cache/drilldowns/table.test (+4 -0) =================================================================== --- test/command/suite/sharding/logical_select/cache/drilldowns/table.test 2018-02-19 23:19:16 +0900 (b0e7dfac0) +++ test/command/suite/sharding/logical_select/cache/drilldowns/table.test 2018-02-19 23:25:25 +0900 (c01081d69) @@ -74,6 +74,9 @@ load --table Logs_20150205 } ] +#@sleep 1 + +#@collect-query-log true logical_select Logs \ --shard_key timestamp \ --limit 0 \ @@ -103,3 +106,4 @@ logical_select Logs \ --drilldowns[start].keys 'action' \ --drilldowns[start].filter "_key @ 'Start'" \ --drilldowns[start].output_columns _key +#@collect-query-log false -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180219/7b8fdf6b/attachment-0001.htm