[Groonga-commit] groonga/groonga [master] don't restrict geo point separator character.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 6日 (火) 16:53:39 JST


Kouhei Sutou	2010-07-06 07:53:39 +0000 (Tue, 06 Jul 2010)

  New Revision: 3180c85bb7b00b52e312d13362f83ed1cb61104a

  Log:
    don't restrict geo point separator character.

  Modified files:
    lib/db.c
    test/unit/core/test-cast-basic.c

  Modified: lib/db.c (+1 -1)
===================================================================
--- lib/db.c    2010-07-06 06:13:37 +0000 (33a816f)
+++ lib/db.c    2010-07-06 07:53:39 +0000 (52985cb)
@@ -3773,7 +3773,7 @@ grn_obj_cast(grn_ctx *ctx, grn_obj *src, grn_obj *dest, int addp)
         const char *cur, *str = GRN_TEXT_VALUE(src);
         const char *str_end = GRN_BULK_CURR(src);
         latitude = grn_atoi(str, str_end, &cur);
-        if (cur[0] == 'x' && cur + 1 < str_end) {
+        if (cur + 1 < str_end) {
           longitude = grn_atoi(cur + 1, str_end, &cur);
           if (cur == str_end) {
             GRN_GEO_POINT_SET(ctx, dest, latitude, longitude);

  Modified: test/unit/core/test-cast-basic.c (+1 -0)
===================================================================
--- test/unit/core/test-cast-basic.c    2010-07-06 06:13:37 +0000 (4d4b935)
+++ test/unit/core/test-cast-basic.c    2010-07-06 07:53:39 +0000 (4cffaa6)
@@ -258,6 +258,7 @@ test_text_to_geo_point(void)
 void
 test_text_to_geo_point_invalid(void)
 {
+  cut_omit("any character is accepted as separator.");
   grn_obj_reinit(&context, &dest, GRN_DB_WGS84_GEO_POINT, 0);
   set_text("130194581?503802073");
   grn_test_assert_equal_rc(GRN_INVALID_ARGUMENT,




Groonga-commit メーリングリストの案内
Back to archive index