summaryrefslogtreecommitdiff
path: root/storage/tokudb/ha_tokudb.cc
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-05-16 14:26:11 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-05-16 14:26:11 +0300
commit97c53cdfcc01a4f47d2757f5ca0b040f0e5a30e5 (patch)
tree66b44791253fe454ced0ae05762cc8b6d001565f /storage/tokudb/ha_tokudb.cc
parentd71df7e1db573e640faab2e1b926a8f7ef1809b6 (diff)
downloadmariadb-git-97c53cdfcc01a4f47d2757f5ca0b040f0e5a30e5.tar.gz
5.6.36-82.0
Diffstat (limited to 'storage/tokudb/ha_tokudb.cc')
-rw-r--r--storage/tokudb/ha_tokudb.cc28
1 files changed, 10 insertions, 18 deletions
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 14d278a47d6..15276f2fb85 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -5254,17 +5254,17 @@ int ha_tokudb::fill_range_query_buf(
DEBUG_SYNC(ha_thd(), "tokudb_icp_asc_scan_out_of_range");
goto cleanup;
} else if (result == ICP_NO_MATCH) {
- // if we are performing a DESC ICP scan and have no end_range
- // to compare to stop using ICP filtering as there isn't much more
- // that we can do without going through contortions with remembering
- // and comparing key parts.
+ // Optimizer change for MyRocks also benefits us here in TokuDB as
+ // opt_range.cc QUICK_SELECT::get_next now sets end_range during
+ // descending scan. We should not ever hit this condition, but
+ // leaving this code in to prevent any possibility of a descending
+ // scan to the beginning of an index and catch any possibility
+ // in debug builds with an assertion
+ assert_debug(!(!end_range && direction < 0));
if (!end_range &&
direction < 0) {
-
cancel_pushed_idx_cond();
- DEBUG_SYNC(ha_thd(), "tokudb_icp_desc_scan_invalidate");
}
-
error = TOKUDB_CURSOR_CONTINUE;
goto cleanup;
}
@@ -6122,7 +6122,6 @@ int ha_tokudb::info(uint flag) {
stats.records = share->row_count() + share->rows_from_locked_table;
stats.deleted = 0;
if (!(flag & HA_STATUS_NO_LOCK)) {
- uint64_t num_rows = 0;
error = txn_begin(db_env, NULL, &txn, DB_READ_UNCOMMITTED, ha_thd());
if (error) {
@@ -6132,20 +6131,13 @@ int ha_tokudb::info(uint flag) {
// we should always have a primary key
assert_always(share->file != NULL);
- error = estimate_num_rows(share->file, &num_rows, txn);
- if (error == 0) {
- share->set_row_count(num_rows, false);
- stats.records = num_rows;
- } else {
- goto cleanup;
- }
-
DB_BTREE_STAT64 dict_stats;
error = share->file->stat64(share->file, txn, &dict_stats);
if (error) {
goto cleanup;
}
-
+ share->set_row_count(dict_stats.bt_ndata, false);
+ stats.records = dict_stats.bt_ndata;
stats.create_time = dict_stats.bt_create_time_sec;
stats.update_time = dict_stats.bt_modify_time_sec;
stats.check_time = dict_stats.bt_verify_time_sec;
@@ -7841,7 +7833,7 @@ ha_rows ha_tokudb::records_in_range(uint keynr, key_range* start_key, key_range*
// As a result, equal may be 0 and greater may actually be equal+greater
// So, we call key_range64 on the key, and the key that is after it.
if (!start_key && !end_key) {
- error = estimate_num_rows(kfile, &rows, transaction);
+ error = estimate_num_rows(share->file, &rows, transaction);
if (error) {
ret_val = HA_TOKUDB_RANGE_COUNT;
goto cleanup;