Kouhei Sutou
null+****@clear*****
Tue Feb 4 12:21:53 JST 2014
Kouhei Sutou 2014-02-04 12:21:53 +0900 (Tue, 04 Feb 2014) New Revision: 614c2be4d1e8e79de49e9cf94ba7382aa7ac3e1a https://github.com/mroonga/mroonga/commit/614c2be4d1e8e79de49e9cf94ba7382aa7ac3e1a Message: storage: ignore NULL geometry value on write Modified files: ha_mroonga.cpp Modified: ha_mroonga.cpp (+16 -2) =================================================================== --- ha_mroonga.cpp 2014-02-04 12:09:48 +0900 (4fb4293) +++ ha_mroonga.cpp 2014-02-04 12:21:53 +0900 (46ec30a) @@ -5247,7 +5247,17 @@ int ha_mroonga::storage_write_row(uchar *buf) Field *field = table->field[i]; const char *column_name = field->field_name; - if (field->is_null()) continue; + if (field->is_null()) + continue; + +#ifdef HAVE_SPATIAL + bool is_null_geometry_value = + field->real_type() == MYSQL_TYPE_GEOMETRY && + static_cast<Field_geom *>(field)->get_length() == 0; + if (is_null_geometry_value) { + continue; + } +#endif if (strcmp(MRN_COLUMN_NAME_ID, column_name) == 0) { continue; @@ -5258,7 +5268,11 @@ int ha_mroonga::storage_write_row(uchar *buf) grn_obj_unlink(ctx, &colbuf); goto err2; } - generic_store_bulk(field, &colbuf); + error = generic_store_bulk(field, &colbuf); + if (error) { + grn_obj_unlink(ctx, &colbuf); + goto err2; + } if (added && is_grn_zero_column_value(grn_columns[i], &colbuf)) { // WORKAROUND: groonga can't index newly added '0' value for // fix size column. So we add non-'0' value first then add -------------- next part -------------- HTML����������������������������... 다운로드