diff --git a/include/MySQL_Protocol.h b/include/MySQL_Protocol.h index 056446a42..8ea0be882 100644 --- a/include/MySQL_Protocol.h +++ b/include/MySQL_Protocol.h @@ -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); diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index 2df9dddec..fcc4ed0fe 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -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() {