[Groonga-commit] groonga/groonga [master] Report error for Bool -> WGS84GeoPoint cast

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Wed Feb 13 23:50:19 JST 2013


Kouhei Sutou	2013-02-13 23:50:19 +0900 (Wed, 13 Feb 2013)

  New Revision: 75a25c5b1e0b4b02de2a4e4e32cad079949b7d65
  https://github.com/groonga/groonga/commit/75a25c5b1e0b4b02de2a4e4e32cad079949b7d65

  Log:
    Report error for Bool -> WGS84GeoPoint cast

  Added files:
    test/command/suite/load/bool/cast/wgs84_geo_point.expected
    test/command/suite/load/bool/cast/wgs84_geo_point.test
  Modified files:
    lib/db.c

  Modified: lib/db.c (+1 -0)
===================================================================
--- lib/db.c    2013-02-13 23:48:42 +0900 (af55ece)
+++ lib/db.c    2013-02-13 23:50:19 +0900 (8ea0fca)
@@ -4252,6 +4252,7 @@ grn_obj_cast_bool(grn_ctx *ctx, grn_obj *src, grn_obj *dest, grn_bool addp)
     }
     break;
   case GRN_DB_TOKYO_GEO_POINT :
+  case GRN_DB_WGS84_GEO_POINT :
     rc = GRN_INVALID_ARGUMENT;
     break;
   default :

  Added: test/command/suite/load/bool/cast/wgs84_geo_point.expected (+53 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/load/bool/cast/wgs84_geo_point.expected    2013-02-13 23:50:19 +0900 (b2f7926)
@@ -0,0 +1,53 @@
+table_create  Entries          TABLE_HASH_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Entries location COLUMN_SCALAR  WGS84GeoPoint
+[[0,0.0,0.0],true]
+load --table Entries
+[
+{"_key": "Special news!",  "location": true},
+{"_key": "Surprise news!", "location": false}
+]
+[[0,0.0,0.0],2]
+#|e| <Entries.location>: failed to cast to <WGS84GeoPoint>: <true>
+#|e| [table][load] failed to set column value: <Entries.location>: failed to cast to <WGS84GeoPoint>: <true>: key: <"Special news!">, column: <location>, value: <true>
+#|e| <Entries.location>: failed to cast to <WGS84GeoPoint>: <false>
+#|e| [table][load] failed to set column value: <Entries.location>: failed to cast to <WGS84GeoPoint>: <false>: key: <"Surprise news!">, column: <location>, value: <false>
+select Entries
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        2
+      ],
+      [
+        [
+          "_id",
+          "UInt32"
+        ],
+        [
+          "_key",
+          "ShortText"
+        ],
+        [
+          "location",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        1,
+        "Special news!",
+        "0x0"
+      ],
+      [
+        2,
+        "Surprise news!",
+        "0x0"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/load/bool/cast/wgs84_geo_point.test (+10 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/load/bool/cast/wgs84_geo_point.test    2013-02-13 23:50:19 +0900 (471ba0c)
@@ -0,0 +1,10 @@
+table_create  Entries          TABLE_HASH_KEY ShortText
+column_create Entries location COLUMN_SCALAR  WGS84GeoPoint
+
+load --table Entries
+[
+{"_key": "Special news!",  "location": true},
+{"_key": "Surprise news!", "location": false}
+]
+
+select Entries
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index