Commit 5827b829 authored by mskold@mysql.com's avatar mskold@mysql.com

Added use of buffer argument in index_read

parent 19a2eced
......@@ -1907,8 +1907,8 @@ int ha_ndbcluster::index_end()
int ha_ndbcluster::index_read(byte *buf,
const byte *key, uint key_len,
enum ha_rkey_function find_flag)
const byte *key, uint key_len,
enum ha_rkey_function find_flag)
{
DBUG_ENTER("index_read");
DBUG_PRINT("enter", ("active_index: %u, key_len: %u, find_flag: %d",
......@@ -1918,7 +1918,7 @@ int ha_ndbcluster::index_read(byte *buf,
start_key.key= key;
start_key.length= key_len;
start_key.flag= find_flag;
DBUG_RETURN(read_range_first(&start_key, NULL, false, true));
DBUG_RETURN(read_range_first_to_buf(&start_key, NULL, false, true, buf));
}
......@@ -1972,10 +1972,25 @@ int ha_ndbcluster::read_range_first(const key_range *start_key,
const key_range *end_key,
bool eq_range, bool sorted)
{
KEY* key_info;
int error= 1;
byte* buf= table->record[0];
DBUG_ENTER("ha_ndbcluster::read_range_first");
DBUG_RETURN(read_range_first_to_buf(start_key,
end_key,
eq_range,
sorted,
buf));
}
inline
int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
const key_range *end_key,
bool eq_range, bool sorted,
byte* buf)
{
KEY* key_info;
int error= 1;
DBUG_ENTER("ha_ndbcluster::read_range_first_to_buf");
DBUG_PRINT("info", ("eq_range: %d, sorted: %d", eq_range, sorted));
if (m_active_cursor)
......
......@@ -93,6 +93,10 @@ class ha_ndbcluster: public handler
int read_range_first(const key_range *start_key,
const key_range *end_key,
bool eq_range, bool sorted);
int read_range_first_to_buf(const key_range *start_key,
const key_range *end_key,
bool eq_range, bool sorted,
byte* buf);
int read_range_next();
bool get_error_message(int error, String *buf);
......
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