Skip to content

Commit 0763181

Browse files
committed
Bug#31216680 REMOVE UNUSED G_NDB_RECORDS_IN_RANGE_TREE_DIVE VARIABLE
The variable "g_ndb_records_in_range_tree_dive" and related code has been in the ndbcluster source code since 2011. The variable has been hardcoded to false and thus the related code has never been executed. Remove "g_ndb_records_in_range_tree_dive" and related code. Change-Id: I4752a282410fccebddbe2cecb086feac340f6b20
1 parent c79aeec commit 0763181

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

storage/ndb/plugin/ha_ndbcluster.cc

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
#include "storage/ndb/include/ndb_global.h"
5353
#include "storage/ndb/include/ndb_version.h"
5454
#include "storage/ndb/include/ndbapi/NdbApi.hpp"
55-
#include "storage/ndb/include/ndbapi/NdbIndexStat.hpp"
56-
#include "storage/ndb/include/ndbapi/NdbInterpretedCode.hpp"
5755
#include "storage/ndb/include/util/SparseBitmask.hpp"
5856
#include "storage/ndb/plugin/ha_ndb_index_stat.h"
5957
#include "storage/ndb/plugin/ha_ndbcluster_binlog.h"
@@ -12553,12 +12551,6 @@ void ha_ndbcluster::set_tabname(const char *path_name) {
1255312551
ndb_set_tabname(path_name, m_tabname);
1255412552
}
1255512553

12556-
/*
12557-
If there are no stored stats, should we do a tree-dive on all db
12558-
nodes. The result is fairly good but does mean a round-trip.
12559-
*/
12560-
static const bool g_ndb_records_in_range_tree_dive = false;
12561-
1256212554
/* Determine roughly how many records are in the range specified */
1256312555
ha_rows ha_ndbcluster::records_in_range(uint inx, key_range *min_key,
1256412556
key_range *max_key) {
@@ -12615,41 +12607,6 @@ ha_rows ha_ndbcluster::records_in_range(uint inx, key_range *min_key,
1261512607
}
1261612608
/*fall through*/
1261712609
}
12618-
12619-
if (g_ndb_records_in_range_tree_dive) {
12620-
NDB_INDEX_DATA &d = m_index[inx];
12621-
const NDBINDEX *index = d.index;
12622-
Ndb *ndb = get_ndb(thd);
12623-
NdbTransaction *active_trans = m_thd_ndb ? m_thd_ndb->trans : 0;
12624-
NdbTransaction *trans = NULL;
12625-
int res = 0;
12626-
Uint64 rows;
12627-
12628-
do {
12629-
if ((trans = active_trans) == NULL ||
12630-
trans->commitStatus() != NdbTransaction::Started) {
12631-
DBUG_PRINT("info", ("no active trans"));
12632-
if (!(trans = ndb->startTransaction()))
12633-
ERR_BREAK(ndb->getNdbError(), res);
12634-
}
12635-
12636-
/* Create an IndexBound struct for the keys */
12637-
NdbIndexScanOperation::IndexBound ib;
12638-
compute_index_bounds(ib, key_info, min_key, max_key, 0);
12639-
12640-
ib.range_no = 0;
12641-
12642-
NdbIndexStat is;
12643-
if (is.records_in_range(index, trans, d.ndb_record_key, m_ndb_record,
12644-
&ib, 0, &rows, 0) == -1)
12645-
ERR_BREAK(is.getNdbError(), res);
12646-
} while (0);
12647-
12648-
if (trans != active_trans && rows == 0) rows = 1;
12649-
if (trans != active_trans && trans != NULL) ndb->closeTransaction(trans);
12650-
if (res == 0) return rows;
12651-
/*fall through*/
12652-
}
1265312610
}
1265412611

1265512612
/* Use simple heuristics to estimate fraction

0 commit comments

Comments
 (0)