~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_rnext_same.cc

pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
macros.
Add PANDORA_DRIZZLE_BUILD to run the extra checks that drizzle needs that 
plugins would also need to run so we can just use that macro in generated
external plugin builds.
Added support to register_plugins for external plugin building.
Renamed register_plugins.py to pandora-plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "myisamdef.h"
 
16
#include "myisam_priv.h"
17
17
 
18
18
        /*
19
19
           Read next row with the same key as previous read, but abort if
23
23
           based on the position of the last used key!
24
24
        */
25
25
 
26
 
int mi_rnext_same(MI_INFO *info, uchar *buf)
 
26
int mi_rnext_same(MI_INFO *info, unsigned char *buf)
27
27
{
28
28
  int error;
29
 
  uint inx,not_used[2];
 
29
  uint32_t inx,not_used[2];
30
30
  MI_KEYDEF *keyinfo;
31
31
 
32
32
  if ((int) (inx=info->lastinx) < 0 || info->lastpos == HA_OFFSET_ERROR)
36
36
    return(my_errno);
37
37
 
38
38
  if (info->s->concurrent_insert)
39
 
    rw_rdlock(&info->s->key_root_lock[inx]);
 
39
    pthread_rwlock_rdlock(&info->s->key_root_lock[inx]);
40
40
 
41
41
  switch (keyinfo->key_alg)
42
42
  {
62
62
          break;
63
63
        }
64
64
        /* Skip rows that are inserted by other threads since we got a lock */
65
 
        if (info->lastpos < info->state->data_file_length && 
 
65
        if (info->lastpos < info->state->data_file_length &&
66
66
            (!info->index_cond_func || mi_check_index_cond(info, inx, buf)))
67
67
          break;
68
68
      }
69
69
  }
70
70
  if (info->s->concurrent_insert)
71
 
    rw_unlock(&info->s->key_root_lock[inx]);
 
71
    pthread_rwlock_unlock(&info->s->key_root_lock[inx]);
72
72
        /* Don't clear if database-changed */
73
73
  info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
74
74
  info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME;