Commit b1000a74 authored by mskold@mysql.com's avatar mskold@mysql.com

Merge mskold@build.mysql.com:/home/bk/mysql-4.1

into mysql.com:/usr/local/home/marty/MySQL/test/mysql-4.1
parents 0cb0ae35 6fc7cef0
...@@ -1959,7 +1959,7 @@ int ha_ndbcluster::index_read(byte *buf, ...@@ -1959,7 +1959,7 @@ int ha_ndbcluster::index_read(byte *buf,
start_key.key= key; start_key.key= key;
start_key.length= key_len; start_key.length= key_len;
start_key.flag= find_flag; 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));
} }
...@@ -2013,10 +2013,25 @@ int ha_ndbcluster::read_range_first(const key_range *start_key, ...@@ -2013,10 +2013,25 @@ int ha_ndbcluster::read_range_first(const key_range *start_key,
const key_range *end_key, const key_range *end_key,
bool eq_range, bool sorted) bool eq_range, bool sorted)
{ {
KEY* key_info;
int error= 1;
byte* buf= table->record[0]; byte* buf= table->record[0];
DBUG_ENTER("ha_ndbcluster::read_range_first"); 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)); DBUG_PRINT("info", ("eq_range: %d, sorted: %d", eq_range, sorted));
if (m_active_cursor) if (m_active_cursor)
......
...@@ -93,6 +93,10 @@ class ha_ndbcluster: public handler ...@@ -93,6 +93,10 @@ class ha_ndbcluster: public handler
int read_range_first(const key_range *start_key, int read_range_first(const key_range *start_key,
const key_range *end_key, const key_range *end_key,
bool eq_range, bool sorted); 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(); int read_range_next();
bool get_error_message(int error, String *buf); bool get_error_message(int error, String *buf);
......
...@@ -1433,9 +1433,9 @@ int handler::read_range_first(const key_range *start_key, ...@@ -1433,9 +1433,9 @@ int handler::read_range_first(const key_range *start_key,
start_key->length, start_key->length,
start_key->flag); start_key->flag);
if (result) if (result)
DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND || DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND)
result == HA_ERR_END_OF_FILE) ? HA_ERR_END_OF_FILE : ? HA_ERR_END_OF_FILE
result); : result);
DBUG_RETURN (compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE); DBUG_RETURN (compare_key(end_range) <= 0 ? 0 : HA_ERR_END_OF_FILE);
} }
......
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