summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-02-17 13:27:41 +0100
committerSergei Golubchik <sergii@pisem.net>2012-02-17 13:27:41 +0100
commitbbb3527635627a404ab4a16be7598339e8e41139 (patch)
treed86404d94d3bd4b04cc2514e1e007ab7b4d918d8 /storage/myisam
parent2d19b077d5816dcd3a8c84bb682cf2d83fa055f5 (diff)
downloadmariadb-git-bbb3527635627a404ab4a16be7598339e8e41139.tar.gz
Remove engine-specific (but identical) icp callbacks. create one reusable
common icp callback in the handler.cc. It can also increment status counters, without making the engine dependent on the exact THD layout (that is different in embedded).
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.cc28
1 files changed, 3 insertions, 25 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 1f6e1fd6838..a6ece45734a 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1765,33 +1765,11 @@ int ha_myisam::delete_row(const uchar *buf)
}
-C_MODE_START
-
-ICP_RESULT index_cond_func_myisam(void *arg)
-{
- ha_myisam *h= (ha_myisam*)arg;
- THD *thd= ((TABLE*) h->file->external_ref)->in_use;
- ICP_RESULT res;
- if (h->end_range)
- {
- if (h->compare_key2(h->end_range) > 0)
- return ICP_OUT_OF_RANGE; /* caller should return HA_ERR_END_OF_FILE already */
- }
- status_var_increment(thd->status_var.ha_pushed_index_cond_checks);
- if ((res= (ICP_RESULT) test(h->pushed_idx_cond->val_int())) ==
- ICP_NO_MATCH)
- status_var_increment(thd->status_var.ha_pushed_index_cond_filtered);
- return res;
-}
-
-C_MODE_END
-
-
int ha_myisam::index_init(uint idx, bool sorted)
{
active_index=idx;
if (pushed_idx_cond_keyno == idx)
- mi_set_index_cond_func(file, index_cond_func_myisam, this);
+ mi_set_index_cond_func(file, handler_index_cond_check, this);
return 0;
}
@@ -1827,7 +1805,7 @@ int ha_myisam::index_read_idx_map(uchar *buf, uint index, const uchar *key,
/* Use the pushed index condition if it matches the index we're scanning */
end_range= NULL;
if (index == pushed_idx_cond_keyno)
- mi_set_index_cond_func(file, index_cond_func_myisam, this);
+ mi_set_index_cond_func(file, handler_index_cond_check, this);
res= mi_rkey(file, buf, index, key, keypart_map, find_flag);
mi_set_index_cond_func(file, NULL, 0);
return res;
@@ -2346,7 +2324,7 @@ Item *ha_myisam::idx_cond_push(uint keyno_arg, Item* idx_cond_arg)
pushed_idx_cond= idx_cond_arg;
in_range_check_pushed_down= TRUE;
if (active_index == pushed_idx_cond_keyno)
- mi_set_index_cond_func(file, index_cond_func_myisam, this);
+ mi_set_index_cond_func(file, handler_index_cond_check, this);
return NULL;
}