~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/haildb/haildb_engine.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 17:21:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622172146-fmtxxu9xt3ddmnm5
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
2286
2286
    }
2287
2287
    else if ((**field).type() == DRIZZLE_TYPE_BLOB)
2288
2288
    {
2289
 
      if (blobroot == NULL)
2290
 
        (reinterpret_cast<Field_blob*>(*field))->set_ptr(length,
2291
 
                                      (unsigned char*)ib_col_get_value(tuple,
2292
 
                                                                       colnr));
 
2289
      if (not blobroot)
 
2290
        (reinterpret_cast<Field_blob*>(*field))->set_ptr(length, (unsigned char*)ib_col_get_value(tuple, colnr));
2293
2291
      else
2294
2292
      {
2295
 
        if (*blobroot == NULL)
 
2293
        if (not *blobroot)
2296
2294
        {
2297
2295
          *blobroot= new drizzled::memory::Root();
2298
 
          (**blobroot).init();
 
2296
          (*blobroot)->init();
2299
2297
        }
2300
2298
 
2301
 
        unsigned char *blob_ptr= (unsigned char*)(*blobroot)->alloc(length);
 
2299
        unsigned char *blob_ptr= (*blobroot)->alloc(length);
2302
2300
        memcpy(blob_ptr, ib_col_get_value(tuple, colnr), length);
2303
2301
        (reinterpret_cast<Field_blob*>(*field))->set_ptr(length, blob_ptr);
2304
2302
      }