~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.cc

  • Committer: Monty Taylor
  • Date: 2010-09-28 07:45:44 UTC
  • mto: (1799.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1800.
  • Revision ID: mordred@inaugust.com-20100928074544-s3ujnv6s8wro74l2
Added BSD copying file.

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
 
21
22
#include "config.h"
22
 
#include <boost/lexical_cast.hpp>
23
23
#include "drizzled/field/enum.h"
24
24
#include "drizzled/error.h"
25
25
#include "drizzled/table.h"
43
43
  value--; /* we store as starting from 0, although SQL starts from 1 */
44
44
 
45
45
#ifdef WORDS_BIGENDIAN
46
 
  if (getTable()->getShare()->db_low_byte_first)
 
46
  if (getTable()->s->db_low_byte_first)
47
47
  {
48
48
    int4store(ptr, (unsigned short) value);
49
49
  }
110
110
 
111
111
  if (from <= 0 || (uint64_t) from > typelib->count)
112
112
  {
113
 
    /* Convert the integer to a string using boost::lexical_cast */
114
 
    std::string tmp(boost::lexical_cast<std::string>(from));
 
113
    /* Convert the integer to a string using stringstream */
 
114
    std::stringstream ss;
 
115
    std::string tmp;
 
116
    ss << from; ss >> tmp;
115
117
 
116
118
    my_error(ER_INVALID_ENUM_VALUE, MYF(ME_FATALERROR), tmp.c_str());
117
119
    return 1;
131
133
 
132
134
  uint16_t tmp;
133
135
#ifdef WORDS_BIGENDIAN
134
 
  if (getTable()->getShare()->db_low_byte_first)
 
136
  if (getTable()->s->db_low_byte_first)
135
137
    tmp= sint4korr(ptr);
136
138
  else
137
139
#endif
145
147
 
146
148
  ASSERT_COLUMN_MARKED_FOR_READ;
147
149
 
148
 
  if (not tmp || tmp > typelib->count)
 
150
  if (!tmp || tmp > typelib->count)
149
151
  {
150
152
    val_ptr->set("", 0, field_charset);
151
153
  }
191
193
  uint32_t *len= typelib->type_lengths;
192
194
  for (const char **pos= typelib->type_names; *pos; pos++, len++)
193
195
  {
194
 
    size_t dummy_errors;
 
196
    uint32_t dummy_errors;
195
197
    if (flag)
196
198
      res.append(',');
197
199
    /* convert to res.charset() == utf8, then quote */