null+****@clear*****
null+****@clear*****
2011年 9月 24日 (土) 21:44:15 JST
Kouhei Sutou 2011-09-24 12:44:15 +0000 (Sat, 24 Sep 2011) New Revision: be3db66322588c9945c9fca634ff71f669c80d48 Log: [storage] warn unsupported spatial index search. Modified files: ha_mroonga.cc ha_mroonga.h Modified: ha_mroonga.cc (+23 -15) =================================================================== --- ha_mroonga.cc 2011-09-24 12:43:31 +0000 (aaba47a) +++ ha_mroonga.cc 2011-09-24 12:44:15 +0000 (df02b12) @@ -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); } @@ -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(); Modified: ha_mroonga.h (+1 -0) =================================================================== --- ha_mroonga.h 2011-09-24 12:43:31 +0000 (4d68a80) +++ ha_mroonga.h 2011-09-24 12:44:15 +0000 (8041ca2) @@ -323,6 +323,7 @@ protected: #endif private: + void push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag); void clear_cursor(); int storage_get_next_record(uchar *buf);