~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_conv.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    gives much more speed.
25
25
*/
26
26
 
27
 
#include <config.h>
 
27
#include "config.h"
28
28
 
29
29
#include <drizzled/error.h>
30
30
#include <drizzled/table.h>
31
31
#include <drizzled/session.h>
32
 
#include <drizzled/current_session.h>
33
32
 
34
33
#include <drizzled/copy_field.h>
35
34
#include <drizzled/field/blob.h>
47
46
#include <drizzled/field/real.h>
48
47
#include <drizzled/field/str.h>
49
48
#include <drizzled/field/varstring.h>
50
 
#include <drizzled/util/test.h>
51
 
#include <drizzled/system_variables.h>
52
49
 
53
 
namespace drizzled {
 
50
namespace drizzled
 
51
{
54
52
 
55
53
static void do_field_eq(CopyField *copy)
56
54
{
387
385
 
388
386
static void do_cut_string(CopyField *copy)
389
387
{
390
 
  const charset_info_st * const cs= copy->from_field->charset();
 
388
  const CHARSET_INFO * const cs= copy->from_field->charset();
391
389
  memcpy(copy->to_ptr, copy->from_ptr, copy->to_length);
392
390
 
393
391
  /* Check if we loosed any important characters */
410
408
static void do_cut_string_complex(CopyField *copy)
411
409
{                                               // Shorter string field
412
410
  int well_formed_error;
413
 
  const charset_info_st * const cs= copy->from_field->charset();
 
411
  const CHARSET_INFO * const cs= copy->from_field->charset();
414
412
  const unsigned char *from_end= copy->from_ptr + copy->from_length;
415
413
  uint32_t copy_length= cs->cset->well_formed_len(cs,
416
414
                                              (char*) copy->from_ptr,
441
439
 
442
440
static void do_expand_binary(CopyField *copy)
443
441
{
444
 
  const charset_info_st * const cs= copy->from_field->charset();
 
442
  const CHARSET_INFO * const cs= copy->from_field->charset();
445
443
  memcpy(copy->to_ptr, copy->from_ptr, copy->from_length);
446
444
  cs->cset->fill(cs, (char*) copy->to_ptr+copy->from_length,
447
445
                 copy->to_length-copy->from_length, '\0');
451
449
 
452
450
static void do_expand_string(CopyField *copy)
453
451
{
454
 
  const charset_info_st * const cs= copy->from_field->charset();
 
452
  const CHARSET_INFO * const cs= copy->from_field->charset();
455
453
  memcpy(copy->to_ptr,copy->from_ptr,copy->from_length);
456
454
  cs->cset->fill(cs, (char*) copy->to_ptr+copy->from_length,
457
455
                 copy->to_length-copy->from_length, ' ');
478
476
static void do_varstring1_mb(CopyField *copy)
479
477
{
480
478
  int well_formed_error;
481
 
  const charset_info_st * const cs= copy->from_field->charset();
 
479
  const CHARSET_INFO * const cs= copy->from_field->charset();
482
480
  uint32_t from_length= (uint32_t) *(unsigned char*) copy->from_ptr;
483
481
  const unsigned char *from_ptr= copy->from_ptr + 1;
484
482
  uint32_t to_char_length= (copy->to_length - 1) / cs->mbmaxlen;
519
517
static void do_varstring2_mb(CopyField *copy)
520
518
{
521
519
  int well_formed_error;
522
 
  const charset_info_st * const cs= copy->from_field->charset();
 
520
  const CHARSET_INFO * const cs= copy->from_field->charset();
523
521
  uint32_t char_length= (copy->to_length - HA_KEY_BLOB_LENGTH) / cs->mbmaxlen;
524
522
  uint32_t from_length= uint2korr(copy->from_ptr);
525
523
  const unsigned char *from_beg= copy->from_ptr + HA_KEY_BLOB_LENGTH;