Adding MySQL_ResultSet::init_with_stmt()

This new function is meant to split MySQL_ResultSet::init() to later
remove all code specific to prepared statements because it assumes
it is pre-buffered
pull/3210/head
René Cannaò 5 years ago
parent 7d0ac031b3
commit 0171082448

@ -35,6 +35,7 @@ class MySQL_ResultSet {
//PtrSizeArray *PSarrayOUT;
MySQL_ResultSet();
void init(MySQL_Protocol *_myprot, MYSQL_RES *_res, MYSQL *_my, MYSQL_STMT *_stmt=NULL);
void init_with_stmt(MYSQL_STMT *_stmt);
~MySQL_ResultSet();
unsigned int add_row(MYSQL_ROW row);
unsigned int add_row2(MYSQL_ROWS *row, unsigned char *offset);

@ -2443,6 +2443,13 @@ void MySQL_ResultSet::init(MySQL_Protocol *_myprot, MYSQL_RES *_res, MYSQL *_my,
}
//}
if (_stmt) { // binary protocol , we also assume we have ALL the resultset
init_with_stmt(_stmt);
}
}
void MySQL_ResultSet::init_with_stmt(MYSQL_STMT *_stmt) {
MySQL_Data_Stream * c_myds = *(myprot->myds);
buffer_to_PSarrayOut();
unsigned long long total_size=0;
MYSQL_ROWS *r=_stmt->result.data;
@ -2551,7 +2558,6 @@ void MySQL_ResultSet::init(MySQL_Protocol *_myprot, MYSQL_RES *_res, MYSQL *_my,
}
}
add_eof();
}
}
MySQL_ResultSet::~MySQL_ResultSet() {

Loading…
Cancel
Save