Commit bc0472bd authored by unknown's avatar unknown

wl2240 - ndb partitioning bug fixes for range scans


ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Fix setting of dist keys for ordered indexes
ndb/src/ndbapi/NdbOperationSearch.cpp:
  Remove support for combined distribution key and range scan
sql/ha_ndbcluster.cc:
  Merge error with wl2126
parent 2cafdeb2
......@@ -1950,8 +1950,11 @@ NdbDictInterface::create_index_obj_from_table(NdbIndexImpl** dst,
idx->m_logging = tab->m_logging;
// skip last attribute (NDB$PK or NDB$TNODE)
Uint32 distKeys = 0;
for(unsigned i = 0; i+1<tab->m_columns.size(); i++){
const Uint32 distKeys = prim->m_noOfDistributionKeys;
Uint32 keyCount = (distKeys ? distKeys : prim->m_noOfKeys);
unsigned i;
for(i = 0; i+1<tab->m_columns.size(); i++){
NdbColumnImpl* org = tab->m_columns[i];
NdbColumnImpl* col = new NdbColumnImpl;
......@@ -1969,20 +1972,24 @@ NdbDictInterface::create_index_obj_from_table(NdbIndexImpl** dst,
idx->m_key_ids[key_id] = i;
col->m_keyInfoPos = key_id;
/**
* Fix distribution key stuff for ordered indexes
*/
if(type == NdbDictionary::Index::OrderedIndex)
{
if(primCol->m_distributionKey ||
(prim->m_noOfDistributionKeys == 0 && primCol->getPrimaryKey()))
if(type == NdbDictionary::Index::OrderedIndex &&
(primCol->m_distributionKey ||
(distKeys == 0 && primCol->getPrimaryKey())))
{
distKeys++;
keyCount--;
org->m_distributionKey = 1;
}
}
if(keyCount == 0)
{
tab->m_noOfDistributionKeys = (distKeys ? distKeys : prim->m_noOfKeys);
}
else
{
for(i = 0; i+1<tab->m_columns.size(); i++)
tab->m_columns[i]->m_distributionKey = 0;
}
tab->m_noOfDistributionKeys = distKeys;
* dst = idx;
return 0;
......
......@@ -512,8 +512,10 @@ NdbOperation::handle_distribution_key(const Uint64* value, Uint32 len)
{
setPartitionHash(value, len);
}
else
else if(tSignal->readSignalNumber() == GSN_TCKEYREQ)
{
// No support for combined distribution key and scan
/**
* Copy distribution key to linear memory
*/
......
......@@ -1304,6 +1304,9 @@ inline int ha_ndbcluster::next_result(byte *buf)
int res;
DBUG_ENTER("next_result");
if (!m_active_cursor)
DBUG_RETURN(HA_ERR_END_OF_FILE);
if((res= fetch_next(m_active_cursor)) == 0)
{
DBUG_PRINT("info", ("One more record found"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment