diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-02-25 16:04:35 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-02-25 16:04:35 +0100 |
commit | 0b9a0a3517ca2b75655f3af5c372cf333d3d5fe2 (patch) | |
tree | 5c67457ff8abbb89b203a7f55cda776b738c385b /storage/federatedx | |
parent | 6324c36bd703a0f55dcd49dd721af262f73cf7aa (diff) | |
parent | ff2e82f4a175b7b023cd167b2fa6e6fcd1bd192e (diff) | |
download | mariadb-git-0b9a0a3517ca2b75655f3af5c372cf333d3d5fe2.tar.gz |
5.5 merge
Diffstat (limited to 'storage/federatedx')
-rw-r--r-- | storage/federatedx/federatedx_io_mysql.cc | 17 | ||||
-rw-r--r-- | storage/federatedx/ha_federatedx.cc | 11 |
2 files changed, 12 insertions, 16 deletions
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index e64656074ab..2933073a679 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -62,6 +62,7 @@ struct mysql_position class federatedx_io_mysql :public federatedx_io { MYSQL mysql; /* MySQL connection */ + MYSQL_ROWS *current; DYNAMIC_ARRAY savepoints; bool requested_autocommit; bool actual_autocommit; @@ -514,7 +515,9 @@ my_ulonglong federatedx_io_mysql::get_num_rows(FEDERATEDX_IO_RESULT *io_result) FEDERATEDX_IO_ROW *federatedx_io_mysql::fetch_row(FEDERATEDX_IO_RESULT *io_result) { - return (FEDERATEDX_IO_ROW *) mysql_fetch_row((MYSQL_RES *) io_result); + MYSQL_RES *result= (MYSQL_RES*)io_result; + current= result->data_cursor; + return (FEDERATEDX_IO_ROW *) mysql_fetch_row(result); } @@ -623,19 +626,9 @@ size_t federatedx_io_mysql::get_ref_length() const void federatedx_io_mysql::mark_position(FEDERATEDX_IO_RESULT *io_result, void *ref) { - MYSQL_ROWS *tmp= 0; mysql_position& pos= *reinterpret_cast<mysql_position*>(ref); pos.result= (MYSQL_RES *) io_result; - - if (pos.result && pos.result->data) - { - for (tmp= pos.result->data->data; - tmp && (tmp->next != pos.result->data_cursor); - tmp= tmp->next) - {} - } - - pos.offset= tmp; + pos.offset= current; } int federatedx_io_mysql::seek_position(FEDERATEDX_IO_RESULT **io_result, diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 1c9db78da4f..e6f3e1a632b 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -2716,7 +2716,8 @@ int ha_federatedx::read_range_next() int ha_federatedx::index_next(uchar *buf) { DBUG_ENTER("ha_federatedx::index_next"); - DBUG_RETURN(read_next(buf, stored_result)); + int retval=read_next(buf, stored_result); + DBUG_RETURN(retval); } @@ -2871,7 +2872,8 @@ int ha_federatedx::rnd_next(uchar *buf) */ DBUG_RETURN(1); } - DBUG_RETURN(read_next(buf, stored_result)); + int retval=read_next(buf, stored_result); + DBUG_RETURN(retval); } @@ -2942,10 +2944,11 @@ void ha_federatedx::position(const uchar *record __attribute__ ((unused))) { DBUG_ENTER("ha_federatedx::position"); - bzero(ref, ref_length); - if (!stored_result) + { + bzero(ref, ref_length); DBUG_VOID_RETURN; + } if (txn->acquire(share, TRUE, &io)) DBUG_VOID_RETURN; |