~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_conv.cc

  • Committer: Brian Aker
  • Date: 2008-08-07 16:29:49 UTC
  • mfrom: (264.1.20 codestyle)
  • Revision ID: brian@tangent.org-20080807162949-7o8eyjgdn8ms3n1a
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    gives much more speed.
25
25
*/
26
26
 
27
 
#include "mysql_priv.h"
 
27
#include <drizzled/server_includes.h>
28
28
 
29
29
static void do_field_eq(Copy_field *copy)
30
30
{
346
346
 
347
347
static void do_cut_string(Copy_field *copy)
348
348
{
349
 
  CHARSET_INFO *cs= copy->from_field->charset();
 
349
  const CHARSET_INFO * const cs= copy->from_field->charset();
350
350
  memcpy(copy->to_ptr,copy->from_ptr,copy->to_length);
351
351
 
352
352
  /* Check if we loosed any important characters */
369
369
static void do_cut_string_complex(Copy_field *copy)
370
370
{                                               // Shorter string field
371
371
  int well_formed_error;
372
 
  CHARSET_INFO *cs= copy->from_field->charset();
 
372
  const CHARSET_INFO * const cs= copy->from_field->charset();
373
373
  const uchar *from_end= copy->from_ptr + copy->from_length;
374
374
  uint copy_length= cs->cset->well_formed_len(cs,
375
375
                                              (char*) copy->from_ptr,
400
400
 
401
401
static void do_expand_binary(Copy_field *copy)
402
402
{
403
 
  CHARSET_INFO *cs= copy->from_field->charset();
 
403
  const CHARSET_INFO * const cs= copy->from_field->charset();
404
404
  memcpy(copy->to_ptr,copy->from_ptr,copy->from_length);
405
405
  cs->cset->fill(cs, (char*) copy->to_ptr+copy->from_length,
406
406
                     copy->to_length-copy->from_length, '\0');
410
410
 
411
411
static void do_expand_string(Copy_field *copy)
412
412
{
413
 
  CHARSET_INFO *cs= copy->from_field->charset();
 
413
  const CHARSET_INFO * const cs= copy->from_field->charset();
414
414
  memcpy(copy->to_ptr,copy->from_ptr,copy->from_length);
415
415
  cs->cset->fill(cs, (char*) copy->to_ptr+copy->from_length,
416
416
                     copy->to_length-copy->from_length, ' ');
435
435
static void do_varstring1_mb(Copy_field *copy)
436
436
{
437
437
  int well_formed_error;
438
 
  CHARSET_INFO *cs= copy->from_field->charset();
 
438
  const CHARSET_INFO * const cs= copy->from_field->charset();
439
439
  uint from_length= (uint) *(uchar*) copy->from_ptr;
440
440
  const uchar *from_ptr= copy->from_ptr + 1;
441
441
  uint to_char_length= (copy->to_length - 1) / cs->mbmaxlen;
472
472
static void do_varstring2_mb(Copy_field *copy)
473
473
{
474
474
  int well_formed_error;
475
 
  CHARSET_INFO *cs= copy->from_field->charset();
 
475
  const CHARSET_INFO * const cs= copy->from_field->charset();
476
476
  uint char_length= (copy->to_length - HA_KEY_BLOB_LENGTH) / cs->mbmaxlen;
477
477
  uint from_length= uint2korr(copy->from_ptr);
478
478
  const uchar *from_beg= copy->from_ptr + HA_KEY_BLOB_LENGTH;