~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blackhole/ha_blackhole.cc

  • Committer: Brian Aker
  • Date: 2009-12-02 07:42:48 UTC
  • mfrom: (1236.1.2 push)
  • Revision ID: brian@gaz-20091202074248-svgtvfqvpzxt9lh3
Merge current set for staging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
   : drizzled::plugin::StorageEngine(name_arg, HTON_FILE_BASED |
45
45
                                     HTON_NULL_IN_KEY |
46
46
                                     HTON_CAN_INDEX_BLOBS |
 
47
                                     HTON_SKIP_STORE_LOCK |
47
48
                                     HTON_AUTO_PART_KEY |
48
49
                                     HTON_HAS_DATA_DICTIONARY)
49
50
  {
272
273
  return(0);
273
274
}
274
275
 
275
 
THR_LOCK_DATA **ha_blackhole::store_lock(Session *session,
276
 
                                         THR_LOCK_DATA **to,
277
 
                                         enum thr_lock_type lock_type)
278
 
{
279
 
  if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
280
 
  {
281
 
    /*
282
 
      Here is where we get into the guts of a row level lock.
283
 
      If TL_UNLOCK is set
284
 
      If we are not doing a LOCK Table or DISCARD/IMPORT
285
 
      TABLESPACE, then allow multiple writers
286
 
    */
287
 
 
288
 
    if ((lock_type >= TL_WRITE_CONCURRENT_INSERT &&
289
 
         lock_type <= TL_WRITE) && !session_tablespace_op(session))
290
 
      lock_type = TL_WRITE_ALLOW_WRITE;
291
 
 
292
 
    /*
293
 
      In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
294
 
      MySQL would use the lock TL_READ_NO_INSERT on t2, and that
295
 
      would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts
296
 
      to t2. Convert the lock to a normal read lock to allow
297
 
      concurrent inserts to t2.
298
 
    */
299
 
 
300
 
    if (lock_type == TL_READ_NO_INSERT)
301
 
      lock_type = TL_READ;
302
 
 
303
 
    lock.type= lock_type;
304
 
  }
305
 
  *to++= &lock;
306
 
  return(to);
307
 
}
308
 
 
309
276
 
310
277
int ha_blackhole::index_read_map(unsigned char *, const unsigned char *,
311
278
                                 key_part_map, enum ha_rkey_function)