~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/row0ins.h

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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. */
23
 
UNIV_INTERN
 
23
 
24
24
ulint
25
25
row_ins_check_foreign_constraint(
26
26
/*=============================*/
39
39
        que_thr_t*      thr);   /* in: query thread */
40
40
/*************************************************************************
41
41
Creates an insert node struct. */
42
 
UNIV_INTERN
 
42
 
43
43
ins_node_t*
44
44
ins_node_create(
45
45
/*============*/
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. */
54
 
UNIV_INTERN
 
54
 
55
55
void
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. */
 
69
 
 
70
ulint
 
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
64
88
record. */
65
 
UNIV_INTERN
 
89
 
66
90
ulint
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. */
 
103
 
 
104
ulint
 
105
row_ins(
 
106
/*====*/
 
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. */
79
 
UNIV_INTERN
 
114
 
80
115
que_thr_t*
81
116
row_ins_step(
82
117
/*=========*/
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. */
87
 
UNIV_INTERN
88
 
void
89
 
ins_node_create_entry_list(
90
 
/*=======================*/
91
 
        ins_node_t*     node);  /* in: row insert node */
92
120
 
93
121
/* Insert node structure */
94
122