~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_range.c

  • Committer: Brian Aker
  • Date: 2009-02-10 00:14:40 UTC
  • Revision ID: brian@tangent.org-20090210001440-qjg8eofh3h93064b
Adding Multi-threaded Scheduler into the system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/*
17
17
  Gives a approximated number of how many records there is between two keys.
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
/*
56
54
  if (fast_mi_readinfo(info))
57
55
    return(HA_POS_ERROR);
58
56
  info->update&= (HA_STATE_CHANGED+HA_STATE_ROW_CHANGED);
 
57
  if (info->s->concurrent_insert)
 
58
    pthread_rwlock_rdlock(&info->s->key_root_lock[inx]);
59
59
 
60
60
  switch(info->s->keyinfo[inx].key_alg){
61
61
  case HA_KEY_ALG_BTREE:
72
72
      res=HA_POS_ERROR;
73
73
  }
74
74
 
 
75
  if (info->s->concurrent_insert)
 
76
    pthread_rwlock_unlock(&info->s->key_root_lock[inx]);
75
77
  fast_mi_writeinfo(info);
76
78
 
77
79
  return(res);
149
151
static double _mi_search_pos(register MI_INFO *info,
150
152
                             register MI_KEYDEF *keyinfo,
151
153
                             unsigned char *key, uint32_t key_len, uint32_t nextflag,
152
 
                             register internal::my_off_t pos)
 
154
                             register my_off_t pos)
153
155
{
154
156
  int flag;
155
157
  uint32_t nod_flag, keynr, max_keynr= 0;