Commit 8125c7c2 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

addresses #686

remove extraneous parameter in remove_keys

git-svn-id: file:///svn/mysql/tokudb-engine/src@3862 c7de825b-a66e-492c-adef-691d508d4ae1
parent f97b5a7d
...@@ -1896,8 +1896,6 @@ int ha_tokudb::remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT ...@@ -1896,8 +1896,6 @@ int ha_tokudb::remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT
// Parameters: // Parameters:
// [in] trans - transaction to be used for the delete // [in] trans - transaction to be used for the delete
// [in] record - row in MySQL format. Must delete all keys for this row // [in] record - row in MySQL format. Must delete all keys for this row
// [in] new_record - the data field of primary table that is
// to be deleted
// [in] prim_key - key for record in primary table // [in] prim_key - key for record in primary table
// [in] keys - array that states if a key is set, and hence needs // [in] keys - array that states if a key is set, and hence needs
// removal // removal
...@@ -1905,7 +1903,7 @@ int ha_tokudb::remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT ...@@ -1905,7 +1903,7 @@ int ha_tokudb::remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT
// 0 on success // 0 on success
// error otherwise // error otherwise
// //
int ha_tokudb::remove_keys(DB_TXN * trans, const uchar * record, DBT * new_record, DBT * prim_key, key_map * keys) { int ha_tokudb::remove_keys(DB_TXN * trans, const uchar * record, DBT * prim_key, key_map * keys) {
int result = 0; int result = 0;
for (uint keynr = 0; keynr < table_share->keys + test(hidden_primary_key); keynr++) { for (uint keynr = 0; keynr < table_share->keys + test(hidden_primary_key); keynr++) {
if (keys->is_set(keynr)) { if (keys->is_set(keynr)) {
...@@ -1929,13 +1927,11 @@ int ha_tokudb::remove_keys(DB_TXN * trans, const uchar * record, DBT * new_recor ...@@ -1929,13 +1927,11 @@ int ha_tokudb::remove_keys(DB_TXN * trans, const uchar * record, DBT * new_recor
// //
int ha_tokudb::delete_row(const uchar * record) { int ha_tokudb::delete_row(const uchar * record) {
TOKUDB_DBUG_ENTER("ha_tokudb::delete_row"); TOKUDB_DBUG_ENTER("ha_tokudb::delete_row");
int error; int error = ENOSYS;
DBT row, prim_key; DBT prim_key;
key_map keys = table_share->keys_in_use; key_map keys = table_share->keys_in_use;
statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status); statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status);
if ((error = pack_row(&row, record, 0)))
TOKUDB_DBUG_RETURN((error));
create_key(&prim_key, primary_key, key_buff, record); create_key(&prim_key, primary_key, key_buff, record);
if (hidden_primary_key) if (hidden_primary_key)
keys.set_bit(primary_key); keys.set_bit(primary_key);
...@@ -1944,7 +1940,7 @@ int ha_tokudb::delete_row(const uchar * record) { ...@@ -1944,7 +1940,7 @@ int ha_tokudb::delete_row(const uchar * record) {
case we get a DB_LOCK_DEADLOCK error. */ case we get a DB_LOCK_DEADLOCK error. */
DB_TXN *sub_trans = transaction; DB_TXN *sub_trans = transaction;
for (uint retry = 0; retry < tokudb_trans_retry; retry++) { for (uint retry = 0; retry < tokudb_trans_retry; retry++) {
error = remove_keys(sub_trans, record, &row, &prim_key, &keys); error = remove_keys(sub_trans, record, &prim_key, &keys);
if (error) { if (error) {
DBUG_PRINT("error", ("Got error %d", error)); DBUG_PRINT("error", ("Got error %d", error));
break; // No retry - return error break; // No retry - return error
......
...@@ -126,7 +126,7 @@ class ha_tokudb : public handler { ...@@ -126,7 +126,7 @@ class ha_tokudb : public handler {
DBT *create_key(DBT * key, uint keynr, uchar * buff, const uchar * record, int key_length = MAX_KEY_LENGTH); DBT *create_key(DBT * key, uint keynr, uchar * buff, const uchar * record, int key_length = MAX_KEY_LENGTH);
DBT *pack_key(DBT * key, uint keynr, uchar * buff, const uchar * key_ptr, uint key_length); DBT *pack_key(DBT * key, uint keynr, uchar * buff, const uchar * key_ptr, uint key_length);
int remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT * prim_key); int remove_key(DB_TXN * trans, uint keynr, const uchar * record, DBT * prim_key);
int remove_keys(DB_TXN * trans, const uchar * record, DBT * new_record, DBT * prim_key, key_map * keys); int remove_keys(DB_TXN * trans, const uchar * record, DBT * prim_key, key_map * keys);
int restore_keys(DB_TXN * trans, key_map * changed_keys, uint primary_key, const uchar * old_row, DBT * old_key, const uchar * new_row, DBT * new_key); int restore_keys(DB_TXN * trans, key_map * changed_keys, uint primary_key, const uchar * old_row, DBT * old_key, const uchar * new_row, DBT * new_key);
int key_cmp(uint keynr, const uchar * old_row, const uchar * new_row); int key_cmp(uint keynr, const uchar * old_row, const uchar * new_row);
int update_primary_key(DB_TXN * trans, bool primary_key_changed, const uchar * old_row, DBT * old_key, const uchar * new_row, DBT * prim_key, bool local_using_ignore); int update_primary_key(DB_TXN * trans, bool primary_key_changed, const uchar * old_row, DBT * old_key, const uchar * new_row, DBT * prim_key, bool local_using_ignore);
......
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