Commit e7010683 authored by marko's avatar marko

branches/zip: Fix some minor things in row0uins.c after comparing to trunk.

Replace row0merge.h with row0mysql.h.

Remove redundant test trx->dict_operation_lock_mode == 0.
Fix typos in comments.

row_undo_ins(): Make the function more similar to the one in trunk.
parent efb74613
...@@ -28,7 +28,7 @@ Created 2/25/1997 Heikki Tuuri ...@@ -28,7 +28,7 @@ Created 2/25/1997 Heikki Tuuri
#include "que0que.h" #include "que0que.h"
#include "ibuf0ibuf.h" #include "ibuf0ibuf.h"
#include "log0log.h" #include "log0log.h"
#include "row0merge.h" #include "row0mysql.h"
/******************************************************************* /*******************************************************************
Removes a clustered index record. The pcur in node was positioned on the Removes a clustered index record. The pcur in node was positioned on the
...@@ -65,8 +65,7 @@ row_undo_ins_remove_clust_rec( ...@@ -65,8 +65,7 @@ row_undo_ins_remove_clust_rec(
thawed_dictionary = TRUE; thawed_dictionary = TRUE;
} }
if (trx->dict_operation_lock_mode == 0 if (trx->dict_operation_lock_mode != RW_X_LATCH) {
|| trx->dict_operation_lock_mode != RW_X_LATCH) {
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
...@@ -295,8 +294,8 @@ row_undo_ins_parse_undo_rec( ...@@ -295,8 +294,8 @@ row_undo_ins_parse_undo_rec(
trx = node->trx; trx = node->trx;
/* If it's sytem table then we have to acquire the /* If it is a system table, acquire the
dictionary lock in X mode.*/ dictionary lock in exclusive mode. */
if (ut_dulint_cmp(table_id, DICT_FIELDS_ID) <= 0) { if (ut_dulint_cmp(table_id, DICT_FIELDS_ID) <= 0) {
if (trx->dict_operation_lock_mode == RW_S_LATCH) { if (trx->dict_operation_lock_mode == RW_S_LATCH) {
...@@ -305,8 +304,7 @@ row_undo_ins_parse_undo_rec( ...@@ -305,8 +304,7 @@ row_undo_ins_parse_undo_rec(
thawed_dictionary = TRUE; thawed_dictionary = TRUE;
} }
if (trx->dict_operation_lock_mode == 0 if (trx->dict_operation_lock_mode != RW_X_LATCH) {
|| trx->dict_operation_lock_mode != RW_X_LATCH) {
row_mysql_lock_data_dictionary(trx); row_mysql_lock_data_dictionary(trx);
...@@ -351,8 +349,6 @@ row_undo_ins( ...@@ -351,8 +349,6 @@ row_undo_ins(
/* out: DB_SUCCESS or DB_OUT_OF_FILE_SPACE */ /* out: DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
undo_node_t* node) /* in: row undo node */ undo_node_t* node) /* in: row undo node */
{ {
ulint err = DB_SUCCESS;
ut_ad(node); ut_ad(node);
ut_ad(node->state == UNDO_NODE_INSERT); ut_ad(node->state == UNDO_NODE_INSERT);
...@@ -362,38 +358,38 @@ row_undo_ins( ...@@ -362,38 +358,38 @@ row_undo_ins(
if (node->rec_type == TRX_UNDO_DICTIONARY_REC) { if (node->rec_type == TRX_UNDO_DICTIONARY_REC) {
err = row_undo_build_dict_undo_list(node); return(row_undo_build_dict_undo_list(node));
} else if (!node->table || !row_undo_search_clust_to_pcur(node)) { }
if (!node->table || !row_undo_search_clust_to_pcur(node)) {
trx_undo_rec_release(node->trx, node->undo_no); trx_undo_rec_release(node->trx, node->undo_no);
} else { return(DB_SUCCESS);
}
/* Iterate over all the indexes and undo the insert.*/
/* Skip the clustered index (the first index) */ /* Iterate over all the indexes and undo the insert.*/
node->index = dict_table_get_next_index(
dict_table_get_first_index(node->table));
while (node->index != NULL) { /* Skip the clustered index (the first index) */
dtuple_t* entry; node->index = dict_table_get_next_index(
dict_table_get_first_index(node->table));
entry = row_build_index_entry(node->row, node->ext, while (node->index != NULL) {
node->index, node->heap); dtuple_t* entry;
ulint err;
err = row_undo_ins_remove_sec(node->index, entry); entry = row_build_index_entry(node->row, node->ext,
node->index, node->heap);
if (err != DB_SUCCESS) { err = row_undo_ins_remove_sec(node->index, entry);
return(err); if (err != DB_SUCCESS) {
}
node->index = dict_table_get_next_index(node->index); return(err);
} }
err = row_undo_ins_remove_clust_rec(node); node->index = dict_table_get_next_index(node->index);
} }
return(err); return(row_undo_ins_remove_clust_rec(node));
} }
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