~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/set.cc

  • Committer: Stewart Smith
  • Date: 2008-08-02 07:12:36 UTC
  • mfrom: (258 drizzle)
  • mto: This revision was merged to the branch mainline in revision 408.
  • Revision ID: stewart@flamingspork.com-20080802071236-kbcozl5zm23j6mkn
mergeĀ fromĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#pragma implementation                          // gcc: Class implementation
23
23
#endif
24
24
 
25
 
#include "drizzle/server/field/set.h"
 
25
#include <drizzled/field/set.h>
26
26
 
27
27
/*
28
28
   set type.
64
64
        tmp > (uint64_t) (((int64_t) 1 << typelib->count) - (int64_t) 1))
65
65
    {
66
66
      tmp=0;      
67
 
      set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
 
67
      set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
68
68
    }
69
69
  }
70
70
  else if (got_warning)
71
 
    set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
 
71
    set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
72
72
  store_type(tmp);
73
73
  return err;
74
74
}
75
75
 
76
76
 
77
77
int Field_set::store(int64_t nr,
78
 
                     bool unsigned_val __attribute__((__unused__)))
 
78
                     bool unsigned_val __attribute__((unused)))
79
79
{
80
80
  int error= 0;
81
81
  uint64_t max_nr= set_bits(uint64_t, typelib->count);
82
82
  if ((uint64_t) nr > max_nr)
83
83
  {
84
84
    nr&= max_nr;
85
 
    set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, WARN_DATA_TRUNCATED, 1);
 
85
    set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
86
86
    error=1;
87
87
  }
88
88
  store_type((uint64_t) nr);