20
20
Checks if foreign key constraint fails for an index entry. Sets shared locks
21
21
which lock either the success or the failure of the constraint. NOTE that
22
22
the caller must have a shared latch on dict_foreign_key_check_lock. */
25
25
row_ins_check_foreign_constraint(
26
26
/*=============================*/
51
51
Sets a new row to insert for an INS_DIRECT node. This function is only used
52
52
if we have constructed the row separately, which is a rare case; this
53
53
function is quite slow. */
56
56
ins_node_set_new_row(
57
57
/*=================*/
58
58
ins_node_t* node, /* in: insert node */
59
59
dtuple_t* row); /* in: new row (or first row) for the node */
60
60
/*******************************************************************
61
Tries to insert an index entry to an index. If the index is clustered
62
and a record with the same unique key is found, the other record is
63
necessarily marked deleted by a committed transaction, or a unique key
64
violation error occurs. The delete marked record is then updated to an
65
existing record, and we must write an undo log record on the delete
66
marked record. If the index is secondary, and a record with exactly the
67
same fields is found, the other record is necessarily marked deleted.
68
It is then unmarked. Otherwise, the entry is just inserted to the index. */
71
row_ins_index_entry_low(
72
/*====================*/
73
/* out: DB_SUCCESS, DB_LOCK_WAIT, DB_FAIL
74
if pessimistic retry needed, or error code */
75
ulint mode, /* in: BTR_MODIFY_LEAF or BTR_MODIFY_TREE,
76
depending on whether we wish optimistic or
77
pessimistic descent down the index tree */
78
dict_index_t* index, /* in: index */
79
dtuple_t* entry, /* in: index entry to insert */
80
ulint* ext_vec,/* in: array containing field numbers of
81
externally stored fields in entry, or NULL */
82
ulint n_ext_vec,/* in: number of fields in ext_vec */
83
que_thr_t* thr); /* in: query thread */
84
/*******************************************************************
61
85
Inserts an index entry to index. Tries first optimistic, then pessimistic
62
86
descent down the tree. If the entry matches enough to a delete marked record,
63
87
performs the insert by updating or delete unmarking the delete marked
67
91
row_ins_index_entry(
68
92
/*================*/
70
94
DB_DUPLICATE_KEY, or some other error code */
71
95
dict_index_t* index, /* in: index */
72
96
dtuple_t* entry, /* in: index entry to insert */
73
ulint n_ext, /* in: number of externally stored columns */
74
ibool foreign,/* in: TRUE=check foreign key constraints */
97
ulint* ext_vec,/* in: array containing field numbers of
98
externally stored fields in entry, or NULL */
99
ulint n_ext_vec,/* in: number of fields in ext_vec */
100
que_thr_t* thr); /* in: query thread */
101
/***************************************************************
102
Inserts a row to a table. */
107
/* out: DB_SUCCESS if operation successfully
108
completed, else error code or DB_LOCK_WAIT */
109
ins_node_t* node, /* in: row insert node */
75
110
que_thr_t* thr); /* in: query thread */
76
111
/***************************************************************
77
112
Inserts a row to a table. This is a high-level function used in
78
113
SQL execution graphs. */
83
118
/* out: query thread to run next or NULL */
84
119
que_thr_t* thr); /* in: query thread */
85
/***************************************************************
86
Creates an entry template for each index of a table. */
89
ins_node_create_entry_list(
90
/*=======================*/
91
ins_node_t* node); /* in: row insert node */
93
121
/* Insert node structure */