~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.cc

  • Committer: lbieber
  • Date: 2010-10-05 21:14:30 UTC
  • mfrom: (1775.5.2 bug621331)
  • mto: This revision was merged to the branch mainline in revision 1814.
  • Revision ID: lbieber@orisndriz08-20101005211430-xmy19fcls25swctl
Merge Billy - fix bug 621331 - Replace use of stringstream with boost::lexical_cast

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/timestamp.h>
24
24
#include <drizzled/error.h>
25
25
#include <drizzled/tztime.h>
187
187
    std::stringstream ss;
188
188
    std::string tmp;
189
189
    ss.precision(18); /* 18 places should be fine for error display of double input. */
190
 
    ss << from; ss >> tmp;
 
190
    ss << from; 
 
191
    ss >> tmp;
191
192
 
192
193
    my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), tmp.c_str());
193
194
    return 2;
206
207
  Timestamp temporal;
207
208
  if (! temporal.from_int64_t(from))
208
209
  {
209
 
    /* Convert the integer to a string using stringstream */
210
 
    std::stringstream ss;
211
 
    std::string tmp;
212
 
    ss << from; ss >> tmp;
 
210
    /* Convert the integer to a string using boost::lexical_cast */
 
211
    std::string tmp(boost::lexical_cast<std::string>(from));
213
212
 
214
213
    my_error(ER_INVALID_UNIX_TIMESTAMP_VALUE, MYF(ME_FATALERROR), tmp.c_str());
215
214
    return 2;