summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-10-31 09:38:59 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-10-31 09:38:59 +0200
commit998ccac2de875ba0ea470dded9ffd1ef7be6d443 (patch)
treee7bca89e88dcb2ba54e27fe863973b410d84b98e
parentab81aefef6e54ec872622f996ed66626700e4d8e (diff)
downloadmariadb-git-bb-10.5-MDEV-16232.tar.gz
MDEV-16232 preparation: Disable row_prebuilt_t::fetch_cachebb-10.5-MDEV-16232
The minimal change to disable the use of the fetch_cache is the 2 hunks #if 1/#else/#endif in row_search_mvcc(). The rest is disabling dead code and data.
-rw-r--r--storage/innobase/include/row0mysql.h4
-rw-r--r--storage/innobase/row/row0mysql.cc2
-rw-r--r--storage/innobase/row/row0sel.cc21
3 files changed, 25 insertions, 2 deletions
diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h
index e3f7ea7d701..60acf0a54f7 100644
--- a/storage/innobase/include/row0mysql.h
+++ b/storage/innobase/include/row0mysql.h
@@ -737,6 +737,7 @@ struct row_prebuilt_t {
ulint n_rows_fetched; /*!< number of rows fetched after
positioning the current cursor */
ulint fetch_direction;/*!< ROW_SEL_NEXT or ROW_SEL_PREV */
+#if 0
byte* fetch_cache[MYSQL_FETCH_CACHE_SIZE];
/*!< a cache for fetched rows if we
fetch many rows from the same cursor:
@@ -747,14 +748,17 @@ struct row_prebuilt_t {
allocated mem buf start, because
there is a 4 byte magic number at the
start and at the end */
+#endif
bool keep_other_fields_on_keyread; /*!< when using fetch
cache with HA_EXTRA_KEYREAD, don't
overwrite other fields in mysql row
row buffer.*/
+#if 0
ulint fetch_cache_first;/*!< position of the first not yet
fetched row in fetch_cache */
ulint n_fetch_cached; /*!< number of not yet fetched rows
in fetch_cache */
+#endif
mem_heap_t* blob_heap; /*!< in SELECTS BLOB fields are copied
to this heap */
mem_heap_t* old_vers_heap; /*!< memory heap where a previous
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index 1c135f787f6..9995a61a88d 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -983,6 +983,7 @@ row_prebuilt_free(
mem_heap_free(prebuilt->old_vers_heap);
}
+#if 0
if (prebuilt->fetch_cache[0] != NULL) {
byte* base = prebuilt->fetch_cache[0] - 4;
byte* ptr = base;
@@ -1003,6 +1004,7 @@ row_prebuilt_free(
ut_free(base);
}
+#endif
if (prebuilt->rtr_info) {
rtr_clean_rtr_info(prebuilt->rtr_info, true);
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc
index d75199ccb64..bf36aab4dba 100644
--- a/storage/innobase/row/row0sel.cc
+++ b/storage/innobase/row/row0sel.cc
@@ -3751,6 +3751,7 @@ row_sel_copy_cached_fields_for_mysql(
}
}
+#if 0
/********************************************************************//**
Pops a cached row for MySQL from the fetch cache. */
UNIV_INLINE
@@ -3886,6 +3887,7 @@ row_sel_enqueue_cache_row_for_mysql(
++prebuilt->n_fetch_cached;
}
+#endif
#ifdef BTR_CUR_HASH_ADAPT
/*********************************************************************//**
@@ -4302,7 +4304,9 @@ row_search_mvcc(
ulint next_offs;
bool same_user_rec;
ibool table_lock_waited = FALSE;
+#if 0
byte* next_buf = 0;
+#endif
bool spatial_search = false;
ut_ad(index && pcur && search_tuple);
@@ -4350,8 +4354,10 @@ row_search_mvcc(
trx->op_info = "starting index read";
prebuilt->n_rows_fetched = 0;
+#if 0
prebuilt->n_fetch_cached = 0;
prebuilt->fetch_cache_first = 0;
+#endif
if (prebuilt->sel_graph == NULL) {
/* Build a dummy select query graph */
@@ -4365,6 +4371,8 @@ row_search_mvcc(
}
if (UNIV_UNLIKELY(direction != prebuilt->fetch_direction)) {
+ prebuilt->n_rows_fetched = 0;
+#if 0
if (UNIV_UNLIKELY(prebuilt->n_fetch_cached > 0)) {
ut_error;
/* TODO: scrollable cursor: restore cursor to
@@ -4373,20 +4381,23 @@ row_search_mvcc(
cursor! */
}
- prebuilt->n_rows_fetched = 0;
prebuilt->n_fetch_cached = 0;
prebuilt->fetch_cache_first = 0;
-
} else if (UNIV_LIKELY(prebuilt->n_fetch_cached > 0)) {
row_sel_dequeue_cached_row_for_mysql(buf, prebuilt);
prebuilt->n_rows_fetched++;
trx->op_info = "";
DBUG_RETURN(DB_SUCCESS);
+#endif
}
+#if 0
if (prebuilt->fetch_cache_first > 0
&& prebuilt->fetch_cache_first < MYSQL_FETCH_CACHE_SIZE) {
+#else
+ if (false) {
+#endif
early_not_found:
/* The previous returned row was popped from the fetch
cache, but the cache was not full at the time of the
@@ -5440,6 +5451,9 @@ use_covering_index:
offsets));
ut_ad(!rec_get_deleted_flag(result_rec, comp));
+#if 1
+ {
+#else
/* Decide whether to prefetch extra rows.
At this point, the clustered index record is protected
by a page latch that was acquired when pcur was positioned.
@@ -5520,6 +5534,7 @@ use_covering_index:
}
} else {
+#endif
if (UNIV_UNLIKELY
(prebuilt->template_type == ROW_MYSQL_DUMMY_TEMPLATE)) {
/* CHECK TABLE: fetch the row */
@@ -5779,6 +5794,7 @@ normal_return:
DEBUG_SYNC_C("row_search_for_mysql_before_return");
+#if 0
if (prebuilt->pk_filter || prebuilt->idx_cond) {
/* When ICP is active we don't write to the MySQL buffer
directly, only to buffers that are enqueued in the pre-fetch
@@ -5799,6 +5815,7 @@ normal_return:
DEBUG_SYNC_C("row_search_cached_row");
err = DB_SUCCESS;
}
+#endif
#ifdef UNIV_DEBUG
if (dict_index_is_spatial(index) && err != DB_SUCCESS