~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field_conv.cc

MergedĀ inĀ remove-include-dir

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
*/
26
26
 
27
27
#include "mysql_priv.h"
28
 
#include <m_ctype.h>
29
28
 
30
29
static void do_field_eq(Copy_field *copy)
31
30
{
124
123
  field->reset();
125
124
  if (field->table->in_use->count_cuted_fields == CHECK_FIELD_WARN)
126
125
  {
127
 
    field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
 
126
    field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
128
127
    return 0;
129
128
  }
130
129
  if (!field->table->in_use->no_errors)
230
229
  if (*copy->from_null_ptr & copy->from_bit)
231
230
  {
232
231
    copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
233
 
                                WARN_DATA_TRUNCATED, 1);
 
232
                                ER_WARN_DATA_TRUNCATED, 1);
234
233
    copy->to_field->reset();
235
234
  }
236
235
  else
372
371
                     MY_SEQ_SPACES) < copy->from_length - copy->to_length)
373
372
  {
374
373
    copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
375
 
                                WARN_DATA_TRUNCATED, 1);
 
374
                                ER_WARN_DATA_TRUNCATED, 1);
376
375
  }
377
376
}
378
377
 
403
402
                     MY_SEQ_SPACES) < (copy->from_length - copy_length))
404
403
  {
405
404
    copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
406
 
                                WARN_DATA_TRUNCATED, 1);
 
405
                                ER_WARN_DATA_TRUNCATED, 1);
407
406
  }
408
407
 
409
408
  if (copy_length < copy->to_length)
441
440
    length=copy->to_length - 1;
442
441
    if (copy->from_field->table->in_use->count_cuted_fields)
443
442
      copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
444
 
                                  WARN_DATA_TRUNCATED, 1);
 
443
                                  ER_WARN_DATA_TRUNCATED, 1);
445
444
  }
446
445
  *(uchar*) copy->to_ptr= (uchar) length;
447
446
  memcpy(copy->to_ptr+1, copy->from_ptr + 1, length);
462
461
  {
463
462
    if (current_thd->count_cuted_fields)
464
463
      copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
465
 
                                  WARN_DATA_TRUNCATED, 1);
 
464
                                  ER_WARN_DATA_TRUNCATED, 1);
466
465
  }
467
466
  *copy->to_ptr= (uchar) length;
468
467
  memcpy(copy->to_ptr + 1, from_ptr, length);
477
476
    length=copy->to_length-HA_KEY_BLOB_LENGTH;
478
477
    if (copy->from_field->table->in_use->count_cuted_fields)
479
478
      copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
480
 
                                  WARN_DATA_TRUNCATED, 1);
 
479
                                  ER_WARN_DATA_TRUNCATED, 1);
481
480
  }
482
481
  int2store(copy->to_ptr,length);
483
482
  memcpy(copy->to_ptr+HA_KEY_BLOB_LENGTH, copy->from_ptr + HA_KEY_BLOB_LENGTH,
499
498
  {
500
499
    if (current_thd->count_cuted_fields)
501
500
      copy->to_field->set_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
502
 
                                  WARN_DATA_TRUNCATED, 1);
 
501
                                  ER_WARN_DATA_TRUNCATED, 1);
503
502
  }  
504
503
  int2store(copy->to_ptr, length);
505
504
  memcpy(copy->to_ptr+HA_KEY_BLOB_LENGTH, from_beg, length);