Drizzled Public API Documentation

row0ins.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003 Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
00004 
00005 This program is free software; you can redistribute it and/or modify it under
00006 the terms of the GNU General Public License as published by the Free Software
00007 Foundation; version 2 of the License.
00008 
00009 This program is distributed in the hope that it will be useful, but WITHOUT
00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License along with
00014 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
00015 St, Fifth Floor, Boston, MA 02110-1301 USA
00016 
00017 *****************************************************************************/
00018 
00019 /**************************************************/
00026 #pragma once
00027 #ifndef row0ins_h
00028 #define row0ins_h
00029 
00030 #include "univ.i"
00031 #include "data0data.h"
00032 #include "que0types.h"
00033 #include "dict0types.h"
00034 #include "trx0types.h"
00035 #include "row0types.h"
00036 
00037 /***************************************************************/
00043 UNIV_INTERN
00044 ulint
00045 row_ins_check_foreign_constraint(
00046 /*=============================*/
00047   ibool   check_ref,
00050   dict_foreign_t* foreign,
00053   dict_table_t* table,  
00055   dtuple_t* entry,  
00056   que_thr_t*  thr); 
00057 /*********************************************************************/
00060 UNIV_INTERN
00061 ins_node_t*
00062 ins_node_create(
00063 /*============*/
00064   ulint   ins_type, 
00065   dict_table_t* table,    
00066   mem_heap_t* heap);    
00067 /*********************************************************************/
00071 UNIV_INTERN
00072 void
00073 ins_node_set_new_row(
00074 /*=================*/
00075   ins_node_t* node, 
00076   dtuple_t* row); 
00077 /***************************************************************/
00083 UNIV_INTERN
00084 ulint
00085 row_ins_index_entry(
00086 /*================*/
00087   dict_index_t* index,  
00088   dtuple_t* entry,  
00089   ulint   n_ext,  
00090   ibool   foreign,
00092   que_thr_t*  thr); 
00093 /***********************************************************/
00097 UNIV_INTERN
00098 que_thr_t*
00099 row_ins_step(
00100 /*=========*/
00101   que_thr_t*  thr); 
00102 /***********************************************************/
00104 UNIV_INTERN
00105 void
00106 ins_node_create_entry_list(
00107 /*=======================*/
00108   ins_node_t* node);  
00110 /* Insert node structure */
00111 
00112 struct ins_node_struct{
00113   que_common_t  common; 
00114   ulint   ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */
00115   dtuple_t* row;  
00116   dict_table_t* table;  
00117   sel_node_t* select; 
00118   que_node_t* values_list;/* list of expressions to evaluate and
00119         insert in an INS_VALUES insert */
00120   ulint   state;  
00121   dict_index_t* index;  
00123   dtuple_t* entry;  
00126   UT_LIST_BASE_NODE_T(dtuple_t)
00127       entry_list;/* list of entries, one for each index */
00128   byte*   row_id_buf;/* buffer for the row id sys field in row */
00129   trx_id_t  trx_id; 
00131   byte*   trx_id_buf;/* buffer for the trx id sys field in row */
00132   mem_heap_t* entry_sys_heap;
00133         /* memory heap used as auxiliary storage;
00134         entry_list and sys fields are stored here;
00135         if this is NULL, entry list should be created
00136         and buffers for sys fields in row allocated */
00137   ulint   magic_n;
00138 };
00139 
00140 #define INS_NODE_MAGIC_N  15849075
00141 
00142 /* Insert node types */
00143 #define INS_SEARCHED  0 /* INSERT INTO ... SELECT ... */
00144 #define INS_VALUES  1 /* INSERT INTO ... VALUES ... */
00145 #define INS_DIRECT  2 /* this is for internal use in dict0crea:
00146         insert the row directly */
00147 
00148 /* Node execution states */
00149 #define INS_NODE_SET_IX_LOCK  1 /* we should set an IX lock on table */
00150 #define INS_NODE_ALLOC_ROW_ID 2 /* row id should be allocated */
00151 #define INS_NODE_INSERT_ENTRIES 3 /* index entries should be built and
00152           inserted */
00153 
00154 #ifndef UNIV_NONINL
00155 #include "row0ins.ic"
00156 #endif
00157 
00158 #endif