Navigation Menu

Skip to content

Commit

Permalink
storage: ignore NULL geometry value on write
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 4, 2014
1 parent 9f60e6c commit 614c2be
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ha_mroonga.cpp
Expand Up @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit 614c2be

Please sign in to comment.