Kouhei Sutou
null+****@clear*****
Mon Apr 10 16:15:51 JST 2017
Kouhei Sutou 2017-04-10 16:15:51 +0900 (Mon, 10 Apr 2017) New Revision: 82a392ee6a21e70c46ac27a1e0c79a42a16cde41 https://github.com/groonga/groonga/commit/82a392ee6a21e70c46ac27a1e0c79a42a16cde41 Message: logical_select: fix a bug that dynamic columns aren't created It's occurred when no match case. Added files: test/command/suite/sharding/logical_select/columns/stage/initial/no_records.expected test/command/suite/sharding/logical_select/columns/stage/initial/no_records.test Modified files: plugins/sharding/logical_select.rb Modified: plugins/sharding/logical_select.rb (+6 -0) =================================================================== --- plugins/sharding/logical_select.rb 2017-04-10 14:51:17 +0900 (262732a) +++ plugins/sharding/logical_select.rb 2017-04-10 16:15:51 +0900 (dbe4144) @@ -728,6 +728,12 @@ module Groonga if****@conte*****_sets.empty? result_set = HashTable.create(:flags => ObjectFlags::WITH_SUBREC, :key_type => first_shard.table) + @context.dynamic_columns.each_initial do |dynamic_column| + dynamic_column.apply(result_set) + end + @context.dynamic_columns.each_filtered do |dynamic_column| + dynamic_column.apply(result_set) + end @context.result_sets << result_set end end Added: test/command/suite/sharding/logical_select/columns/stage/initial/no_records.expected (+14 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_select/columns/stage/initial/no_records.expected 2017-04-10 16:15:51 +0900 (ded4b6d) @@ -0,0 +1,14 @@ +plugin_register sharding +[[0,0.0,0.0],true] +table_create Logs_20170315 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20170315 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20170315 price COLUMN_SCALAR UInt32 +[[0,0.0,0.0],true] +load --table Logs_20170315 +[ +] +[[0,0.0,0.0],0] +logical_select Logs --shard_key timestamp --columns[price_with_tax].stage initial --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --output_columns price,price_with_tax +[[0,0.0,0.0],[[[0],[["price","UInt32"],["price_with_tax","UInt32"]]]]] Added: test/command/suite/sharding/logical_select/columns/stage/initial/no_records.test (+19 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_select/columns/stage/initial/no_records.test 2017-04-10 16:15:51 +0900 (d80d562) @@ -0,0 +1,19 @@ +#@on-error omit +plugin_register sharding +#@on-error default + +table_create Logs_20170315 TABLE_NO_KEY +column_create Logs_20170315 timestamp COLUMN_SCALAR Time +column_create Logs_20170315 price COLUMN_SCALAR UInt32 + +load --table Logs_20170315 +[ +] + +logical_select Logs \ + --shard_key timestamp \ + --columns[price_with_tax].stage initial \ + --columns[price_with_tax].type UInt32 \ + --columns[price_with_tax].flags COLUMN_SCALAR \ + --columns[price_with_tax].value 'price * 1.08' \ + --output_columns price,price_with_tax -------------- next part -------------- HTML����������������������������...下載