~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/row0mysql.h

  • Committer: Eric Day
  • Date: 2009-10-31 21:53:33 UTC
  • mfrom: (1200 staging)
  • mto: This revision was merged to the branch mainline in revision 1202.
  • Revision ID: eday@oddments.org-20091031215333-j94bjoanwmi68p6f
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/******************************************************
 
19
/**************************************************//**
 
20
@file include/row0mysql.h
20
21
Interface between Innobase row operations and MySQL.
21
22
Contains also create table and other data dictionary operations.
22
23
 
39
40
 
40
41
typedef struct row_prebuilt_struct row_prebuilt_t;
41
42
 
42
 
/***********************************************************************
 
43
/*******************************************************************//**
43
44
Frees the blob heap in prebuilt when no longer needed. */
44
45
UNIV_INTERN
45
46
void
46
47
row_mysql_prebuilt_free_blob_heap(
47
48
/*==============================*/
48
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct of a
 
49
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct of a
49
50
                                        ha_innobase:: table handle */
50
 
/***********************************************************************
 
51
/*******************************************************************//**
51
52
Stores a >= 5.0.3 format true VARCHAR length to dest, in the MySQL row
52
 
format. */
 
53
format.
 
54
@return pointer to the data, we skip the 1 or 2 bytes at the start
 
55
that are used to store the len */
53
56
UNIV_INTERN
54
57
byte*
55
58
row_mysql_store_true_var_len(
56
59
/*=========================*/
57
 
                        /* out: pointer to the data, we skip the 1 or 2 bytes
58
 
                        at the start that are used to store the len */
59
 
        byte*   dest,   /* in: where to store */
60
 
        ulint   len,    /* in: length, must fit in two bytes */
61
 
        ulint   lenlen);/* in: storage length of len: either 1 or 2 bytes */
62
 
/***********************************************************************
 
60
        byte*   dest,   /*!< in: where to store */
 
61
        ulint   len,    /*!< in: length, must fit in two bytes */
 
62
        ulint   lenlen);/*!< in: storage length of len: either 1 or 2 bytes */
 
63
/*******************************************************************//**
63
64
Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and
64
 
returns a pointer to the data. */
65
 
 
 
65
returns a pointer to the data.
 
66
@return pointer to the data, we skip the 1 or 2 bytes at the start
 
67
that are used to store the len */
 
68
UNIV_INTERN
66
69
const byte*
67
70
row_mysql_read_true_varchar(
68
71
/*========================*/
69
 
                                /* out: pointer to the data, we skip
70
 
                                the 1 or 2 bytes at the start that are
71
 
                                used to store the len */
72
 
        ulint*          len,    /* out: variable-length field length */
73
 
        const byte*     field,  /* in: field in the MySQL format */
74
 
        ulint           lenlen);/* in: storage length of len: either 1
 
72
        ulint*          len,    /*!< out: variable-length field length */
 
73
        const byte*     field,  /*!< in: field in the MySQL format */
 
74
        ulint           lenlen);/*!< in: storage length of len: either 1
75
75
                                or 2 bytes */
76
 
/***********************************************************************
 
76
/*******************************************************************//**
77
77
Stores a reference to a BLOB in the MySQL format. */
78
78
UNIV_INTERN
79
79
void
80
80
row_mysql_store_blob_ref(
81
81
/*=====================*/
82
 
        byte*           dest,   /* in: where to store */
83
 
        ulint           col_len,/* in: dest buffer size: determines into
 
82
        byte*           dest,   /*!< in: where to store */
 
83
        ulint           col_len,/*!< in: dest buffer size: determines into
84
84
                                how many bytes the BLOB length is stored,
85
85
                                the space for the length may vary from 1
86
86
                                to 4 bytes */
87
 
        const void*     data,   /* in: BLOB data; if the value to store
 
87
        const void*     data,   /*!< in: BLOB data; if the value to store
88
88
                                is SQL NULL this should be NULL pointer */
89
 
        ulint           len);   /* in: BLOB length; if the value to store
 
89
        ulint           len);   /*!< in: BLOB length; if the value to store
90
90
                                is SQL NULL this should be 0; remember
91
91
                                also to set the NULL bit in the MySQL record
92
92
                                header! */
93
 
/***********************************************************************
94
 
Reads a reference to a BLOB in the MySQL format. */
95
 
 
 
93
/*******************************************************************//**
 
94
Reads a reference to a BLOB in the MySQL format.
 
95
@return pointer to BLOB data */
 
96
UNIV_INTERN
96
97
const byte*
97
98
row_mysql_read_blob_ref(
98
99
/*====================*/
99
 
                                        /* out: pointer to BLOB data */
100
 
        ulint*          len,            /* out: BLOB length */
101
 
        const byte*     ref,            /* in: BLOB reference in the
 
100
        ulint*          len,            /*!< out: BLOB length */
 
101
        const byte*     ref,            /*!< in: BLOB reference in the
102
102
                                        MySQL format */
103
 
        ulint           col_len);       /* in: BLOB reference length
 
103
        ulint           col_len);       /*!< in: BLOB reference length
104
104
                                        (not BLOB length) */
105
 
/******************************************************************
 
105
/**************************************************************//**
106
106
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format.
107
107
The counterpart of this function is row_sel_field_store_in_mysql_format() in
108
 
row0sel.c. */
 
108
row0sel.c.
 
109
@return up to which byte we used buf in the conversion */
109
110
UNIV_INTERN
110
111
byte*
111
112
row_mysql_store_col_in_innobase_format(
112
113
/*===================================*/
113
 
                                        /* out: up to which byte we used
114
 
                                        buf in the conversion */
115
 
        dfield_t*       dfield,         /* in/out: dfield where dtype
 
114
        dfield_t*       dfield,         /*!< in/out: dfield where dtype
116
115
                                        information must be already set when
117
116
                                        this function is called! */
118
 
        byte*           buf,            /* in/out: buffer for a converted
 
117
        byte*           buf,            /*!< in/out: buffer for a converted
119
118
                                        integer value; this must be at least
120
119
                                        col_len long then! */
121
 
        ibool           row_format_col, /* TRUE if the mysql_data is from
 
120
        ibool           row_format_col, /*!< TRUE if the mysql_data is from
122
121
                                        a MySQL row, FALSE if from a MySQL
123
122
                                        key value;
124
123
                                        in MySQL, a true VARCHAR storage
125
124
                                        format differs in a row and in a
126
125
                                        key value: in a key value the length
127
126
                                        is always stored in 2 bytes! */
128
 
        const byte*     mysql_data,     /* in: MySQL column value, not
 
127
        const byte*     mysql_data,     /*!< in: MySQL column value, not
129
128
                                        SQL NULL; NOTE that dfield may also
130
129
                                        get a pointer to mysql_data,
131
130
                                        therefore do not discard this as long
132
131
                                        as dfield is used! */
133
 
        ulint           col_len,        /* in: MySQL column length; NOTE that
 
132
        ulint           col_len,        /*!< in: MySQL column length; NOTE that
134
133
                                        this is the storage length of the
135
134
                                        column in the MySQL format row, not
136
135
                                        necessarily the length of the actual
137
136
                                        payload data; if the column is a true
138
137
                                        VARCHAR then this is irrelevant */
139
 
        ulint           comp);          /* in: nonzero=compact format */
140
 
/********************************************************************
141
 
Handles user errors and lock waits detected by the database engine. */
 
138
        ulint           comp);          /*!< in: nonzero=compact format */
 
139
/****************************************************************//**
 
140
Handles user errors and lock waits detected by the database engine.
 
141
@return TRUE if it was a lock wait and we should continue running the
 
142
query thread */
142
143
UNIV_INTERN
143
144
ibool
144
145
row_mysql_handle_errors(
145
146
/*====================*/
146
 
                                /* out: TRUE if it was a lock wait and
147
 
                                we should continue running the query thread */
148
 
        ulint*          new_err,/* out: possible new error encountered in
 
147
        ulint*          new_err,/*!< out: possible new error encountered in
149
148
                                rollback, or the old error which was
150
149
                                during the function entry */
151
 
        trx_t*          trx,    /* in: transaction */
152
 
        que_thr_t*      thr,    /* in: query thread */
153
 
        trx_savept_t*   savept);/* in: savepoint */
154
 
/************************************************************************
155
 
Create a prebuilt struct for a MySQL table handle. */
 
150
        trx_t*          trx,    /*!< in: transaction */
 
151
        que_thr_t*      thr,    /*!< in: query thread */
 
152
        trx_savept_t*   savept);/*!< in: savepoint */
 
153
/********************************************************************//**
 
154
Create a prebuilt struct for a MySQL table handle.
 
155
@return own: a prebuilt struct */
156
156
UNIV_INTERN
157
157
row_prebuilt_t*
158
158
row_create_prebuilt(
159
159
/*================*/
160
 
                                /* out, own: a prebuilt struct */
161
 
        dict_table_t*   table); /* in: Innobase table handle */
162
 
/************************************************************************
 
160
        dict_table_t*   table); /*!< in: Innobase table handle */
 
161
/********************************************************************//**
163
162
Free a prebuilt struct for a MySQL table handle. */
164
163
UNIV_INTERN
165
164
void
166
165
row_prebuilt_free(
167
166
/*==============*/
168
 
        row_prebuilt_t* prebuilt,       /* in, own: prebuilt struct */
169
 
        ibool           dict_locked);   /* in: TRUE=data dictionary locked */
170
 
/*************************************************************************
 
167
        row_prebuilt_t* prebuilt,       /*!< in, own: prebuilt struct */
 
168
        ibool           dict_locked);   /*!< in: TRUE=data dictionary locked */
 
169
/*********************************************************************//**
171
170
Updates the transaction pointers in query graphs stored in the prebuilt
172
171
struct. */
173
172
UNIV_INTERN
174
173
void
175
174
row_update_prebuilt_trx(
176
175
/*====================*/
177
 
                                        /* out: prebuilt dtuple */
178
 
        row_prebuilt_t* prebuilt,       /* in: prebuilt struct in MySQL
179
 
                                        handle */
180
 
        trx_t*          trx);           /* in: transaction handle */
181
 
/*************************************************************************
 
176
        row_prebuilt_t* prebuilt,       /*!< in/out: prebuilt struct
 
177
                                        in MySQL handle */
 
178
        trx_t*          trx);           /*!< in: transaction handle */
 
179
/*********************************************************************//**
182
180
Unlocks AUTO_INC type locks that were possibly reserved by a trx. */
183
181
UNIV_INTERN
184
182
void
185
183
row_unlock_table_autoinc_for_mysql(
186
184
/*===============================*/
187
 
        trx_t*  trx);                   /* in/out: transaction */
188
 
/*************************************************************************
 
185
        trx_t*  trx);                   /*!< in/out: transaction */
 
186
/*********************************************************************//**
189
187
Sets an AUTO_INC type lock on the table mentioned in prebuilt. The
190
188
AUTO_INC lock gives exclusive access to the auto-inc counter of the
191
189
table. The lock is reserved only for the duration of an SQL statement.
192
190
It is not compatible with another AUTO_INC or exclusive lock on the
193
 
table. */
 
191
table.
 
192
@return error code or DB_SUCCESS */
194
193
UNIV_INTERN
195
194
int
196
195
row_lock_table_autoinc_for_mysql(
197
196
/*=============================*/
198
 
                                        /* out: error code or DB_SUCCESS */
199
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct in the MySQL
 
197
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in the MySQL
200
198
                                        table handle */
201
 
/*************************************************************************
202
 
Sets a table lock on the table mentioned in prebuilt. */
 
199
/*********************************************************************//**
 
200
Sets a table lock on the table mentioned in prebuilt.
 
201
@return error code or DB_SUCCESS */
203
202
UNIV_INTERN
204
203
int
205
204
row_lock_table_for_mysql(
206
205
/*=====================*/
207
 
                                        /* out: error code or DB_SUCCESS */
208
 
        row_prebuilt_t* prebuilt,       /* in: prebuilt struct in the MySQL
 
206
        row_prebuilt_t* prebuilt,       /*!< in: prebuilt struct in the MySQL
209
207
                                        table handle */
210
 
        dict_table_t*   table,          /* in: table to lock, or NULL
 
208
        dict_table_t*   table,          /*!< in: table to lock, or NULL
211
209
                                        if prebuilt->table should be
212
210
                                        locked as
213
211
                                        prebuilt->select_lock_type */
214
 
        ulint           mode);          /* in: lock mode of table
 
212
        ulint           mode);          /*!< in: lock mode of table
215
213
                                        (ignored if table==NULL) */
216
214
 
217
 
/*************************************************************************
218
 
Does an insert for MySQL. */
 
215
/*********************************************************************//**
 
216
Does an insert for MySQL.
 
217
@return error code or DB_SUCCESS */
219
218
UNIV_INTERN
220
219
int
221
220
row_insert_for_mysql(
222
221
/*=================*/
223
 
                                        /* out: error code or DB_SUCCESS */
224
 
        byte*           mysql_rec,      /* in: row in the MySQL format */
225
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct in MySQL
 
222
        byte*           mysql_rec,      /*!< in: row in the MySQL format */
 
223
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in MySQL
226
224
                                        handle */
227
 
/*************************************************************************
 
225
/*********************************************************************//**
228
226
Builds a dummy query graph used in selects. */
229
227
UNIV_INTERN
230
228
void
231
229
row_prebuild_sel_graph(
232
230
/*===================*/
233
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct in MySQL
 
231
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in MySQL
234
232
                                        handle */
235
 
/*************************************************************************
 
233
/*********************************************************************//**
236
234
Gets pointer to a prebuilt update vector used in updates. If the update
237
235
graph has not yet been built in the prebuilt struct, then this function
238
 
first builds it. */
 
236
first builds it.
 
237
@return prebuilt update vector */
239
238
UNIV_INTERN
240
239
upd_t*
241
240
row_get_prebuilt_update_vector(
242
241
/*===========================*/
243
 
                                        /* out: prebuilt update vector */
244
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct in MySQL
 
242
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in MySQL
245
243
                                        handle */
246
 
/*************************************************************************
 
244
/*********************************************************************//**
247
245
Checks if a table is such that we automatically created a clustered
248
 
index on it (on row id). */
 
246
index on it (on row id).
 
247
@return TRUE if the clustered index was generated automatically */
249
248
UNIV_INTERN
250
249
ibool
251
250
row_table_got_default_clust_index(
252
251
/*==============================*/
253
 
        const dict_table_t*     table);
254
 
/*************************************************************************
 
252
        const dict_table_t*     table); /*!< in: table */
 
253
/*********************************************************************//**
255
254
Calculates the key number used inside MySQL for an Innobase index. We have
256
 
to take into account if we generated a default clustered index for the table */
 
255
to take into account if we generated a default clustered index for the table
 
256
@return the key number used inside MySQL */
257
257
UNIV_INTERN
258
258
ulint
259
259
row_get_mysql_key_number_for_index(
260
260
/*===============================*/
261
 
        const dict_index_t*     index);
262
 
/*************************************************************************
263
 
Does an update or delete of a row for MySQL. */
 
261
        const dict_index_t*     index); /*!< in: index */
 
262
/*********************************************************************//**
 
263
Does an update or delete of a row for MySQL.
 
264
@return error code or DB_SUCCESS */
264
265
UNIV_INTERN
265
266
int
266
267
row_update_for_mysql(
267
268
/*=================*/
268
 
                                        /* out: error code or DB_SUCCESS */
269
 
        byte*           mysql_rec,      /* in: the row to be updated, in
 
269
        byte*           mysql_rec,      /*!< in: the row to be updated, in
270
270
                                        the MySQL format */
271
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct in MySQL
 
271
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in MySQL
272
272
                                        handle */
273
 
/*************************************************************************
 
273
/*********************************************************************//**
274
274
This can only be used when srv_locks_unsafe_for_binlog is TRUE or
275
275
session is using a READ COMMITTED isolation level. Before
276
276
calling this function we must use trx_reset_new_rec_lock_info() and
280
280
in the case of an UPDATE or a DELETE statement, where the row lock is of the
281
281
LOCK_X type.
282
282
Thus, this implements a 'mini-rollback' that releases the latest record
283
 
locks we set. */
 
283
locks we set.
 
284
@return error code or DB_SUCCESS */
284
285
UNIV_INTERN
285
286
int
286
287
row_unlock_for_mysql(
287
288
/*=================*/
288
 
                                        /* out: error code or DB_SUCCESS */
289
 
        row_prebuilt_t* prebuilt,       /* in: prebuilt struct in MySQL
 
289
        row_prebuilt_t* prebuilt,       /*!< in: prebuilt struct in MySQL
290
290
                                        handle */
291
 
        ibool           has_latches_on_recs);/* TRUE if called so that we have
 
291
        ibool           has_latches_on_recs);/*!< TRUE if called so that we have
292
292
                                        the latches on the records under pcur
293
293
                                        and clust_pcur, and we do not need to
294
294
                                        reposition the cursors. */
295
 
/*************************************************************************
 
295
/*********************************************************************//**
296
296
Creates an query graph node of 'update' type to be used in the MySQL
297
 
interface. */
 
297
interface.
 
298
@return own: update node */
298
299
UNIV_INTERN
299
300
upd_node_t*
300
301
row_create_update_node_for_mysql(
301
302
/*=============================*/
302
 
                                /* out, own: update node */
303
 
        dict_table_t*   table,  /* in: table to update */
304
 
        mem_heap_t*     heap);  /* in: mem heap from which allocated */
305
 
/**************************************************************************
306
 
Does a cascaded delete or set null in a foreign key operation. */
 
303
        dict_table_t*   table,  /*!< in: table to update */
 
304
        mem_heap_t*     heap);  /*!< in: mem heap from which allocated */
 
305
/**********************************************************************//**
 
306
Does a cascaded delete or set null in a foreign key operation.
 
307
@return error code or DB_SUCCESS */
307
308
UNIV_INTERN
308
309
ulint
309
310
row_update_cascade_for_mysql(
310
311
/*=========================*/
311
 
                                /* out: error code or DB_SUCCESS */
312
 
        que_thr_t*      thr,    /* in: query thread */
313
 
        upd_node_t*     node,   /* in: update node used in the cascade
 
312
        que_thr_t*      thr,    /*!< in: query thread */
 
313
        upd_node_t*     node,   /*!< in: update node used in the cascade
314
314
                                or set null operation */
315
 
        dict_table_t*   table); /* in: table where we do the operation */
316
 
/*************************************************************************
 
315
        dict_table_t*   table); /*!< in: table where we do the operation */
 
316
/*********************************************************************//**
317
317
Locks the data dictionary exclusively for performing a table create or other
318
318
data dictionary modification operation. */
319
319
UNIV_INTERN
320
320
void
321
321
row_mysql_lock_data_dictionary_func(
322
322
/*================================*/
323
 
        trx_t*          trx,    /* in/out: transaction */
324
 
        const char*     file,   /* in: file name */
325
 
        ulint           line);  /* in: line number */
 
323
        trx_t*          trx,    /*!< in/out: transaction */
 
324
        const char*     file,   /*!< in: file name */
 
325
        ulint           line);  /*!< in: line number */
326
326
#define row_mysql_lock_data_dictionary(trx)                             \
327
327
        row_mysql_lock_data_dictionary_func(trx, __FILE__, __LINE__)
328
 
/*************************************************************************
 
328
/*********************************************************************//**
329
329
Unlocks the data dictionary exclusive lock. */
330
330
UNIV_INTERN
331
331
void
332
332
row_mysql_unlock_data_dictionary(
333
333
/*=============================*/
334
 
        trx_t*  trx);   /* in/out: transaction */
335
 
/*************************************************************************
 
334
        trx_t*  trx);   /*!< in/out: transaction */
 
335
/*********************************************************************//**
336
336
Locks the data dictionary in shared mode from modifications, for performing
337
337
foreign key check, rollback, or other operation invisible to MySQL. */
338
338
UNIV_INTERN
339
339
void
340
340
row_mysql_freeze_data_dictionary_func(
341
341
/*==================================*/
342
 
        trx_t*          trx,    /* in/out: transaction */
343
 
        const char*     file,   /* in: file name */
344
 
        ulint           line);  /* in: line number */
 
342
        trx_t*          trx,    /*!< in/out: transaction */
 
343
        const char*     file,   /*!< in: file name */
 
344
        ulint           line);  /*!< in: line number */
345
345
#define row_mysql_freeze_data_dictionary(trx)                           \
346
346
        row_mysql_freeze_data_dictionary_func(trx, __FILE__, __LINE__)
347
 
/*************************************************************************
 
347
/*********************************************************************//**
348
348
Unlocks the data dictionary shared lock. */
349
349
UNIV_INTERN
350
350
void
351
351
row_mysql_unfreeze_data_dictionary(
352
352
/*===============================*/
353
 
        trx_t*  trx);   /* in/out: transaction */
354
 
#ifndef UNIV_HOTBACKUP
355
 
/*************************************************************************
 
353
        trx_t*  trx);   /*!< in/out: transaction */
 
354
/*********************************************************************//**
356
355
Creates a table for MySQL. If the name of the table ends in
357
356
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
358
357
"innodb_table_monitor", then this will also start the printing of monitor
359
358
output by the master thread. If the table name ends in "innodb_mem_validate",
360
 
InnoDB will try to invoke mem_validate(). */
 
359
InnoDB will try to invoke mem_validate().
 
360
@return error code or DB_SUCCESS */
361
361
UNIV_INTERN
362
362
int
363
363
row_create_table_for_mysql(
364
364
/*=======================*/
365
 
                                        /* out: error code or DB_SUCCESS */
366
 
        dict_table_t*   table,          /* in, own: table definition
 
365
        dict_table_t*   table,          /*!< in, own: table definition
367
366
                                        (will be freed) */
368
 
        trx_t*          trx);           /* in: transaction handle */
369
 
/*************************************************************************
 
367
        trx_t*          trx);           /*!< in: transaction handle */
 
368
/*********************************************************************//**
370
369
Does an index creation operation for MySQL. TODO: currently failure
371
370
to create an index results in dropping the whole table! This is no problem
372
 
currently as all indexes must be created at the same time as the table. */
 
371
currently as all indexes must be created at the same time as the table.
 
372
@return error number or DB_SUCCESS */
373
373
UNIV_INTERN
374
374
int
375
375
row_create_index_for_mysql(
376
376
/*=======================*/
377
 
                                        /* out: error number or DB_SUCCESS */
378
 
        dict_index_t*   index,          /* in, own: index definition
 
377
        dict_index_t*   index,          /*!< in, own: index definition
379
378
                                        (will be freed) */
380
 
        trx_t*          trx,            /* in: transaction handle */
381
 
        const ulint*    field_lengths); /* in: if not NULL, must contain
 
379
        trx_t*          trx,            /*!< in: transaction handle */
 
380
        const ulint*    field_lengths); /*!< in: if not NULL, must contain
382
381
                                        dict_index_get_n_fields(index)
383
382
                                        actual field lengths for the
384
383
                                        index columns, which are
385
384
                                        then checked for not being too
386
385
                                        large. */
387
 
/*************************************************************************
 
386
/*********************************************************************//**
388
387
Scans a table create SQL string and adds to the data dictionary
389
388
the foreign key constraints declared in the string. This function
390
389
should be called after the indexes for a table have been created.
391
390
Each foreign key constraint must be accompanied with indexes in
392
391
bot participating tables. The indexes are allowed to contain more
393
 
fields than mentioned in the constraint. */
 
392
fields than mentioned in the constraint.
 
393
@return error code or DB_SUCCESS */
394
394
UNIV_INTERN
395
395
int
396
396
row_table_add_foreign_constraints(
397
397
/*==============================*/
398
 
                                        /* out: error code or DB_SUCCESS */
399
 
        trx_t*          trx,            /* in: transaction */
400
 
        const char*     sql_string,     /* in: table create statement where
 
398
        trx_t*          trx,            /*!< in: transaction */
 
399
        const char*     sql_string,     /*!< in: table create statement where
401
400
                                        foreign keys are declared like:
402
401
                                FOREIGN KEY (a, b) REFERENCES table2(c, d),
403
402
                                        table2 can be written also with the
404
403
                                        database name before it: test.table2 */
405
 
        const char*     name,           /* in: table full name in the
 
404
        const char*     name,           /*!< in: table full name in the
406
405
                                        normalized form
407
406
                                        database_name/table_name */
408
 
        ibool           reject_fks);    /* in: if TRUE, fail with error
 
407
        ibool           reject_fks);    /*!< in: if TRUE, fail with error
409
408
                                        code DB_CANNOT_ADD_CONSTRAINT if
410
409
                                        any foreign keys are found. */
411
410
 
412
 
/*************************************************************************
 
411
/*********************************************************************//**
413
412
The master thread in srv0srv.c calls this regularly to drop tables which
414
413
we must drop in background after queries to them have ended. Such lazy
415
 
dropping of tables is needed in ALTER TABLE on Unix. */
 
414
dropping of tables is needed in ALTER TABLE on Unix.
 
415
@return how many tables dropped + remaining tables in list */
416
416
UNIV_INTERN
417
417
ulint
418
418
row_drop_tables_for_mysql_in_background(void);
419
419
/*=========================================*/
420
 
                                        /* out: how many tables dropped
421
 
                                        + remaining tables in list */
422
 
/*************************************************************************
 
420
/*********************************************************************//**
423
421
Get the background drop list length. NOTE: the caller must own the kernel
424
 
mutex! */
 
422
mutex!
 
423
@return how many tables in list */
425
424
UNIV_INTERN
426
425
ulint
427
426
row_get_background_drop_list_len_low(void);
428
427
/*======================================*/
429
 
                                        /* out: how many tables in list */
430
 
/*************************************************************************
431
 
Truncates a table for MySQL. */
 
428
/*********************************************************************//**
 
429
Truncates a table for MySQL.
 
430
@return error code or DB_SUCCESS */
432
431
UNIV_INTERN
433
432
int
434
433
row_truncate_table_for_mysql(
435
434
/*=========================*/
436
 
                                /* out: error code or DB_SUCCESS */
437
 
        dict_table_t*   table,  /* in: table handle */
438
 
        trx_t*          trx);   /* in: transaction handle */
439
 
/*************************************************************************
 
435
        dict_table_t*   table,  /*!< in: table handle */
 
436
        trx_t*          trx);   /*!< in: transaction handle */
 
437
/*********************************************************************//**
440
438
Drops a table for MySQL.  If the name of the dropped table ends in
441
439
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
442
440
"innodb_table_monitor", then this will also stop the printing of monitor
443
441
output by the master thread.  If the data dictionary was not already locked
444
442
by the transaction, the transaction will be committed.  Otherwise, the
445
 
data dictionary will remain locked. */
 
443
data dictionary will remain locked.
 
444
@return error code or DB_SUCCESS */
446
445
UNIV_INTERN
447
446
int
448
447
row_drop_table_for_mysql(
449
448
/*=====================*/
450
 
                                /* out: error code or DB_SUCCESS */
451
 
        const char*     name,   /* in: table name */
452
 
        trx_t*          trx,    /* in: transaction handle */
453
 
        ibool           drop_db);/* in: TRUE=dropping whole database */
 
449
        const char*     name,   /*!< in: table name */
 
450
        trx_t*          trx,    /*!< in: transaction handle */
 
451
        ibool           drop_db);/*!< in: TRUE=dropping whole database */
454
452
 
455
 
/*************************************************************************
 
453
/*********************************************************************//**
456
454
Discards the tablespace of a table which stored in an .ibd file. Discarding
457
455
means that this function deletes the .ibd file and assigns a new table id for
458
 
the table. Also the flag table->ibd_file_missing is set TRUE. */
 
456
the table. Also the flag table->ibd_file_missing is set TRUE.
 
457
@return error code or DB_SUCCESS */
459
458
UNIV_INTERN
460
459
int
461
460
row_discard_tablespace_for_mysql(
462
461
/*=============================*/
463
 
                                /* out: error code or DB_SUCCESS */
464
 
        const char*     name,   /* in: table name */
465
 
        trx_t*          trx);   /* in: transaction handle */
466
 
/*********************************************************************
 
462
        const char*     name,   /*!< in: table name */
 
463
        trx_t*          trx);   /*!< in: transaction handle */
 
464
/*****************************************************************//**
467
465
Imports a tablespace. The space id in the .ibd file must match the space id
468
 
of the table in the data dictionary. */
 
466
of the table in the data dictionary.
 
467
@return error code or DB_SUCCESS */
469
468
UNIV_INTERN
470
469
int
471
470
row_import_tablespace_for_mysql(
472
471
/*============================*/
473
 
                                /* out: error code or DB_SUCCESS */
474
 
        const char*     name,   /* in: table name */
475
 
        trx_t*          trx);   /* in: transaction handle */
476
 
/*************************************************************************
477
 
Drops a database for MySQL. */
 
472
        const char*     name,   /*!< in: table name */
 
473
        trx_t*          trx);   /*!< in: transaction handle */
 
474
/*********************************************************************//**
 
475
Drops a database for MySQL.
 
476
@return error code or DB_SUCCESS */
478
477
UNIV_INTERN
479
478
int
480
479
row_drop_database_for_mysql(
481
480
/*========================*/
482
 
                                /* out: error code or DB_SUCCESS */
483
 
        const char*     name,   /* in: database name which ends to '/' */
484
 
        trx_t*          trx);   /* in: transaction handle */
485
 
/*************************************************************************
486
 
Renames a table for MySQL. */
 
481
        const char*     name,   /*!< in: database name which ends to '/' */
 
482
        trx_t*          trx);   /*!< in: transaction handle */
 
483
/*********************************************************************//**
 
484
Renames a table for MySQL.
 
485
@return error code or DB_SUCCESS */
487
486
UNIV_INTERN
488
487
ulint
489
488
row_rename_table_for_mysql(
490
489
/*=======================*/
491
 
                                        /* out: error code or DB_SUCCESS */
492
 
        const char*     old_name,       /* in: old table name */
493
 
        const char*     new_name,       /* in: new table name */
494
 
        trx_t*          trx,            /* in: transaction handle */
495
 
        ibool           commit);        /* in: if TRUE then commit trx */
496
 
/*************************************************************************
497
 
Checks a table for corruption. */
 
490
        const char*     old_name,       /*!< in: old table name */
 
491
        const char*     new_name,       /*!< in: new table name */
 
492
        trx_t*          trx,            /*!< in: transaction handle */
 
493
        ibool           commit);        /*!< in: if TRUE then commit trx */
 
494
/*********************************************************************//**
 
495
Checks a table for corruption.
 
496
@return DB_ERROR or DB_SUCCESS */
498
497
UNIV_INTERN
499
498
ulint
500
499
row_check_table_for_mysql(
501
500
/*======================*/
502
 
                                        /* out: DB_ERROR or DB_SUCCESS */
503
 
        row_prebuilt_t* prebuilt);      /* in: prebuilt struct in MySQL
 
501
        row_prebuilt_t* prebuilt);      /*!< in: prebuilt struct in MySQL
504
502
                                        handle */
505
 
#endif /* !UNIV_HOTBACKUP */
506
503
 
507
 
/*************************************************************************
508
 
Determines if a table is a magic monitor table. */
 
504
/*********************************************************************//**
 
505
Determines if a table is a magic monitor table.
 
506
@return TRUE if monitor table */
509
507
UNIV_INTERN
510
508
ibool
511
509
row_is_magic_monitor_table(
512
510
/*=======================*/
513
 
                                        /* out: TRUE if monitor table */
514
 
        const char*     table_name);    /* in: name of the table, in the
 
511
        const char*     table_name);    /*!< in: name of the table, in the
515
512
                                        form database/table_name */
516
513
 
517
514
/* A struct describing a place for an individual column in the MySQL
521
518
 
522
519
typedef struct mysql_row_templ_struct mysql_row_templ_t;
523
520
struct mysql_row_templ_struct {
524
 
        ulint   col_no;                 /* column number of the column */
525
 
        ulint   rec_field_no;           /* field number of the column in an
 
521
        ulint   col_no;                 /*!< column number of the column */
 
522
        ulint   rec_field_no;           /*!< field number of the column in an
526
523
                                        Innobase record in the current index;
527
524
                                        not defined if template_type is
528
525
                                        ROW_MYSQL_WHOLE_ROW */
529
 
        ulint   mysql_col_offset;       /* offset of the column in the MySQL
530
 
                                        row format */
531
 
        ulint   mysql_col_len;          /* length of the column in the MySQL
532
 
                                        row format */
533
 
        ulint   mysql_null_byte_offset; /* MySQL NULL bit byte offset in a
 
526
        ulint   mysql_col_offset;       /*!< offset of the column in the MySQL
 
527
                                        row format */
 
528
        ulint   mysql_col_len;          /*!< length of the column in the MySQL
 
529
                                        row format */
 
530
        ulint   mysql_null_byte_offset; /*!< MySQL NULL bit byte offset in a
534
531
                                        MySQL record */
535
 
        ulint   mysql_null_bit_mask;    /* bit mask to get the NULL bit,
 
532
        ulint   mysql_null_bit_mask;    /*!< bit mask to get the NULL bit,
536
533
                                        zero if column cannot be NULL */
537
 
        ulint   type;                   /* column type in Innobase mtype
 
534
        ulint   type;                   /*!< column type in Innobase mtype
538
535
                                        numbers DATA_CHAR... */
539
 
        ulint   mysql_type;             /* MySQL type code; this is always
 
536
        ulint   mysql_type;             /*!< MySQL type code; this is always
540
537
                                        < 256 */
541
 
        ulint   mysql_length_bytes;     /* if mysql_type
 
538
        ulint   mysql_length_bytes;     /*!< if mysql_type
542
539
                                        == DATA_MYSQL_TRUE_VARCHAR, this tells
543
540
                                        whether we should use 1 or 2 bytes to
544
541
                                        store the MySQL true VARCHAR data
546
543
                                        format (NOTE that the MySQL key value
547
544
                                        format always uses 2 bytes for the data
548
545
                                        len) */
549
 
        ulint   charset;                /* MySQL charset-collation code
 
546
        ulint   charset;                /*!< MySQL charset-collation code
550
547
                                        of the column, or zero */
551
 
        ulint   mbminlen;               /* minimum length of a char, in bytes,
552
 
                                        or zero if not a char type */
553
 
        ulint   mbmaxlen;               /* maximum length of a char, in bytes,
554
 
                                        or zero if not a char type */
555
 
        ulint   is_unsigned;            /* if a column type is an integer
 
548
        ulint   mbminlen;               /*!< minimum length of a char, in bytes,
 
549
                                        or zero if not a char type */
 
550
        ulint   mbmaxlen;               /*!< maximum length of a char, in bytes,
 
551
                                        or zero if not a char type */
 
552
        ulint   is_unsigned;            /*!< if a column type is an integer
556
553
                                        type and this field is != 0, then
557
554
                                        it is an unsigned integer type */
558
555
};
564
561
#define ROW_PREBUILT_ALLOCATED  78540783
565
562
#define ROW_PREBUILT_FREED      26423527
566
563
 
567
 
typedef int64_t (*index_cond_func_t)(void *param);
568
 
 
569
 
/* A struct for (sometimes lazily) prebuilt structures in an Innobase table
 
564
/** A struct for (sometimes lazily) prebuilt structures in an Innobase table
570
565
handle used within MySQL; these are used to save CPU time. */
571
566
 
572
567
struct row_prebuilt_struct {
573
 
        ulint           magic_n;        /* this magic number is set to
 
568
        ulint           magic_n;        /*!< this magic number is set to
574
569
                                        ROW_PREBUILT_ALLOCATED when created,
575
570
                                        or ROW_PREBUILT_FREED when the
576
571
                                        struct has been freed */
577
 
        dict_table_t*   table;          /* Innobase table handle */
578
 
        trx_t*          trx;            /* current transaction handle */
579
 
        ibool           sql_stat_start; /* TRUE when we start processing of
 
572
        dict_table_t*   table;          /*!< Innobase table handle */
 
573
        dict_index_t*   index;          /*!< current index for a search, if
 
574
                                        any */
 
575
        trx_t*          trx;            /*!< current transaction handle */
 
576
        unsigned        sql_stat_start:1;/*!< TRUE when we start processing of
580
577
                                        an SQL statement: we may have to set
581
578
                                        an intention lock on the table,
582
579
                                        create a consistent read view etc. */
583
 
        ibool           mysql_has_locked; /* this is set TRUE when MySQL
 
580
        unsigned        mysql_has_locked:1;/*!< this is set TRUE when MySQL
584
581
                                        calls external_lock on this handle
585
582
                                        with a lock flag, and set FALSE when
586
583
                                        with the F_UNLOCK flag */
587
 
        ibool           clust_index_was_generated;
588
 
                                        /* if the user did not define a
 
584
        unsigned        clust_index_was_generated:1;
 
585
                                        /*!< if the user did not define a
589
586
                                        primary key in MySQL, then Innobase
590
587
                                        automatically generated a clustered
591
588
                                        index where the ordering column is
592
589
                                        the row id: in this case this flag
593
590
                                        is set to TRUE */
594
 
        dict_index_t*   index;          /* current index for a search, if
595
 
                                        any */
596
 
        ulint           read_just_key;  /* set to 1 when MySQL calls
 
591
        unsigned        index_usable:1; /*!< caches the value of
 
592
                                        row_merge_is_index_usable(trx,index) */
 
593
        unsigned        read_just_key:1;/*!< set to 1 when MySQL calls
597
594
                                        ha_innobase::extra with the
598
595
                                        argument HA_EXTRA_KEYREAD; it is enough
599
596
                                        to read just columns defined in
600
597
                                        the index (i.e., no read of the
601
598
                                        clustered index record necessary) */
602
 
        ibool           used_in_HANDLER;/* TRUE if we have been using this
 
599
        unsigned        used_in_HANDLER:1;/*!< TRUE if we have been using this
603
600
                                        handle in a MySQL HANDLER low level
604
601
                                        index cursor command: then we must
605
602
                                        store the pcur position even in a
606
603
                                        unique search from a clustered index,
607
604
                                        because HANDLER allows NEXT and PREV
608
605
                                        in such a situation */
609
 
        ulint           template_type;  /* ROW_MYSQL_WHOLE_ROW,
 
606
        unsigned        template_type:2;/*!< ROW_MYSQL_WHOLE_ROW,
610
607
                                        ROW_MYSQL_REC_FIELDS,
611
608
                                        ROW_MYSQL_DUMMY_TEMPLATE, or
612
609
                                        ROW_MYSQL_NO_TEMPLATE */
613
 
        ulint           n_template;     /* number of elements in the
 
610
        unsigned        n_template:10;  /*!< number of elements in the
614
611
                                        template */
615
 
        ulint           null_bitmap_len;/* number of bytes in the SQL NULL
 
612
        unsigned        null_bitmap_len:10;/*!< number of bytes in the SQL NULL
616
613
                                        bitmap at the start of a row in the
617
614
                                        MySQL format */
618
 
        ibool           need_to_access_clustered; /* if we are fetching
 
615
        unsigned        need_to_access_clustered:1; /*!< if we are fetching
619
616
                                        columns through a secondary index
620
617
                                        and at least one column is not in
621
618
                                        the secondary index, then this is
622
619
                                        set to TRUE */
623
 
        ibool           templ_contains_blob;/* TRUE if the template contains
 
620
        unsigned        templ_contains_blob:1;/*!< TRUE if the template contains
624
621
                                        BLOB column(s) */
625
 
        mysql_row_templ_t* mysql_template;/* template used to transform
 
622
        mysql_row_templ_t* mysql_template;/*!< template used to transform
626
623
                                        rows fast between MySQL and Innobase
627
624
                                        formats; memory for this template
628
625
                                        is not allocated from 'heap' */
629
 
        mem_heap_t*     heap;           /* memory heap from which
 
626
        mem_heap_t*     heap;           /*!< memory heap from which
630
627
                                        these auxiliary structures are
631
628
                                        allocated when needed */
632
 
        ins_node_t*     ins_node;       /* Innobase SQL insert node
 
629
        ins_node_t*     ins_node;       /*!< Innobase SQL insert node
633
630
                                        used to perform inserts
634
631
                                        to the table */
635
 
        byte*           ins_upd_rec_buff;/* buffer for storing data converted
 
632
        byte*           ins_upd_rec_buff;/*!< buffer for storing data converted
636
633
                                        to the Innobase format from the MySQL
637
634
                                        format */
638
 
        const byte*     default_rec;    /* the default values of all columns
 
635
        const byte*     default_rec;    /*!< the default values of all columns
639
636
                                        (a "default row") in MySQL format */
640
637
        ulint           hint_need_to_fetch_extra_cols;
641
 
                                        /* normally this is set to 0; if this
 
638
                                        /*!< normally this is set to 0; if this
642
639
                                        is set to ROW_RETRIEVE_PRIMARY_KEY,
643
640
                                        then we should at least retrieve all
644
641
                                        columns in the primary key; if this
646
643
                                        we must retrieve all columns in the
647
644
                                        key (if read_just_key == 1), or all
648
645
                                        columns in the table */
649
 
        upd_node_t*     upd_node;       /* Innobase SQL update node used
 
646
        upd_node_t*     upd_node;       /*!< Innobase SQL update node used
650
647
                                        to perform updates and deletes */
651
 
        que_fork_t*     ins_graph;      /* Innobase SQL query graph used
 
648
        que_fork_t*     ins_graph;      /*!< Innobase SQL query graph used
652
649
                                        in inserts */
653
 
        que_fork_t*     upd_graph;      /* Innobase SQL query graph used
 
650
        que_fork_t*     upd_graph;      /*!< Innobase SQL query graph used
654
651
                                        in updates or deletes */
655
 
        btr_pcur_t*     pcur;           /* persistent cursor used in selects
 
652
        btr_pcur_t*     pcur;           /*!< persistent cursor used in selects
656
653
                                        and updates */
657
 
        btr_pcur_t*     clust_pcur;     /* persistent cursor used in
 
654
        btr_pcur_t*     clust_pcur;     /*!< persistent cursor used in
658
655
                                        some selects and updates */
659
 
        que_fork_t*     sel_graph;      /* dummy query graph used in
 
656
        que_fork_t*     sel_graph;      /*!< dummy query graph used in
660
657
                                        selects */
661
 
        dtuple_t*       search_tuple;   /* prebuilt dtuple used in selects */
 
658
        dtuple_t*       search_tuple;   /*!< prebuilt dtuple used in selects */
662
659
        byte            row_id[DATA_ROW_ID_LEN];
663
 
                                        /* if the clustered index was
 
660
                                        /*!< if the clustered index was
664
661
                                        generated, the row id of the
665
662
                                        last row fetched is stored
666
663
                                        here */
667
 
        dtuple_t*       clust_ref;      /* prebuilt dtuple used in
 
664
        dtuple_t*       clust_ref;      /*!< prebuilt dtuple used in
668
665
                                        sel/upd/del */
669
 
        ulint           select_lock_type;/* LOCK_NONE, LOCK_S, or LOCK_X */
670
 
        ulint           stored_select_lock_type;/* this field is used to
 
666
        ulint           select_lock_type;/*!< LOCK_NONE, LOCK_S, or LOCK_X */
 
667
        ulint           stored_select_lock_type;/*!< this field is used to
671
668
                                        remember the original select_lock_type
672
669
                                        that was decided in ha_innodb.cc,
673
670
                                        ::store_lock(), ::external_lock(),
674
671
                                        etc. */
675
 
        ulint           row_read_type;  /* ROW_READ_WITH_LOCKS if row locks
 
672
        ulint           row_read_type;  /*!< ROW_READ_WITH_LOCKS if row locks
676
673
                                        should be the obtained for records
677
674
                                        under an UPDATE or DELETE cursor.
678
675
                                        If innodb_locks_unsafe_for_binlog
697
694
                                        This eliminates lock waits in some
698
695
                                        cases; note that this breaks
699
696
                                        serializability. */
700
 
        ulint           mysql_prefix_len;/* byte offset of the end of
 
697
        ulint           new_rec_locks;  /*!< normally 0; if
 
698
                                        srv_locks_unsafe_for_binlog is
 
699
                                        TRUE or session is using READ
 
700
                                        COMMITTED isolation level, in a
 
701
                                        cursor search, if we set a new
 
702
                                        record lock on an index, this is
 
703
                                        incremented; this is used in
 
704
                                        releasing the locks under the
 
705
                                        cursors if we are performing an
 
706
                                        UPDATE and we determine after
 
707
                                        retrieving the row that it does
 
708
                                        not need to be locked; thus,
 
709
                                        these can be used to implement a
 
710
                                        'mini-rollback' that releases
 
711
                                        the latest record locks */
 
712
        ulint           mysql_prefix_len;/*!< byte offset of the end of
701
713
                                        the last requested column */
702
 
        ulint           mysql_row_len;  /* length in bytes of a row in the
 
714
        ulint           mysql_row_len;  /*!< length in bytes of a row in the
703
715
                                        MySQL format */
704
 
        ulint           n_rows_fetched; /* number of rows fetched after
 
716
        ulint           n_rows_fetched; /*!< number of rows fetched after
705
717
                                        positioning the current cursor */
706
 
        ulint           fetch_direction;/* ROW_SEL_NEXT or ROW_SEL_PREV */
 
718
        ulint           fetch_direction;/*!< ROW_SEL_NEXT or ROW_SEL_PREV */
707
719
        byte*           fetch_cache[MYSQL_FETCH_CACHE_SIZE];
708
 
                                        /* a cache for fetched rows if we
 
720
                                        /*!< a cache for fetched rows if we
709
721
                                        fetch many rows from the same cursor:
710
722
                                        it saves CPU time to fetch them in a
711
723
                                        batch; we reserve mysql_row_len
714
726
                                        allocated mem buf start, because
715
727
                                        there is a 4 byte magic number at the
716
728
                                        start and at the end */
717
 
        ibool           keep_other_fields_on_keyread; /* when using fetch
 
729
        ibool           keep_other_fields_on_keyread; /*!< when using fetch
718
730
                                        cache with HA_EXTRA_KEYREAD, don't
719
731
                                        overwrite other fields in mysql row
720
732
                                        row buffer.*/
721
 
        ulint           fetch_cache_first;/* position of the first not yet
 
733
        ulint           fetch_cache_first;/*!< position of the first not yet
722
734
                                        fetched row in fetch_cache */
723
 
        ulint           n_fetch_cached; /* number of not yet fetched rows
 
735
        ulint           n_fetch_cached; /*!< number of not yet fetched rows
724
736
                                        in fetch_cache */
725
 
        mem_heap_t*     blob_heap;      /* in SELECTS BLOB fields are copied
 
737
        mem_heap_t*     blob_heap;      /*!< in SELECTS BLOB fields are copied
726
738
                                        to this heap */
727
 
        mem_heap_t*     old_vers_heap;  /* memory heap where a previous
 
739
        mem_heap_t*     old_vers_heap;  /*!< memory heap where a previous
728
740
                                        version is built in consistent read */
729
741
        /*----------------------*/
730
 
        ib_uint64_t     autoinc_last_value;/* last value of AUTO-INC interval */
731
 
        ib_uint64_t     autoinc_increment;/* The increment step of the auto 
 
742
        ib_uint64_t     autoinc_last_value;
 
743
                                        /*!< last value of AUTO-INC interval */
 
744
        ib_uint64_t     autoinc_increment;/*!< The increment step of the auto
732
745
                                        increment column. Value must be
733
746
                                        greater than or equal to 1. Required to
734
747
                                        calculate the next value */
735
748
        ib_uint64_t     autoinc_offset; /* The offset passed to
736
749
                                        get_auto_increment() by MySQL. Required
737
750
                                        to calculate the next value */
738
 
        ulint           autoinc_error;  /* The actual error code encountered
 
751
        ulint           autoinc_error;  /*!< The actual error code encountered
739
752
                                        while trying to init or read the
740
753
                                        autoinc value from the table. We
741
754
                                        store it here so that we can return
742
755
                                        it to MySQL */
743
756
        /*----------------------*/
744
757
        UT_LIST_NODE_T(row_prebuilt_t)  prebuilts;
745
 
                                        /* list node of table->prebuilts */
746
 
        index_cond_func_t idx_cond_func;/* Index Condition Pushdown function,
747
 
                                        or NULL if there is none set */
748
 
        void*           idx_cond_func_arg;/* ICP function  argument */
749
 
        ulint           n_index_fields; /* Number of fields at the start of
750
 
                                        mysql_template. Valid only when using
751
 
                                        ICP. */
752
 
        ulint           magic_n2;       /* this should be the same as
 
758
                                        /*!< list node of table->prebuilts */
 
759
        ulint           magic_n2;       /*!< this should be the same as
753
760
                                        magic_n */
754
761
};
755
762