summaryrefslogtreecommitdiff
path: root/storage/innobase/api/api0api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/api/api0api.cc')
-rw-r--r--storage/innobase/api/api0api.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/storage/innobase/api/api0api.cc b/storage/innobase/api/api0api.cc
index bc83e98374f..64dafa0f224 100644
--- a/storage/innobase/api/api0api.cc
+++ b/storage/innobase/api/api0api.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 2008, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2008, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1988,11 +1988,14 @@ ib_cursor_read_row(
page_format = static_cast<ib_bool_t>(
dict_table_is_comp(tuple->index->table));
+
rec = btr_pcur_get_rec(pcur);
- if (prebuilt->innodb_api_rec &&
- prebuilt->innodb_api_rec != rec) {
- rec = prebuilt->innodb_api_rec;
+ if (!rec_get_deleted_flag(rec, page_format)) {
+ if (prebuilt->innodb_api &&
+ prebuilt->innodb_api_rec != NULL) {
+ rec =prebuilt->innodb_api_rec;
+ }
}
if (!rec_get_deleted_flag(rec, page_format)) {
@@ -2029,6 +2032,10 @@ ib_cursor_position(
buf = static_cast<unsigned char*>(mem_alloc(UNIV_PAGE_SIZE));
+ if (prebuilt->innodb_api) {
+ prebuilt->cursor_heap = cursor->heap;
+ }
+
/* We want to position at one of the ends, row_search_for_mysql()
uses the search_tuple fields to work out what to do. */
dtuple_set_n_fields(prebuilt->search_tuple, 0);
@@ -2083,6 +2090,9 @@ ib_cursor_next(
row_prebuilt_t* prebuilt = cursor->prebuilt;
byte buf[UNIV_PAGE_SIZE_MAX];
+ if (prebuilt->innodb_api) {
+ prebuilt->cursor_heap = cursor->heap;
+ }
/* We want to move to the next record */
dtuple_set_n_fields(prebuilt->search_tuple, 0);
@@ -2135,6 +2145,9 @@ ib_cursor_moveto(
buf = static_cast<unsigned char*>(mem_alloc(UNIV_PAGE_SIZE));
+ if (prebuilt->innodb_api) {
+ prebuilt->cursor_heap = cursor->heap;
+ }
err = static_cast<ib_err_t>(row_search_for_mysql(
buf, ib_srch_mode, prebuilt, cursor->match_mode, 0));