~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

  • Committer: earney
  • Date: 2010-09-20 22:29:50 UTC
  • mto: (1813.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 1814.
  • Revision ID: earney@earney.homedns.org-20100920222950-evtw5u0vzlxt31qh
modified files containing stringstream to use boost:lexical_cast instead as 
requested in bug 621331

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
#include "config.h"
 
22
#include <boost/lexical_cast.hpp>
22
23
#include "drizzled/field/datetime.h"
23
24
#include "drizzled/error.h"
24
25
#include "drizzled/table.h"
77
78
  if (from < 0.0 || from > 99991231235959.0)
78
79
  {
79
80
    /* Convert the double to a string using stringstream */
80
 
    std::stringstream ss;
81
 
    std::string tmp;
82
 
    ss.precision(18); /* 18 places should be fine for error display of double input. */
83
 
    ss << from; ss >> tmp;
 
81
    //std::stringstream ss;
 
82
    //std::string tmp;
 
83
    //ss.precision(18); /* 18 places should be fine for error display of double input. */
 
84
    //ss << from; ss >> tmp;
 
85
    std::string tmp(boost::lexical_cast<std::string>(from));
84
86
 
85
87
    my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str());
86
88
    return 2;
99
101
  if (! temporal.from_int64_t(from))
100
102
  {
101
103
    /* Convert the integer to a string using stringstream */
102
 
    std::stringstream ss;
103
 
    std::string tmp;
104
 
    ss << from; ss >> tmp;
 
104
    //std::stringstream ss;
 
105
    //std::string tmp;
 
106
    //ss << from; ss >> tmp;
 
107
    std::string tmp(boost::lexical_cast<std::string>(from));
105
108
 
106
109
    my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR), tmp.c_str());
107
110
    return 2;