Commit 5d80d3dc authored by Will DeVries's avatar Will DeVries Committed by Sergei Petrunia

Remove last_insert_id field from clustrix_connection.

parent 2070b82f
......@@ -255,7 +255,8 @@ my_ulonglong clustrix_connection::rows_affected()
}
int clustrix_connection::write_row(ulonglong clustrix_table_oid,
uchar *packed_row, size_t packed_size)
uchar *packed_row, size_t packed_size,
ulonglong *last_insert_id)
{
int error_code;
command_length = 0;
......@@ -275,7 +276,7 @@ int clustrix_connection::write_row(ulonglong clustrix_table_oid,
if ((error_code = read_query_response()))
return error_code;
last_insert_id = clustrix_net.insert_id;
*last_insert_id = clustrix_net.insert_id;
return error_code;
}
......
......@@ -40,7 +40,6 @@ class clustrix_connection
bool has_statement_trans;
public:
ulonglong last_insert_id;
clustrix_connection()
: command_buffer(NULL), command_buffer_length(0), command_length(0)
{
......@@ -89,8 +88,8 @@ class clustrix_connection
int run_query(String &stmt);
my_ulonglong rows_affected();
int write_row(ulonglong clustrix_table_oid,
uchar *packed_row, size_t packed_size);
int write_row(ulonglong clustrix_table_oid, uchar *packed_row,
size_t packed_size, ulonglong *last_insert_id);
int key_update(ulonglong clustrix_table_oid,
uchar *packed_key, size_t packed_key_length,
MY_BITMAP *update_set,
......
......@@ -417,12 +417,14 @@ int ha_clustrixdb::write_row(const uchar *buf)
/* XXX: Clustrix may needs to return HA_ERR_AUTOINC_ERANGE if we hit that
error. */
ulonglong last_insert_id = 0;
if ((error_code = trx->write_row(clustrix_table_oid,
packed_new_row, packed_size)))
packed_new_row, packed_size,
&last_insert_id)))
goto err;
if (table->next_number_field)
insert_id_for_cur_row = trx->last_insert_id;
insert_id_for_cur_row = last_insert_id;
err:
if (packed_size)
......
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