~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/statement_transform.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:
31
31
 
32
32
#include "config.h"
33
33
 
 
34
#include <boost/lexical_cast.hpp>
34
35
#include "drizzled/message/statement_transform.h"
35
36
#include "drizzled/message/transaction.pb.h"
36
37
#include "drizzled/message/table.pb.h"
1036
1037
  if (sql_variant == ANSI)
1037
1038
    return NONE; /* ANSI does not support table options... */
1038
1039
 
1039
 
  stringstream ss;
1040
 
 
1041
1040
  if (options.has_comment())
1042
1041
  {
1043
1042
    destination.append(" COMMENT=", 9);
1066
1065
 
1067
1066
  if (options.has_max_rows())
1068
1067
  {
1069
 
    ss << options.max_rows();
1070
1068
    destination.append("\nMAX_ROWS = ", 12);
1071
 
    destination.append(ss.str());
1072
 
    ss.clear();
 
1069
    destination.append(boost::lexical_cast<string>(options.max_rows()));
1073
1070
  }
1074
1071
 
1075
1072
  if (options.has_min_rows())
1076
1073
  {
1077
 
    ss << options.min_rows();
1078
1074
    destination.append("\nMIN_ROWS = ", 12);
1079
 
    destination.append(ss.str());
1080
 
    ss.clear();
 
1075
    destination.append(boost::lexical_cast<string>(options.min_rows()));
1081
1076
  }
1082
1077
 
1083
1078
  if (options.has_user_set_auto_increment_value()
1084
1079
      && options.has_auto_increment_value())
1085
1080
  {
1086
 
    ss << options.auto_increment_value();
1087
1081
    destination.append(" AUTO_INCREMENT=", 16);
1088
 
    destination.append(ss.str());
1089
 
    ss.clear();
 
1082
    destination.append(boost::lexical_cast<string>(options.auto_increment_value()));
1090
1083
  }
1091
1084
 
1092
1085
  if (options.has_avg_row_length())
1093
1086
  {
1094
 
    ss << options.avg_row_length();
1095
1087
    destination.append("\nAVG_ROW_LENGTH = ", 18);
1096
 
    destination.append(ss.str());
1097
 
    ss.clear();
 
1088
    destination.append(boost::lexical_cast<string>(options.avg_row_length()));
1098
1089
  }
1099
1090
 
1100
1091
  if (options.has_checksum() &&
1160
1151
      {
1161
1152
        if (part.compare_length() != field.string_options().length())
1162
1153
        {
1163
 
          stringstream ss;
1164
1154
          destination.push_back('(');
1165
 
          ss << part.compare_length();
1166
 
          destination.append(ss.str());
 
1155
          destination.append(boost::lexical_cast<string>(part.compare_length()));
1167
1156
          destination.push_back(')');
1168
1157
        }
1169
1158
      }
1325
1314
      else
1326
1315
        destination.append(" VARCHAR(", 9);
1327
1316
 
1328
 
      stringstream ss;
1329
 
      ss << field.string_options().length() << ")";
1330
 
      destination.append(ss.str());
 
1317
      destination.append(boost::lexical_cast<string>(field.string_options().length()));
 
1318
      destination.append(")");
1331
1319
    }
1332
1320
    break;
1333
1321
  case Table::Field::BLOB: