~mysql/mysql-server/mysql-6.0

« back to all changes in this revision

Viewing changes to innobase/include/dict0crea.h

  • Committer: monty at mysql
  • Date: 2001-02-17 12:19:19 UTC
  • mto: (554.1.1)
  • mto: This revision was merged to the branch mainline in revision 556.
  • Revision ID: sp1r-monty@donna.mysql.com-20010217121919-07904
Added Innobase to source distribution

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************
 
2
Database object creation
 
3
 
 
4
(c) 1996 Innobase Oy
 
5
 
 
6
Created 1/8/1996 Heikki Tuuri
 
7
*******************************************************/
 
8
 
 
9
#ifndef dict0crea_h
 
10
#define dict0crea_h
 
11
 
 
12
#include "univ.i"
 
13
#include "dict0types.h"
 
14
#include "dict0dict.h"
 
15
#include "que0types.h"
 
16
#include "row0types.h"
 
17
#include "mtr0mtr.h"
 
18
                                        
 
19
/*************************************************************************
 
20
Creates the default clustered index for a table: the records are ordered
 
21
by row id. */
 
22
 
 
23
void
 
24
dict_create_default_index(
 
25
/*======================*/
 
26
        dict_table_t*   table,  /* in: table */
 
27
        trx_t*          trx);   /* in: transaction handle */
 
28
/*************************************************************************
 
29
Creates a table create graph. */
 
30
 
 
31
tab_node_t*
 
32
tab_create_graph_create(
 
33
/*====================*/
 
34
                                /* out, own: table create node */
 
35
        dict_table_t*   table,  /* in: table to create, built as a memory data
 
36
                                structure */
 
37
        mem_heap_t*     heap);  /* in: heap where created */
 
38
/*************************************************************************
 
39
Creates an index create graph. */
 
40
 
 
41
ind_node_t*
 
42
ind_create_graph_create(
 
43
/*====================*/
 
44
                                /* out, own: index create node */
 
45
        dict_index_t*   index,  /* in: index to create, built as a memory data
 
46
                                structure */
 
47
        mem_heap_t*     heap);  /* in: heap where created */
 
48
/***************************************************************
 
49
Creates a table. This is a high-level function used in SQL execution graphs. */
 
50
 
 
51
que_thr_t*
 
52
dict_create_table_step(
 
53
/*===================*/
 
54
                                /* out: query thread to run next or NULL */
 
55
        que_thr_t*      thr);   /* in: query thread */
 
56
/***************************************************************
 
57
Creates an index. This is a high-level function used in SQL execution
 
58
graphs. */
 
59
 
 
60
que_thr_t*
 
61
dict_create_index_step(
 
62
/*===================*/
 
63
                                /* out: query thread to run next or NULL */
 
64
        que_thr_t*      thr);   /* in: query thread */
 
65
/***********************************************************************
 
66
Drops the index tree associated with a row in SYS_INDEXES table. */
 
67
 
 
68
void
 
69
dict_drop_index_tree(
 
70
/*=================*/
 
71
        rec_t*  rec,    /* in: record in the clustered index of SYS_INDEXES
 
72
                        table */
 
73
        mtr_t*  mtr);   /* in: mtr having the latch on the record page */
 
74
 
 
75
 
 
76
/* Table create node structure */
 
77
 
 
78
struct tab_node_struct{
 
79
        que_common_t    common; /* node type: QUE_NODE_TABLE_CREATE */
 
80
        dict_table_t*   table;  /* table to create, built as a memory data
 
81
                                structure with dict_mem_... functions */
 
82
        ins_node_t*     tab_def; /* child node which does the insert of
 
83
                                the table definition; the row to be inserted
 
84
                                is built by the parent node  */
 
85
        ins_node_t*     col_def; /* child node which does the inserts of
 
86
                                the column definitions; the row to be inserted
 
87
                                is built by the parent node  */
 
88
        commit_node_t*  commit_node;
 
89
                                /* child node which performs a commit after
 
90
                                a successful table creation */
 
91
        /*----------------------*/
 
92
        /* Local storage for this graph node */
 
93
        ulint           state;  /* node execution state */
 
94
        ulint           col_no; /* next column definition to insert */
 
95
        mem_heap_t*     heap;   /* memory heap used as auxiliary storage */
 
96
};
 
97
 
 
98
/* Table create node states */
 
99
#define TABLE_BUILD_TABLE_DEF   1
 
100
#define TABLE_BUILD_COL_DEF     2
 
101
#define TABLE_COMMIT_WORK       3
 
102
#define TABLE_ADD_TO_CACHE      4
 
103
#define TABLE_COMPLETED         5
 
104
 
 
105
/* Index create node struct */
 
106
 
 
107
struct ind_node_struct{
 
108
        que_common_t    common; /* node type: QUE_NODE_INDEX_CREATE */
 
109
        dict_index_t*   index;  /* index to create, built as a memory data
 
110
                                structure with dict_mem_... functions */
 
111
        ins_node_t*     ind_def; /* child node which does the insert of
 
112
                                the index definition; the row to be inserted
 
113
                                is built by the parent node  */
 
114
        ins_node_t*     field_def; /* child node which does the inserts of
 
115
                                the field definitions; the row to be inserted
 
116
                                is built by the parent node  */
 
117
        commit_node_t*  commit_node;
 
118
                                /* child node which performs a commit after
 
119
                                a successful index creation */
 
120
        /*----------------------*/
 
121
        /* Local storage for this graph node */
 
122
        ulint           state;  /* node execution state */
 
123
        dict_table_t*   table;  /* table which owns the index */
 
124
        dtuple_t*       ind_row;/* index definition row built */
 
125
        ulint           field_no;/* next field definition to insert */
 
126
        mem_heap_t*     heap;   /* memory heap used as auxiliary storage */
 
127
};
 
128
 
 
129
/* Index create node states */
 
130
#define INDEX_BUILD_INDEX_DEF   1
 
131
#define INDEX_BUILD_FIELD_DEF   2
 
132
#define INDEX_CREATE_INDEX_TREE 3
 
133
#define INDEX_COMMIT_WORK       4
 
134
#define INDEX_ADD_TO_CACHE      5
 
135
 
 
136
#ifndef UNIV_NONINL
 
137
#include "dict0crea.ic"
 
138
#endif
 
139
 
 
140
#endif