Commit 6c8cd22f authored by Will DeVries's avatar Will DeVries Committed by Sergei Petrunia

Rename some functions and fix formating issues.

parent a336cb20
......@@ -23,12 +23,12 @@ static const char charset_name[] = "utf8";
enum clustrix_commands {
CLUSTRIX_WRITE_ROW = 1,
CLUSTRIX_SCAN_INIT,
CLUSTRIX_SCAN_TABLE,
CLUSTRIX_SCAN_NEXT,
CLUSTRIX_SCAN_STOP,
CLUSTRIX_KEY_READ,
CLUSTRIX_KEY_DELETE,
CLUSTRIX_QUERY_INIT
CLUSTRIX_SCAN_QUERY
};
/****************************************************************************
......@@ -316,14 +316,14 @@ int clustrix_connection::key_read(ulonglong clustrix_table_oid, uint index,
return 0;
}
int clustrix_connection::scan_init(ulonglong clustrix_table_oid, uint index,
enum sort_order sort, MY_BITMAP *read_set,
ulonglong *scan_refid)
int clustrix_connection::scan_table(ulonglong clustrix_table_oid, uint index,
enum sort_order sort, MY_BITMAP *read_set,
ulonglong *scan_refid)
{
int error_code;
command_length = 0;
if ((error_code = add_command_operand_uchar(CLUSTRIX_SCAN_INIT)))
if ((error_code = add_command_operand_uchar(CLUSTRIX_SCAN_TABLE)))
return error_code;
if ((error_code = add_command_operand_ulonglong(clustrix_table_oid)))
......@@ -367,15 +367,16 @@ int clustrix_connection::scan_init(ulonglong clustrix_table_oid, uint index,
* scan_refid id used to reference this scan later
* Used in pushdowns to initiate query scan.
**/
int clustrix_connection::scan_query_init(String &stmt, uchar *fieldtype,
uint fields, uchar *null_bits,
uint null_bits_size, uchar *field_metadata,
uint field_metadata_size, ulonglong *scan_refid)
int clustrix_connection::scan_query(String &stmt, uchar *fieldtype, uint fields,
uchar *null_bits, uint null_bits_size,
uchar *field_metadata,
uint field_metadata_size,
ulonglong *scan_refid)
{
int error_code;
command_length = 0;
if ((error_code = add_command_operand_uchar(CLUSTRIX_QUERY_INIT)))
if ((error_code = add_command_operand_uchar(CLUSTRIX_SCAN_QUERY)))
return error_code;
if ((error_code = add_command_operand_str((uchar*)stmt.ptr(), stmt.length())))
......
......@@ -93,15 +93,14 @@ class clustrix_connection
uchar **rowdata, ulong *rowdata_length);
enum sort_order {SORT_NONE = 0, SORT_ASC = 1, SORT_DESC = 2};
int scan_init(ulonglong clustrix_table_oid, uint index,
enum sort_order sort, MY_BITMAP *read_set,
ulonglong *scan_refid);
int scan_table(ulonglong clustrix_table_oid, uint index,
enum sort_order sort, MY_BITMAP *read_set,
ulonglong *scan_refid);
int scan_next(ulonglong scan_refid, uchar **rowdata, ulong *rowdata_length);
int scan_end(ulonglong scan_refid);
int scan_query_init(String &stmt, uchar *fieldtype,
uint fields, uchar *null_bits,
uint null_bits_size, uchar *field_metadata,
uint field_metadata_size, ulonglong *scan_refid);
int scan_query(String &stmt, uchar *fieldtype, uint fields, uchar *null_bits,
uint null_bits_size, uchar *field_metadata,
uint field_metadata_size, ulonglong *scan_refid);
int populate_table_list(LEX_CSTRING *db, handlerton::discovered_list *result);
int discover_table_details(LEX_CSTRING *db, LEX_CSTRING *name, THD *thd,
......
......@@ -586,9 +586,9 @@ int ha_clustrixdb::index_first(uchar *buf)
bitmap_set_all(&scan_fields);
#endif
if ((error_code = trx->scan_init(clustrix_table_oid, active_index,
clustrix_connection::SORT_NONE, &scan_fields,
&scan_refid)))
if ((error_code = trx->scan_table(clustrix_table_oid, active_index,
clustrix_connection::SORT_NONE,
&scan_fields, &scan_refid)))
return error_code;
......@@ -619,9 +619,9 @@ int ha_clustrixdb::index_last(uchar *buf)
bitmap_set_all(&scan_fields);
#endif
if ((error_code = trx->scan_init(clustrix_table_oid, active_index,
clustrix_connection::SORT_NONE, &scan_fields,
&scan_refid)))
if ((error_code = trx->scan_table(clustrix_table_oid, active_index,
clustrix_connection::SORT_NONE,
&scan_fields, &scan_refid)))
return error_code;
......@@ -686,9 +686,9 @@ int ha_clustrixdb::rnd_init(bool scan)
bitmap_set_all(&scan_fields);
#endif
if ((error_code = trx->scan_init(clustrix_table_oid, 0,
clustrix_connection::SORT_NONE, &scan_fields,
&scan_refid)))
if ((error_code = trx->scan_table(clustrix_table_oid, 0,
clustrix_connection::SORT_NONE,
&scan_fields, &scan_refid)))
return error_code;
return 0;
......
......@@ -128,7 +128,7 @@ create_clustrixdb_select_handler(THD* thd, SELECT_LEX* select_lex)
if (!trx)
goto err;
if ((error_code = trx->scan_query_init(query, fieldtype, items_number,
if ((error_code = trx->scan_query(query, fieldtype, items_number,
null_bits, num_null_bytes, field_metadata, field_metadata_size, &scan_refid))) {
goto err;
}
......@@ -312,7 +312,7 @@ create_clustrixdb_derived_handler(THD* thd, TABLE_LIST *derived)
if (!trx)
goto err;
if ((error_code = trx->scan_query_init(query, fieldtype, items_number,
if ((error_code = trx->scan_query(query, fieldtype, items_number,
null_bits, num_null_bytes, field_metadata, field_metadata_size, &scan_refid))) {
goto err;
}
......
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