Kouhei Sutou
null+****@clear*****
Thu Jan 24 12:32:27 JST 2013
Kouhei Sutou 2013-01-24 12:32:27 +0900 (Thu, 24 Jan 2013) New Revision: 92633e93c94c237e3d570023dd98fe6892f3a80e https://github.com/groonga/groonga/commit/92633e93c94c237e3d570023dd98fe6892f3a80e Log: test: add tests for nested range search with all other table types Added files: test/command/suite/select/index/nested/by_column/range/array.expected test/command/suite/select/index/nested/by_column/range/array.test test/command/suite/select/index/nested/by_column/range/double_array_trie.expected test/command/suite/select/index/nested/by_column/range/double_array_trie.test test/command/suite/select/index/nested/by_column/range/patricia_trie.expected test/command/suite/select/index/nested/by_column/range/patricia_trie.test Added: test/command/suite/select/index/nested/by_column/range/array.expected (+67 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/nested/by_column/range/array.expected 2013-01-24 12:32:27 +0900 (e013fa0) @@ -0,0 +1,67 @@ +table_create Users TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Users birthday COLUMN_SCALAR Time +[[0,0.0,0.0],true] +table_create Files TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Files owner COLUMN_SCALAR Users +[[0,0.0,0.0],true] +column_create Users files_owner_index COLUMN_INDEX Files owner +[[0,0.0,0.0],true] +table_create Birthdays TABLE_PAT_KEY Time +[[0,0.0,0.0],true] +column_create Birthdays users_birthday COLUMN_INDEX Users birthday +[[0,0.0,0.0],true] +load --table Users +[ +{"_key": "Alice", "birthday": "1992-02-09 00:00:00"}, +{"_key": "Bob", "birthday": "1988-01-04 00:00:00"}, +{"_key": "Carlos", "birthday": "1982-12-29 00:00:00"} +] +[[0,0.0,0.0],3] +load --table Files +[ +{"owner": "Alice"}, +{"owner": "Bob"}, +{"owner": "Carlos"} +] +[[0,0.0,0.0],3] +select Files --filter 'owner.birthday <= "1988-01-04 00:00:00"' --output_columns '_id, owner, owner.birthday' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "owner", + "Users" + ], + [ + "owner.birthday", + "Time" + ] + ], + [ + 3, + "Carlos", + 409935600.0 + ], + [ + 2, + "Bob", + 568220400.0 + ] + ] + ] +] Added: test/command/suite/select/index/nested/by_column/range/array.test (+28 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/nested/by_column/range/array.test 2013-01-24 12:32:27 +0900 (01ec4d6) @@ -0,0 +1,28 @@ +table_create Users TABLE_HASH_KEY ShortText +column_create Users birthday COLUMN_SCALAR Time + +table_create Files TABLE_NO_KEY +column_create Files owner COLUMN_SCALAR Users + +column_create Users files_owner_index COLUMN_INDEX Files owner + +table_create Birthdays TABLE_PAT_KEY Time +column_create Birthdays users_birthday COLUMN_INDEX Users birthday + +load --table Users +[ +{"_key": "Alice", "birthday": "1992-02-09 00:00:00"}, +{"_key": "Bob", "birthday": "1988-01-04 00:00:00"}, +{"_key": "Carlos", "birthday": "1982-12-29 00:00:00"} +] + +load --table Files +[ +{"owner": "Alice"}, +{"owner": "Bob"}, +{"owner": "Carlos"} +] + +select Files \ + --filter 'owner.birthday <= "1988-01-04 00:00:00"' \ + --output_columns '_id, owner, owner.birthday' Added: test/command/suite/select/index/nested/by_column/range/double_array_trie.expected (+67 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/nested/by_column/range/double_array_trie.expected 2013-01-24 12:32:27 +0900 (e1c636d) @@ -0,0 +1,67 @@ +table_create Users TABLE_DAT_KEY ShortText +[[0,0.0,0.0],true] +column_create Users birthday COLUMN_SCALAR Time +[[0,0.0,0.0],true] +table_create Files TABLE_DAT_KEY ShortText +[[0,0.0,0.0],true] +column_create Files owner COLUMN_SCALAR Users +[[0,0.0,0.0],true] +column_create Users files_owner_index COLUMN_INDEX Files owner +[[0,0.0,0.0],true] +table_create Birthdays TABLE_PAT_KEY Time +[[0,0.0,0.0],true] +column_create Birthdays users_birthday COLUMN_INDEX Users birthday +[[0,0.0,0.0],true] +load --table Users +[ +{"_key": "Alice", "birthday": "1992-02-09 00:00:00"}, +{"_key": "Bob", "birthday": "1988-01-04 00:00:00"}, +{"_key": "Carlos", "birthday": "1982-12-29 00:00:00"} +] +[[0,0.0,0.0],3] +load --table Files +[ +{"_key": "/home/alice/.zshrc", "owner": "Alice"}, +{"_key": "/home/bob/.bashrc", "owner": "Bob"}, +{"_key": "/home/calros/public_html/index.html", "owner": "Carlos"} +] +[[0,0.0,0.0],3] +select Files --filter 'owner.birthday <= "1988-01-04 00:00:00"' --output_columns '_key, owner, owner.birthday' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_key", + "ShortText" + ], + [ + "owner", + "Users" + ], + [ + "owner.birthday", + "Time" + ] + ], + [ + "/home/calros/public_html/index.html", + "Carlos", + 409935600.0 + ], + [ + "/home/bob/.bashrc", + "Bob", + 568220400.0 + ] + ] + ] +] Added: test/command/suite/select/index/nested/by_column/range/double_array_trie.test (+28 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/nested/by_column/range/double_array_trie.test 2013-01-24 12:32:27 +0900 (2e82df2) @@ -0,0 +1,28 @@ +table_create Users TABLE_DAT_KEY ShortText +column_create Users birthday COLUMN_SCALAR Time + +table_create Files TABLE_DAT_KEY ShortText +column_create Files owner COLUMN_SCALAR Users + +column_create Users files_owner_index COLUMN_INDEX Files owner + +table_create Birthdays TABLE_PAT_KEY Time +column_create Birthdays users_birthday COLUMN_INDEX Users birthday + +load --table Users +[ +{"_key": "Alice", "birthday": "1992-02-09 00:00:00"}, +{"_key": "Bob", "birthday": "1988-01-04 00:00:00"}, +{"_key": "Carlos", "birthday": "1982-12-29 00:00:00"} +] + +load --table Files +[ +{"_key": "/home/alice/.zshrc", "owner": "Alice"}, +{"_key": "/home/bob/.bashrc", "owner": "Bob"}, +{"_key": "/home/calros/public_html/index.html", "owner": "Carlos"} +] + +select Files \ + --filter 'owner.birthday <= "1988-01-04 00:00:00"' \ + --output_columns '_key, owner, owner.birthday' Added: test/command/suite/select/index/nested/by_column/range/patricia_trie.expected (+67 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/nested/by_column/range/patricia_trie.expected 2013-01-24 12:32:27 +0900 (17aee70) @@ -0,0 +1,67 @@ +table_create Users TABLE_PAT_KEY ShortText +[[0,0.0,0.0],true] +column_create Users birthday COLUMN_SCALAR Time +[[0,0.0,0.0],true] +table_create Files TABLE_PAT_KEY ShortText +[[0,0.0,0.0],true] +column_create Files owner COLUMN_SCALAR Users +[[0,0.0,0.0],true] +column_create Users files_owner_index COLUMN_INDEX Files owner +[[0,0.0,0.0],true] +table_create Birthdays TABLE_PAT_KEY Time +[[0,0.0,0.0],true] +column_create Birthdays users_birthday COLUMN_INDEX Users birthday +[[0,0.0,0.0],true] +load --table Users +[ +{"_key": "Alice", "birthday": "1992-02-09 00:00:00"}, +{"_key": "Bob", "birthday": "1988-01-04 00:00:00"}, +{"_key": "Carlos", "birthday": "1982-12-29 00:00:00"} +] +[[0,0.0,0.0],3] +load --table Files +[ +{"_key": "/home/alice/.zshrc", "owner": "Alice"}, +{"_key": "/home/bob/.bashrc", "owner": "Bob"}, +{"_key": "/home/calros/public_html/index.html", "owner": "Carlos"} +] +[[0,0.0,0.0],3] +select Files --filter 'owner.birthday <= "1988-01-04 00:00:00"' --output_columns '_key, owner, owner.birthday' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_key", + "ShortText" + ], + [ + "owner", + "Users" + ], + [ + "owner.birthday", + "Time" + ] + ], + [ + "/home/calros/public_html/index.html", + "Carlos", + 409935600.0 + ], + [ + "/home/bob/.bashrc", + "Bob", + 568220400.0 + ] + ] + ] +] Added: test/command/suite/select/index/nested/by_column/range/patricia_trie.test (+28 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/index/nested/by_column/range/patricia_trie.test 2013-01-24 12:32:27 +0900 (8ca4842) @@ -0,0 +1,28 @@ +table_create Users TABLE_PAT_KEY ShortText +column_create Users birthday COLUMN_SCALAR Time + +table_create Files TABLE_PAT_KEY ShortText +column_create Files owner COLUMN_SCALAR Users + +column_create Users files_owner_index COLUMN_INDEX Files owner + +table_create Birthdays TABLE_PAT_KEY Time +column_create Birthdays users_birthday COLUMN_INDEX Users birthday + +load --table Users +[ +{"_key": "Alice", "birthday": "1992-02-09 00:00:00"}, +{"_key": "Bob", "birthday": "1988-01-04 00:00:00"}, +{"_key": "Carlos", "birthday": "1982-12-29 00:00:00"} +] + +load --table Files +[ +{"_key": "/home/alice/.zshrc", "owner": "Alice"}, +{"_key": "/home/bob/.bashrc", "owner": "Bob"}, +{"_key": "/home/calros/public_html/index.html", "owner": "Carlos"} +] + +select Files \ + --filter 'owner.birthday <= "1988-01-04 00:00:00"' \ + --output_columns '_key, owner, owner.birthday' -------------- next part -------------- HTML����������������������������...다운로드