~jaypipes/drizzle/item-class-file-reorg

« back to all changes in this revision

Viewing changes to storage/myisam/mi_range.c

Merging trunk changes from over weekend.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
#include "myisamdef.h"
22
 
#include "rt_index.h"
23
22
 
24
23
static ha_rows _mi_record_pos(MI_INFO *, const uchar *, key_part_map,
25
24
                              enum ha_rkey_function);
60
59
    rw_rdlock(&info->s->key_root_lock[inx]);
61
60
 
62
61
  switch(info->s->keyinfo[inx].key_alg){
63
 
#ifdef HAVE_RTREE_KEYS
64
 
  case HA_KEY_ALG_RTREE:
65
 
  {
66
 
    uchar * key_buff;
67
 
    uint start_key_len;
68
 
 
69
 
    /*
70
 
      The problem is that the optimizer doesn't support
71
 
      RTree keys properly at the moment.
72
 
      Hope this will be fixed some day.
73
 
      But now NULL in the min_key means that we
74
 
      didn't make the task for the RTree key
75
 
      and expect BTree functionality from it.
76
 
      As it's not able to handle such request
77
 
      we return the error.
78
 
    */
79
 
    if (!min_key)
80
 
    {
81
 
      res= HA_POS_ERROR;
82
 
      break;
83
 
    }
84
 
    key_buff= info->lastkey+info->s->base.max_key_length;
85
 
    start_key_len= _mi_pack_key(info,inx, key_buff,
86
 
                                (uchar*) min_key->key, min_key->keypart_map,
87
 
                                (HA_KEYSEG**) 0);
88
 
    res= rtree_estimate(info, inx, key_buff, start_key_len,
89
 
                        myisam_read_vec[min_key->flag]);
90
 
    res= res ? res : 1;                       /* Don't return 0 */
91
 
    break;
92
 
  }
93
 
#endif
94
62
  case HA_KEY_ALG_BTREE:
95
63
  default:
96
64
    start_pos= (min_key ?  _mi_record_pos(info, min_key->key,