~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_write.cc

  • Committer: Brian Aker
  • Date: 2010-08-11 18:47:39 UTC
  • mfrom: (1689.2.28 rollup)
  • Revision ID: brian@gaz-20100811184739-ey7llnsu12gfv6hb
No longer concurrent, no longer need these locks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
                                  is_tree_inited(&info->bulk_insert[i])));
101
101
      if (local_lock_tree)
102
102
      {
103
 
        pthread_rwlock_wrlock(&share->key_root_lock[i]);
104
103
        share->keyinfo[i].version++;
105
104
      }
106
105
      {
107
106
        if (share->keyinfo[i].ck_insert(info,i,buff,
108
107
                        _mi_make_key(info,i,buff,record,filepos)))
109
108
        {
110
 
          if (local_lock_tree)
111
 
            pthread_rwlock_unlock(&share->key_root_lock[i]);
112
109
          goto err;
113
110
        }
114
111
      }
115
112
 
116
113
      /* The above changed info->lastkey2. Inform mi_rnext_same(). */
117
114
      info->update&= ~HA_STATE_RNEXT_SAME;
118
 
 
119
 
      if (local_lock_tree)
120
 
        pthread_rwlock_unlock(&share->key_root_lock[i]);
121
115
    }
122
116
  }
123
117
  if (share->calc_checksum)
166
160
    {
167
161
      if (mi_is_key_active(share->state.key_map, i))
168
162
      {
169
 
        bool local_lock_tree= (lock_tree &&
170
 
                                  !(info->bulk_insert &&
171
 
                                    is_tree_inited(&info->bulk_insert[i])));
172
 
        if (local_lock_tree)
173
 
          pthread_rwlock_wrlock(&share->key_root_lock[i]);
174
163
        {
175
164
          uint32_t key_length=_mi_make_key(info,i,buff,record,filepos);
176
165
          if (_mi_ck_delete(info,i,buff,key_length))
177
166
          {
178
 
            if (local_lock_tree)
179
 
              pthread_rwlock_unlock(&share->key_root_lock[i]);
180
167
            break;
181
168
          }
182
169
        }
183
 
        if (local_lock_tree)
184
 
          pthread_rwlock_unlock(&share->key_root_lock[i]);
185
170
      }
186
171
    }
187
172
  }
764
749
  case free_init:
765
750
    if (param->info->s->concurrent_insert)
766
751
    {
767
 
      pthread_rwlock_wrlock(&param->info->s->key_root_lock[param->keynr]);
768
752
      param->info->s->keyinfo[param->keynr].version++;
769
753
    }
770
754
    return 0;
775
759
    return _mi_ck_write_btree(param->info,param->keynr,lastkey,
776
760
                              keylen - param->info->s->rec_reflength);
777
761
  case free_end:
778
 
    if (param->info->s->concurrent_insert)
779
 
      pthread_rwlock_unlock(&param->info->s->key_root_lock[param->keynr]);
780
762
    return 0;
781
763
  }
782
764
  return -1;