drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
row0ins.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#pragma once
27#ifndef row0ins_h
28#define row0ins_h
29
30#include "univ.i"
31#include "data0data.h"
32#include "que0types.h"
33#include "dict0types.h"
34#include "trx0types.h"
35#include "row0types.h"
36
37/***************************************************************/
43UNIV_INTERN
44ulint
46/*=============================*/
47 ibool check_ref,
50 dict_foreign_t* foreign,
53 dict_table_t* table,
55 dtuple_t* entry,
56 que_thr_t* thr);
57/*********************************************************************/
60UNIV_INTERN
61ins_node_t*
63/*============*/
64 ulint ins_type,
65 dict_table_t* table,
66 mem_heap_t* heap);
67/*********************************************************************/
71UNIV_INTERN
72void
74/*=================*/
75 ins_node_t* node,
76 dtuple_t* row);
77/***************************************************************/
83UNIV_INTERN
84ulint
86/*================*/
87 dict_index_t* index,
88 dtuple_t* entry,
89 ulint n_ext,
90 ibool foreign,
92 que_thr_t* thr);
93/***********************************************************/
97UNIV_INTERN
98que_thr_t*
100/*=========*/
101 que_thr_t* thr);
102/***********************************************************/
104UNIV_INTERN
105void
107/*=======================*/
108 ins_node_t* node);
109
110/* Insert node structure */
111
113 que_common_t common;
114 ulint ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */
115 dtuple_t* row;
116 dict_table_t* table;
117 sel_node_t* select;
118 que_node_t* values_list;/* list of expressions to evaluate and
119 insert in an INS_VALUES insert */
120 ulint state;
121 dict_index_t* index;
123 dtuple_t* entry;
126 UT_LIST_BASE_NODE_T(dtuple_t)
127 entry_list;/* list of entries, one for each index */
128 byte* row_id_buf;/* buffer for the row id sys field in row */
131 byte* trx_id_buf;/* buffer for the trx id sys field in row */
132 mem_heap_t* entry_sys_heap;
133 /* memory heap used as auxiliary storage;
134 entry_list and sys fields are stored here;
135 if this is NULL, entry list should be created
136 and buffers for sys fields in row allocated */
137 ulint magic_n;
138};
139
140#define INS_NODE_MAGIC_N 15849075
141
142/* Insert node types */
143#define INS_SEARCHED 0 /* INSERT INTO ... SELECT ... */
144#define INS_VALUES 1 /* INSERT INTO ... VALUES ... */
145#define INS_DIRECT 2 /* this is for internal use in dict0crea:
146 insert the row directly */
147
148/* Node execution states */
149#define INS_NODE_SET_IX_LOCK 1 /* we should set an IX lock on table */
150#define INS_NODE_ALLOC_ROW_ID 2 /* row id should be allocated */
151#define INS_NODE_INSERT_ENTRIES 3 /* index entries should be built and
152 inserted */
153
154#ifndef UNIV_NONINL
155#include "row0ins.ic"
156#endif
157
158#endif
UNIV_INTERN ulint row_ins_index_entry(dict_index_t *index, dtuple_t *entry, ulint n_ext, ibool foreign, que_thr_t *thr)
Definition row0ins.cc:2151
UNIV_INTERN que_thr_t * row_ins_step(que_thr_t *thr)
Definition row0ins.cc:2414
UNIV_INTERN void ins_node_create_entry_list(ins_node_t *node)
Definition row0ins.cc:103
UNIV_INTERN ulint row_ins_check_foreign_constraint(ibool check_ref, dict_foreign_t *foreign, dict_table_t *table, dtuple_t *entry, que_thr_t *thr)
Definition row0ins.cc:1187
UNIV_INTERN ins_node_t * ins_node_create(ulint ins_type, dict_table_t *table, mem_heap_t *heap)
Definition row0ins.cc:69
UNIV_INTERN void ins_node_set_new_row(ins_node_t *node, dtuple_t *row)
Definition row0ins.cc:186
dtuple_t * entry
Definition row0ins.h:123
sel_node_t * select
Definition row0ins.h:117
dict_table_t * table
Definition row0ins.h:116
trx_id_t trx_id
Definition row0ins.h:129
dict_index_t * index
Definition row0ins.h:121
que_common_t common
Definition row0ins.h:113
dtuple_t * row
Definition row0ins.h:115
ib_id_t trx_id_t
Definition trx0types.h:85
#define UT_LIST_BASE_NODE_T(TYPE)
Definition ut0lst.h:54