~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.cc

  • Committer: lbieber
  • Date: 2010-10-05 22:23:12 UTC
  • mfrom: (1813.1.4 build)
  • Revision ID: lbieber@orisndriz08-20101005222312-weuq0ardk3gcryau
Merge Travis - 621861 - convert structs to classes
Merge Billy - 621331 - Replace use of stringstream with boost::lexical_cast
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle
Merge Andrew - fix bug 653300 - Syntax error on inport of a SQL file produced by drizzledump

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
 
 
22
21
#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"
110
110
 
111
111
  if (from <= 0 || (uint64_t) from > typelib->count)
112
112
  {
113
 
    /* Convert the integer to a string using stringstream */
114
 
    std::stringstream ss;
115
 
    std::string tmp;
116
 
    ss << from; ss >> tmp;
 
113
    /* Convert the integer to a string using boost::lexical_cast */
 
114
    std::string tmp(boost::lexical_cast<std::string>(from));
117
115
 
118
116
    my_error(ER_INVALID_ENUM_VALUE, MYF(ME_FATALERROR), tmp.c_str());
119
117
    return 1;