Navigation Menu

Skip to content

Commit

Permalink
[storage] warn unsupported spatial index search.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 24, 2011
1 parent d4ce43e commit be3db66
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
38 changes: 23 additions & 15 deletions ha_mroonga.cc
Expand Up @@ -3950,21 +3950,7 @@ ha_rows ha_mroonga::storage_records_in_range_geo(uint key_nr,
DBUG_RETURN(HA_POS_ERROR);
}
if (!(range_min->flag & HA_READ_MBR_CONTAIN)) {
char search_name[MRN_BUFFER_SIZE];
if (range_min->flag & HA_READ_MBR_INTERSECT) {
strcpy(search_name, "intersect");
} else if (range_min->flag & HA_READ_MBR_WITHIN) {
strcpy(search_name, "within");
} else if (range_min->flag & HA_READ_MBR_DISJOINT) {
strcpy(search_name, "disjoint");
} else if (range_min->flag & HA_READ_MBR_EQUAL) {
strcpy(search_name, "equal");
} else {
sprintf(search_name, "unknown: %d", range_min->flag);
}
DBUG_PRINT("info",
("spatial index search "
"except MBRContains aren't supported: <%s>"));
push_warning_unsupported_spatial_index_search(range_min->flag);
row_count = grn_table_size(ctx, grn_table);
DBUG_RETURN(row_count);
}
Expand Down Expand Up @@ -5160,6 +5146,28 @@ bool ha_mroonga::get_error_message(int error, String *buf)
DBUG_RETURN(success);
}

void ha_mroonga::push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag)
{
char search_name[MRN_BUFFER_SIZE];
if (flag == HA_READ_MBR_INTERSECT) {
strcpy(search_name, "intersect");
} else if (flag == HA_READ_MBR_WITHIN) {
strcpy(search_name, "within");
} else if (flag & HA_READ_MBR_DISJOINT) {
strcpy(search_name, "disjoint");
} else if (flag & HA_READ_MBR_EQUAL) {
strcpy(search_name, "equal");
} else {
sprintf(search_name, "unknown: %d", flag);
}
push_warning_printf(ha_thd(),
MYSQL_ERROR::WARN_LEVEL_WARN,
ER_UNSUPPORTED_EXTENSION,
"spatial index search "
"except MBRContains aren't supported: <%s>",
search_name);
}

void ha_mroonga::clear_cursor()
{
MRN_DBUG_ENTER_METHOD();
Expand Down
1 change: 1 addition & 0 deletions ha_mroonga.h
Expand Up @@ -323,6 +323,7 @@ class ha_mroonga: public handler
#endif

private:
void push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag);
void clear_cursor();
int storage_get_next_record(uchar *buf);

Expand Down

0 comments on commit be3db66

Please sign in to comment.