~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_locking.cc

Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
*/
22
22
 
23
23
#include "myisam_priv.h"
24
 
#include <mystrings/m_ctype.h>
25
 
#include <mysys/my_tree.h>
 
24
#include "drizzled/charset_info.h"
26
25
#include <drizzled/util/test.h>
27
26
 
28
27
using namespace std;
64
63
          !share->delay_key_write && flush_key_blocks(share->key_cache,
65
64
                                                      share->kfile,FLUSH_KEEP))
66
65
      {
67
 
        error=my_errno;
 
66
        error=errno;
68
67
        mi_print_error(info->s, HA_ERR_CRASHED);
69
68
        mi_mark_crashed(info);          /* Mark that table must be checked */
70
69
      }
72
71
      {
73
72
        if (end_io_cache(&info->rec_cache))
74
73
        {
75
 
          error=my_errno;
 
74
          error=errno;
76
75
          mi_print_error(info->s, HA_ERR_CRASHED);
77
76
          mi_mark_crashed(info);
78
77
        }
95
94
          share->state.unique=   info->last_unique=  info->this_unique;
96
95
          share->state.update_count= info->last_loop= ++info->this_loop;
97
96
          if (mi_state_info_write(share->kfile, &share->state, 1))
98
 
            error=my_errno;
 
97
            error=errno;
99
98
          share->changed=0;
100
99
          share->not_flushed=1;
101
100
          if (error)
143
142
        flag=1;
144
143
        if (mi_state_info_read_dsk(share->kfile, &share->state, 1))
145
144
        {
146
 
          error=my_errno;
 
145
          error=errno;
147
146
          break;
148
147
        }
149
148
        if (mi_state_info_read_dsk(share->kfile, &share->state, 1))
150
149
        {
151
 
          error=my_errno;
152
 
          my_errno=error;
 
150
          error=errno;
 
151
          errno=error;
153
152
          break;
154
153
        }
155
154
      }
180
179
          {
181
180
            if (mi_state_info_read_dsk(share->kfile, &share->state, 1))
182
181
            {
183
 
              error=my_errno;
184
 
              my_errno=error;
 
182
              error=errno;
 
183
              errno=error;
185
184
              break;
186
185
            }
187
186
          }
342
341
    {
343
342
      if (mi_state_info_read_dsk(share->kfile, &share->state, 1))
344
343
      {
345
 
        int error=my_errno ? my_errno : -1;
346
 
        my_errno=error;
 
344
        int error=errno ? errno : -1;
 
345
        errno=error;
347
346
        return(1);
348
347
      }
349
348
    }
352
351
  }
353
352
  else if (lock_type == F_WRLCK && info->lock_type == F_RDLCK)
354
353
  {
355
 
    my_errno=EACCES;                            /* Not allowed to change */
 
354
    errno=EACCES;                               /* Not allowed to change */
356
355
    return(-1);                         /* when have read_lock() */
357
356
  }
358
357
  return(0);
372
371
  error=0;
373
372
  if (share->tot_locks == 0)
374
373
  {
375
 
    olderror=my_errno;                  /* Remember last error */
 
374
    olderror=errno;                     /* Remember last error */
376
375
    if (operation)
377
376
    {                                   /* Two threads can't be here */
378
377
      share->state.process= share->last_process=   share->this_process;
379
378
      share->state.unique=  info->last_unique=     info->this_unique;
380
379
      share->state.update_count= info->last_loop= ++info->this_loop;
381
380
      if ((error=mi_state_info_write(share->kfile, &share->state, 1)))
382
 
        olderror=my_errno;
 
381
        olderror=errno;
383
382
    }
384
 
    my_errno=olderror;
 
383
    errno=olderror;
385
384
  }
386
385
  else if (operation)
387
386
    share->changed= 1;                  /* Mark keyfile changed */