~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_range.c

code clean move Item_func_abs, Item_func_int_exp, Item_func_ln, Item_func_log to functions directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
  Used when optimizing querries.
19
19
 */
20
20
 
21
 
#include "myisam_priv.h"
22
 
 
23
 
using namespace drizzled;
 
21
#include "myisamdef.h"
24
22
 
25
23
static ha_rows _mi_record_pos(MI_INFO *, const unsigned char *, key_part_map,
26
24
                              enum ha_rkey_function);
27
 
static double _mi_search_pos(MI_INFO *,MI_KEYDEF *,unsigned char *, uint,uint,internal::my_off_t);
 
25
static double _mi_search_pos(MI_INFO *,MI_KEYDEF *,unsigned char *, uint,uint,my_off_t);
28
26
static uint32_t _mi_keynr(MI_INFO *info,MI_KEYDEF *,unsigned char *, unsigned char *,uint32_t *);
29
27
 
30
28
/*
44
42
    HA_POS_ERROR  error (or we can't estimate number of rows)
45
43
    number        Estimated number of rows
46
44
*/
47
 
 
 
45
  
48
46
ha_rows mi_records_in_range(MI_INFO *info, int inx,
49
47
                            key_range *min_key, key_range *max_key)
50
48
{
57
55
    return(HA_POS_ERROR);
58
56
  info->update&= (HA_STATE_CHANGED+HA_STATE_ROW_CHANGED);
59
57
  if (info->s->concurrent_insert)
60
 
    pthread_rwlock_rdlock(&info->s->key_root_lock[inx]);
 
58
    rw_rdlock(&info->s->key_root_lock[inx]);
61
59
 
62
60
  switch(info->s->keyinfo[inx].key_alg){
63
61
  case HA_KEY_ALG_BTREE:
75
73
  }
76
74
 
77
75
  if (info->s->concurrent_insert)
78
 
    pthread_rwlock_unlock(&info->s->key_root_lock[inx]);
 
76
    rw_unlock(&info->s->key_root_lock[inx]);
79
77
  fast_mi_writeinfo(info);
80
78
 
81
79
  return(res);
153
151
static double _mi_search_pos(register MI_INFO *info,
154
152
                             register MI_KEYDEF *keyinfo,
155
153
                             unsigned char *key, uint32_t key_len, uint32_t nextflag,
156
 
                             register internal::my_off_t pos)
 
154
                             register my_off_t pos)
157
155
{
158
156
  int flag;
159
157
  uint32_t nod_flag, keynr, max_keynr= 0;