Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 641428
Collapse All | Expand All

(-)a/src/database/mysql/statement.cpp (-3 / +3 lines)
Lines 48-54 Link Here
48
namespace database{
48
namespace database{
49
namespace mysql{
49
namespace mysql{
50
50
51
mysql_statement::mysql_statement(shared_ptr<mysql_connection_impl,
51
mysql_statement::mysql_statement(pfi::lang::shared_ptr<mysql_connection_impl,
52
                                   pfi::concurrent::threading_model::multi_thread> &conn,
52
                                   pfi::concurrent::threading_model::multi_thread> &conn,
53
				 const string &query)
53
				 const string &query)
54
  :conn(conn),meta(NULL)
54
  :conn(conn),meta(NULL)
Lines 98-104 Link Here
98
  mysql_stmt_close(stmt);
98
  mysql_stmt_close(stmt);
99
}
99
}
100
100
101
int mysql_statement::execute(const vector<shared_ptr<sql_value> > &args)
101
int mysql_statement::execute(const vector<pfi::lang::shared_ptr<sql_value> > &args)
102
{
102
{
103
  if (param_count!=args.size()){
103
  if (param_count!=args.size()){
104
    ostringstream msg;
104
    ostringstream msg;
Lines 146-152 Link Here
146
  return 0;
146
  return 0;
147
}
147
}
148
148
149
bool mysql_statement::fetch_row(vector<shared_ptr<sql_value> > &row)
149
bool mysql_statement::fetch_row(vector<pfi::lang::shared_ptr<sql_value> > &row)
150
{
150
{
151
  static const size_t INIT_BUF_SIZE = 16*1024;
151
  static const size_t INIT_BUF_SIZE = 16*1024;
152
  
152
  
(-)a/src/database/mysql/connection.cpp (-3 / +3 lines)
Lines 145-164 Link Here
145
}
145
}
146
146
147
int mysql_connection::run(const string &sql,
147
int mysql_connection::run(const string &sql,
148
			  const vector<shared_ptr<sql_value> > &args)
148
			  const vector<pfi::lang::shared_ptr<sql_value> > &args)
149
{
149
{
150
  if (conn->get() == NULL) reconnect();
150
  if (conn->get() == NULL) reconnect();
151
151
152
  // TODO: optimize
152
  // TODO: optimize
153
  try {
153
  try {
154
    shared_ptr<statement> stat(prepare(sql));
154
    pfi::lang::shared_ptr<statement> stat(prepare(sql));
155
    return stat->execute(args);
155
    return stat->execute(args);
156
  }
156
  }
157
  catch (const connection_error &e) {
157
  catch (const connection_error &e) {
158
    reconnect(); // this function rethrows an exception if necessary
158
    reconnect(); // this function rethrows an exception if necessary
159
  }
159
  }
160
160
161
  shared_ptr<statement> stat(prepare(sql));
161
  pfi::lang::shared_ptr<statement> stat(prepare(sql));
162
  return stat->execute(args);
162
  return stat->execute(args);
163
}
163
}
164
164

Return to bug 641428