diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 75de1ac4a7ffe6b330378de422c6baab8622bf5e..1441e53e935e12ac550568565aee7df4bd6d5455 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -205,4 +205,10 @@ a b c select * from t1 where b<=5 and c=0 or b<=5 and c=2; a b c 19 4 0 +select count(*) from t1 where b = 0; +count(*) +0 +select count(*) from t1 where b = 1; +count(*) +1 drop table t1; diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 3def52e865c67d86ddaad2238ac196ca4ea08655..cffe9236fb5dd5f1d44d92f47ca2b917b06a0891 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -113,6 +113,9 @@ select * from t1 where b<=5 and c=0; select * from t1 where b=4 and c<=5 order by a; select * from t1 where b<=4 and c<=5 order by a; select * from t1 where b<=5 and c=0 or b<=5 and c=2; + +select count(*) from t1 where b = 0; +select count(*) from t1 where b = 1; drop table t1; # diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 52cb4cecb0228f23c356f5608a770960ec6f8705..0aa40f968bb3aff282db65aa82dc8fbc5cf92a2a 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -1188,13 +1188,11 @@ NdbIndexScanOperation::fix_get_values(){ for(Uint32 i = 0; i<cnt; i++){ Uint32 val = theTupleKeyDefined[i][0]; switch(val){ - case FAKE_PTR:{ - NdbColumnImpl * key = idx->m_columns[i]; - NdbColumnImpl * col = tab->getColumn(key->m_keyInfoPos); - curr->setup(col, 0); - } - break; + case FAKE_PTR: + curr->setup(curr->m_column, 0); case API_PTR: + curr = curr->next(); + break; case SETBOUND_EQ: break; #ifdef VM_TRACE @@ -1202,7 +1200,6 @@ NdbIndexScanOperation::fix_get_values(){ abort(); #endif } - curr = curr->next(); } }