~posulliv/drizzle/memcached_applier

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

Merged trunk and resolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
380
380
  return diff ? diff : (int) (a_length - b_length);
381
381
}
382
382
 
383
 
 
384
383
/* The following is used only when comparing a key */
385
 
 
386
 
uint32_t Field_blob::get_key_image(unsigned char *buff,
387
 
                                   uint32_t length,
388
 
                                   imagetype)
 
384
uint32_t Field_blob::get_key_image(unsigned char *buff, uint32_t length)
389
385
{
390
386
  uint32_t blob_length= get_length(ptr);
391
387
  unsigned char *blob;
411
407
}
412
408
 
413
409
 
414
 
uint32_t Field_blob::get_key_image(basic_string<unsigned char> &buff,
415
 
                                   uint32_t length,
416
 
                                   imagetype)
 
410
uint32_t Field_blob::get_key_image(basic_string<unsigned char> &buff, uint32_t length)
417
411
{
418
412
  uint32_t blob_length= get_length(ptr);
419
413
  unsigned char *blob;
441
435
  return HA_KEY_BLOB_LENGTH+length;
442
436
}
443
437
 
444
 
 
445
438
void Field_blob::set_key_image(const unsigned char *buff,uint32_t length)
446
439
{
447
440
  length= uint2korr(buff);
448
 
  (void) Field_blob::store((const char*) buff+HA_KEY_BLOB_LENGTH, length,
449
 
                           field_charset);
 
441
  (void) Field_blob::store((const char*) buff+HA_KEY_BLOB_LENGTH, length, field_charset);
450
442
}
451
443
 
452
 
 
453
444
int Field_blob::key_cmp(const unsigned char *key_ptr, uint32_t max_key_length)
454
445
{
455
446
  unsigned char *blob1;
471
462
                         b+HA_KEY_BLOB_LENGTH, uint2korr(b));
472
463
}
473
464
 
474
 
 
475
465
/**
476
466
   Save the field metadata for blob fields.
477
467
 
488
478
  return 1;
489
479
}
490
480
 
491
 
 
492
481
uint32_t Field_blob::sort_length() const
493
482
{
494
483
  return (uint32_t) (current_session->variables.max_sort_length +
495
484
                   (field_charset == &my_charset_bin ? 0 : packlength));
496
485
}
497
486
 
498
 
 
499
487
void Field_blob::sort_string(unsigned char *to,uint32_t length)
500
488
{
501
489
  unsigned char *blob;
538
526
  }
539
527
}
540
528
 
541
 
 
542
529
uint32_t Field_blob::pack_length() const
543
530
{
544
531
  return (uint32_t) (packlength+table->s->blob_ptr_size);
545
532
}
546
533
 
547
 
 
548
534
void Field_blob::sql_type(String &res) const
549
535
{
550
536
  if (charset() == &my_charset_bin)
579
565
  return(to+packlength+length);
580
566
}
581
567
 
582
 
 
583
568
/**
584
569
   Unpack a blob field from row data.
585
570
 
643
628
    return 0;
644
629
  Field_blob *blob_field_ptr= static_cast<Field_blob *>(new_field_ptr->field);
645
630
 
646
 
  return ((new_field_ptr->sql_type == 
647
 
             get_blob_type_from_length(max_data_length()))
 
631
  return (new_field_ptr->sql_type == DRIZZLE_TYPE_BLOB
648
632
          && new_field_ptr->charset == field_charset
649
633
          && blob_field_ptr->max_data_length() == max_data_length());
650
634
}