Kouhei Sutou
null+****@clear*****
Fri May 8 15:14:37 JST 2015
Kouhei Sutou 2015-05-08 15:14:37 +0900 (Fri, 08 May 2015) New Revision: f85d157af53702725c5ba3ab085896dc685f5ca3 https://github.com/groonga/groonga/commit/f85d157af53702725c5ba3ab085896dc685f5ca3 Message: Ignore no keys labeled drilldown Added files: test/command/suite/select/drilldown/labeled/keys/empty.expected test/command/suite/select/drilldown/labeled/keys/empty.test Modified files: lib/db.c Modified: lib/db.c (+5 -0) =================================================================== --- lib/db.c 2015-05-08 14:23:28 +0900 (fc0492a) +++ lib/db.c 2015-05-08 15:14:37 +0900 (f6c18b2) @@ -11315,6 +11315,11 @@ grn_table_sort_key_from_str(grn_ctx *ctx, const char *str, unsigned int str_size const char *p = str; const char **tokbuf; grn_table_sort_key *keys = NULL, *k = NULL; + + if (str_size == 0) { + return NULL; + } + if ((keys = grn_table_sort_key_from_str_geo(ctx, str, str_size, table, nkeys))) { return keys; } Added: test/command/suite/select/drilldown/labeled/keys/empty.expected (+16 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/keys/empty.expected 2015-05-08 15:14:37 +0900 (49c8db5) @@ -0,0 +1,16 @@ +table_create Tags TABLE_PAT_KEY ShortText +[[0,0.0,0.0],true] +table_create Memos TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Memos tag COLUMN_SCALAR Tags +[[0,0.0,0.0],true] +load --table Memos +[ +{"_key": "Groonga is fast!", "tag": "Groonga"}, +{"_key": "Mroonga is fast!", "tag": "Mroonga"}, +{"_key": "Groonga sticker!", "tag": "Groonga"}, +{"_key": "Rroonga is fast!", "tag": "Rroonga"} +] +[[0,0.0,0.0],4] +select Memos --limit 0 --drilldown[tag].keys '' +[[0,0.0,0.0],[[[4],[["_id","UInt32"],["_key","ShortText"],["tag","Tags"]]],{}]] Added: test/command/suite/select/drilldown/labeled/keys/empty.test (+14 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/select/drilldown/labeled/keys/empty.test 2015-05-08 15:14:37 +0900 (ba2d0de) @@ -0,0 +1,14 @@ +table_create Tags TABLE_PAT_KEY ShortText + +table_create Memos TABLE_HASH_KEY ShortText +column_create Memos tag COLUMN_SCALAR Tags + +load --table Memos +[ +{"_key": "Groonga is fast!", "tag": "Groonga"}, +{"_key": "Mroonga is fast!", "tag": "Mroonga"}, +{"_key": "Groonga sticker!", "tag": "Groonga"}, +{"_key": "Rroonga is fast!", "tag": "Rroonga"} +] + +select Memos --limit 0 --drilldown[tag].keys '' -------------- next part -------------- HTML����������������������������... 다운로드