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