1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Fixed bugs in ordered scan discovered by mysql-test-run

Enabled ordered scan in handler



ndb/include/ndbapi/NdbIndexScanOperation.hpp:
  Moved saveBound to NdbIndexScanOperation
ndb/include/ndbapi/NdbScanOperation.hpp:
  Moved saveBound to NdbIndexScanOperation
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Introduced map for
  index attributes (keys) -> real attr id (and back)
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  Introduced map for
  index attributes (keys) -> real attr id (and back)
ndb/src/ndbapi/NdbOperationDefine.cpp:
  Moved saveBound to NdbIndexScanOperation
ndb/src/ndbapi/NdbOperationInt.cpp:
  Moved saveBound to NdbIndexScanOperation
ndb/src/ndbapi/NdbScanOperation.cpp:
  Moved saveBound to NdbIndexScanOperation
  Fixed bugs in handling of setBounds w.r.t getValues and index keys
    (use new reverse map)
  Fixed bugs in next_result_ordered
sql/ha_ndbcluster.cc:
  Use sorted scan when requested
This commit is contained in:
unknown
2004-07-05 20:41:06 +02:00
parent 8aac8515fb
commit 3f3ea3037a
8 changed files with 100 additions and 60 deletions

View File

@@ -1737,8 +1737,8 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
return 0;
}
NdbTableImpl* primTab = getTable(tab->m_primaryTable.c_str());
if(primTab == 0){
NdbTableImpl* prim = getTable(tab->m_primaryTable.c_str());
if(prim == 0){
m_error.code = 4243;
return 0;
}
@@ -1752,7 +1752,7 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
idx->m_indexId = tab->m_tableId;
idx->m_internalName.assign(internalName);
idx->m_externalName.assign(externalName);
idx->m_tableName.assign(primTab->m_externalName);
idx->m_tableName.assign(prim->m_externalName);
idx->m_type = tab->m_indexType;
// skip last attribute (NDB$PK or NDB$TNODE)
for(unsigned i = 0; i+1<tab->m_columns.size(); i++){
@@ -1760,6 +1760,14 @@ NdbDictionaryImpl::getIndexImpl(const char * externalName,
// Copy column definition
*col = *tab->m_columns[i];
idx->m_columns.push_back(col);
/**
* reverse map
*/
int key_id = prim->getColumn(col->getName())->getColumnNo();
int fill = -1;
idx->m_key_ids.fill(key_id, fill);
idx->m_key_ids[key_id] = i;
col->m_keyInfoPos = key_id;
}
idx->m_table = tab;