Commit c8600532 authored by Will DeVries's avatar Will DeVries Committed by Sergei Petrunia

Add a partial key parameter to the scan from key command.

This patch does not implement support for partial keys, it just adds the
parameter for the Clustrix command.
parent e13e6a6e
......@@ -757,10 +757,9 @@ int clustrix_connection::update_query(String &stmt, LEX_CSTRING &dbname,
int clustrix_connection::scan_from_key(ulonglong clustrix_table_oid, uint index,
clustrix_lock_mode_t lock_mode,
enum scan_type scan_dir,
bool sorted_scan, MY_BITMAP *read_set,
uchar *packed_key,
ulong packed_key_length,
ushort row_req,
int no_key_cols, bool sorted_scan,
MY_BITMAP *read_set, uchar *packed_key,
ulong packed_key_length, ushort row_req,
clustrix_connection_cursor **scan)
{
int error_code;
......@@ -788,6 +787,9 @@ int clustrix_connection::scan_from_key(ulonglong clustrix_table_oid, uint index,
if ((error_code = add_command_operand_uchar(scan_dir)))
return error_code;
if ((error_code = add_command_operand_uint(no_key_cols)))
return error_code;
if ((error_code = add_command_operand_uchar(sorted_scan)))
return error_code;
......
......@@ -133,7 +133,7 @@ class clustrix_connection
int update_query(String &stmt, LEX_CSTRING &dbname, ulonglong *affected_rows);
int scan_from_key(ulonglong clustrix_table_oid, uint index,
clustrix_lock_mode_t lock_mode,
enum scan_type scan_dir, bool sorted_scan,
enum scan_type scan_dir, int no_key_cols, bool sorted_scan,
MY_BITMAP *read_set, uchar *packed_key,
ulong packed_key_length, ushort row_req,
clustrix_connection_cursor **scan);
......
......@@ -642,7 +642,8 @@ ulong ha_clustrixdb::index_flags(uint idx, uint part, bool all_parts) const
{
ulong flags = HA_READ_NEXT |
HA_READ_PREV |
HA_READ_ORDER;
HA_READ_ORDER |
HA_READ_RANGE;
return flags;
}
......@@ -787,7 +788,7 @@ int ha_clustrixdb::index_read(uchar * buf, const uchar * key, uint key_len,
} else {
is_scan = true;
error_code = trx->scan_from_key(clustrix_table_oid, active_index,
clx_lock_type, st, sorted_scan,
clx_lock_type, st, -1, sorted_scan,
&scan_fields, packed_key, packed_key_len,
THDVAR(thd, row_buffer), &scan_cur);
if (!error_code)
......@@ -818,7 +819,7 @@ int ha_clustrixdb::index_first(uchar *buf)
error_code = trx->scan_from_key(clustrix_table_oid, active_index,
clx_lock_type,
clustrix_connection::READ_FROM_START,
sorted_scan, &scan_fields, NULL, 0,
-1, sorted_scan, &scan_fields, NULL, 0,
THDVAR(thd, row_buffer), &scan_cur);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
......@@ -842,7 +843,7 @@ int ha_clustrixdb::index_last(uchar *buf)
error_code = trx->scan_from_key(clustrix_table_oid, active_index,
clx_lock_type,
clustrix_connection::READ_FROM_LAST,
sorted_scan, &scan_fields, NULL, 0,
-1, sorted_scan, &scan_fields, NULL, 0,
THDVAR(thd, row_buffer), &scan_cur);
if (error_code == HA_ERR_TABLE_DEF_CHANGED)
......
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