[Groonga-mysql-commit] mroonga/mroonga at 9a76292 [master] storage: support HA_READ_PREFIX_LAST in index_read_map()

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 20 18:30:35 JST 2015


Kouhei Sutou	2015-07-20 18:30:35 +0900 (Mon, 20 Jul 2015)

  New Revision: 9a76292b59d940fa4b687206f4a66ce47ef918d3
  https://github.com/mroonga/mroonga/commit/9a76292b59d940fa4b687206f4a66ce47ef918d3

  Message:
    storage: support HA_READ_PREFIX_LAST in index_read_map()
    
    The pattern is used instead of calling index_read_last_map() on MariaDB.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+4 -0)
===================================================================
--- ha_mroonga.cpp    2015-07-20 17:47:38 +0900 (6dda5b5)
+++ ha_mroonga.cpp    2015-07-20 18:30:35 +0900 (3e60899)
@@ -6975,6 +6975,7 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key,
 
   switch (find_flag) {
   case HA_READ_BEFORE_KEY:
+  case HA_READ_PREFIX_LAST:
     flags |= GRN_CURSOR_LT | GRN_CURSOR_DESCENDING;
     break;
   case HA_READ_PREFIX_LAST_OR_PREV:
@@ -7005,6 +7006,7 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key,
                 key_length, key_info->key_length));
     if (key_length == key_info->key_length) {
       if (find_flag == HA_READ_BEFORE_KEY ||
+          find_flag == HA_READ_PREFIX_LAST ||
           find_flag == HA_READ_PREFIX_LAST_OR_PREV) {
         key_max = key_max_entity;
         storage_encode_multiple_column_key(key_info,
@@ -7046,6 +7048,7 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key,
                                                  key_max, &size_max,
                                                  NULL, NULL);
         break;
+      case HA_READ_PREFIX_LAST:
       case HA_READ_PREFIX_LAST_OR_PREV:
         if (prev_key) {
           flags |= GRN_CURSOR_GE;
@@ -7145,6 +7148,7 @@ int ha_mroonga::storage_index_read_map(uchar *buf, const uchar *key,
         }
       }
     } else if (find_flag == HA_READ_BEFORE_KEY ||
+               find_flag == HA_READ_PREFIX_LAST ||
                find_flag == HA_READ_PREFIX_LAST_OR_PREV) {
       key_max = key_max_entity;
       storage_encode_key(field, key, key_max_entity, &size_max);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index