~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.cc

  • Committer: Olaf van der Spek
  • Date: 2011-02-28 14:09:50 UTC
  • mfrom: (2207 bootstrap)
  • mto: (2209.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2210.
  • Revision ID: olafvdspek@gmail.com-20110228140950-2nu0hyzhuww3wssx
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <config.h>
22
22
#include <boost/lexical_cast.hpp>
23
 
#include "drizzled/field/enum.h"
24
 
#include "drizzled/error.h"
25
 
#include "drizzled/table.h"
26
 
#include "drizzled/session.h"
27
 
#include "drizzled/strfunc.h"
 
23
#include <drizzled/field/enum.h>
 
24
#include <drizzled/error.h>
 
25
#include <drizzled/table.h>
 
26
#include <drizzled/session.h>
 
27
#include <drizzled/typelib.h>
28
28
 
29
29
#include <sstream>
30
30
#include <string>
65
65
 
66
66
  /* Remove end space */
67
67
  length= field_charset->cset->lengthsp(field_charset, from, length);
68
 
  tmp= find_type2(typelib, from, length, field_charset);
 
68
  tmp= typelib->find_type2(from, length, field_charset);
69
69
  if (! tmp)
70
70
  {
71
71
    if (length < 6) /* Can't be more than 99999 enums */
120
120
  return 0;
121
121
}
122
122
 
123
 
double Field_enum::val_real(void)
 
123
double Field_enum::val_real(void) const
124
124
{
125
125
  return (double) Field_enum::val_int();
126
126
}
127
127
 
128
 
int64_t Field_enum::val_int(void)
 
128
int64_t Field_enum::val_int(void) const
129
129
{
130
130
  ASSERT_COLUMN_MARKED_FOR_READ;
131
131
 
139
139
  return ((int64_t) tmp) + 1; /* SQL is from 1, we store from 0 */
140
140
}
141
141
 
142
 
String *Field_enum::val_str(String *, String *val_ptr)
 
142
String *Field_enum::val_str(String *, String *val_ptr) const
143
143
{
144
144
  uint32_t tmp=(uint32_t) Field_enum::val_int();
145
145