Kouhei Sutou
null+****@clear*****
Wed Feb 13 23:42:44 JST 2013
Kouhei Sutou 2013-02-13 23:42:44 +0900 (Wed, 13 Feb 2013) New Revision: d633cfa9e2f6ade089ccacfe2d451544e7338f88 https://github.com/groonga/groonga/commit/d633cfa9e2f6ade089ccacfe2d451544e7338f88 Log: Support Bool -> LongText cast Added files: test/command/suite/load/bool/cast/long_text.expected test/command/suite/load/bool/cast/long_text.test Modified files: lib/db.c Modified: lib/db.c (+1 -0) =================================================================== --- lib/db.c 2013-02-13 23:41:39 +0900 (d27376e) +++ lib/db.c 2013-02-13 23:42:44 +0900 (71dfddd) @@ -4244,6 +4244,7 @@ grn_obj_cast_bool(grn_ctx *ctx, grn_obj *src, grn_obj *dest, grn_bool addp) break; case GRN_DB_SHORT_TEXT : case GRN_DB_TEXT : + case GRN_DB_LONG_TEXT : { const char *bool_text; bool_text = GRN_BOOL_VALUE(src) ? "true" : "false"; Added: test/command/suite/load/bool/cast/long_text.expected (+49 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/load/bool/cast/long_text.expected 2013-02-13 23:42:44 +0900 (77647ce) @@ -0,0 +1,49 @@ +table_create Entries TABLE_HASH_KEY ShortText +[[0,0.0,0.0],true] +column_create Entries published COLUMN_SCALAR LongText +[[0,0.0,0.0],true] +load --table Entries +[ +{"_key": "Special news!", "published": true}, +{"_key": "Surprise news!", "published": false} +] +[[0,0.0,0.0],2] +select Entries +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 2 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "ShortText" + ], + [ + "published", + "LongText" + ] + ], + [ + 1, + "Special news!", + "true" + ], + [ + 2, + "Surprise news!", + "false" + ] + ] + ] +] Added: test/command/suite/load/bool/cast/long_text.test (+10 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/load/bool/cast/long_text.test 2013-02-13 23:42:44 +0900 (0bf63de) @@ -0,0 +1,10 @@ +table_create Entries TABLE_HASH_KEY ShortText +column_create Entries published COLUMN_SCALAR LongText + +load --table Entries +[ +{"_key": "Special news!", "published": true}, +{"_key": "Surprise news!", "published": false} +] + +select Entries -------------- next part -------------- HTML����������������������������...Download