41
40
typedef struct row_prebuilt_struct row_prebuilt_t;
43
/*******************************************************************//**
42
/***********************************************************************
44
43
Frees the blob heap in prebuilt when no longer needed. */
47
46
row_mysql_prebuilt_free_blob_heap(
48
47
/*==============================*/
49
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct of a
48
row_prebuilt_t* prebuilt); /* in: prebuilt struct of a
50
49
ha_innobase:: table handle */
51
/*******************************************************************//**
50
/***********************************************************************
52
51
Stores a >= 5.0.3 format true VARCHAR length to dest, in the MySQL row
54
@return pointer to the data, we skip the 1 or 2 bytes at the start
55
that are used to store the len */
58
55
row_mysql_store_true_var_len(
59
56
/*=========================*/
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
/*******************************************************************//**
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
/***********************************************************************
64
63
Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and
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 */
64
returns a pointer to the data. */
70
67
row_mysql_read_true_varchar(
71
68
/*========================*/
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
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
76
/*******************************************************************//**
76
/***********************************************************************
77
77
Stores a reference to a BLOB in the MySQL format. */
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
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
93
/*******************************************************************//**
94
Reads a reference to a BLOB in the MySQL format.
95
@return pointer to BLOB data */
93
/***********************************************************************
94
Reads a reference to a BLOB in the MySQL format. */
98
97
row_mysql_read_blob_ref(
99
98
/*====================*/
100
ulint* len, /*!< out: BLOB length */
101
const byte* ref, /*!< in: BLOB reference in the
99
/* out: pointer to BLOB data */
100
ulint* len, /* out: BLOB length */
101
const byte* ref, /* in: BLOB reference in the
103
ulint col_len); /*!< in: BLOB reference length
103
ulint col_len); /* in: BLOB reference length
104
104
(not BLOB length) */
105
/**************************************************************//**
106
Pad a column with spaces. */
111
ulint mbminlen, /*!< in: minimum size of a character,
113
byte* pad, /*!< out: padded buffer */
114
ulint len); /*!< in: number of bytes to pad */
116
/**************************************************************//**
105
/******************************************************************
117
106
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format.
118
107
The counterpart of this function is row_sel_field_store_in_mysql_format() in
120
@return up to which byte we used buf in the conversion */
123
111
row_mysql_store_col_in_innobase_format(
124
112
/*===================================*/
125
dfield_t* dfield, /*!< in/out: dfield where dtype
113
/* out: up to which byte we used
114
buf in the conversion */
115
dfield_t* dfield, /* in/out: dfield where dtype
126
116
information must be already set when
127
117
this function is called! */
128
byte* buf, /*!< in/out: buffer for a converted
118
byte* buf, /* in/out: buffer for a converted
129
119
integer value; this must be at least
130
120
col_len long then! */
131
ibool row_format_col, /*!< TRUE if the mysql_data is from
121
ibool row_format_col, /* TRUE if the mysql_data is from
132
122
a MySQL row, FALSE if from a MySQL
134
124
in MySQL, a true VARCHAR storage
135
125
format differs in a row and in a
136
126
key value: in a key value the length
137
127
is always stored in 2 bytes! */
138
const byte* mysql_data, /*!< in: MySQL column value, not
128
const byte* mysql_data, /* in: MySQL column value, not
139
129
SQL NULL; NOTE that dfield may also
140
130
get a pointer to mysql_data,
141
131
therefore do not discard this as long
142
132
as dfield is used! */
143
ulint col_len, /*!< in: MySQL column length; NOTE that
133
ulint col_len, /* in: MySQL column length; NOTE that
144
134
this is the storage length of the
145
135
column in the MySQL format row, not
146
136
necessarily the length of the actual
147
137
payload data; if the column is a true
148
138
VARCHAR then this is irrelevant */
149
ulint comp); /*!< in: nonzero=compact format */
150
/****************************************************************//**
151
Handles user errors and lock waits detected by the database engine.
152
@return TRUE if it was a lock wait and we should continue running the
139
ulint comp); /* in: nonzero=compact format */
140
/********************************************************************
141
Handles user errors and lock waits detected by the database engine. */
156
144
row_mysql_handle_errors(
157
145
/*====================*/
158
ulint* new_err,/*!< out: possible new error encountered in
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
159
149
rollback, or the old error which was
160
150
during the function entry */
161
trx_t* trx, /*!< in: transaction */
162
que_thr_t* thr, /*!< in: query thread */
163
trx_savept_t* savept);/*!< in: savepoint */
164
/********************************************************************//**
165
Create a prebuilt struct for a MySQL table handle.
166
@return own: a prebuilt struct */
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. */
169
158
row_create_prebuilt(
170
159
/*================*/
171
dict_table_t* table); /*!< in: Innobase table handle */
172
/********************************************************************//**
160
/* out, own: a prebuilt struct */
161
dict_table_t* table); /* in: Innobase table handle */
162
/************************************************************************
173
163
Free a prebuilt struct for a MySQL table handle. */
176
166
row_prebuilt_free(
177
167
/*==============*/
178
row_prebuilt_t* prebuilt, /*!< in, own: prebuilt struct */
179
ibool dict_locked); /*!< in: TRUE=data dictionary locked */
180
/*********************************************************************//**
168
row_prebuilt_t* prebuilt, /* in, own: prebuilt struct */
169
ibool dict_locked); /* in: TRUE=data dictionary locked */
170
/*************************************************************************
181
171
Updates the transaction pointers in query graphs stored in the prebuilt
185
175
row_update_prebuilt_trx(
186
176
/*====================*/
187
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct
189
trx_t* trx); /*!< in: transaction handle */
190
/*********************************************************************//**
191
Unlocks AUTO_INC type locks that were possibly reserved by a trx. This
192
function should be called at the the end of an SQL statement, by the
193
connection thread that owns the transaction (trx->mysql_thd). */
177
/* out: prebuilt dtuple */
178
row_prebuilt_t* prebuilt, /* in: prebuilt struct in MySQL
180
trx_t* trx); /* in: transaction handle */
181
/*************************************************************************
182
Unlocks AUTO_INC type locks that were possibly reserved by a trx. */
196
185
row_unlock_table_autoinc_for_mysql(
197
186
/*===============================*/
198
trx_t* trx); /*!< in/out: transaction */
199
/*********************************************************************//**
187
trx_t* trx); /* in/out: transaction */
188
/*************************************************************************
200
189
Sets an AUTO_INC type lock on the table mentioned in prebuilt. The
201
190
AUTO_INC lock gives exclusive access to the auto-inc counter of the
202
191
table. The lock is reserved only for the duration of an SQL statement.
203
192
It is not compatible with another AUTO_INC or exclusive lock on the
205
@return error code or DB_SUCCESS */
208
196
row_lock_table_autoinc_for_mysql(
209
197
/*=============================*/
210
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in the MySQL
198
/* out: error code or DB_SUCCESS */
199
row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL
212
/*********************************************************************//**
213
Sets a table lock on the table mentioned in prebuilt.
214
@return error code or DB_SUCCESS */
201
/*************************************************************************
202
Sets a table lock on the table mentioned in prebuilt. */
217
205
row_lock_table_for_mysql(
218
206
/*=====================*/
219
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct in the MySQL
207
/* out: error code or DB_SUCCESS */
208
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
221
dict_table_t* table, /*!< in: table to lock, or NULL
210
dict_table_t* table, /* in: table to lock, or NULL
222
211
if prebuilt->table should be
224
213
prebuilt->select_lock_type */
225
ulint mode); /*!< in: lock mode of table
214
ulint mode); /* in: lock mode of table
226
215
(ignored if table==NULL) */
228
/*********************************************************************//**
229
Does an insert for MySQL.
230
@return error code or DB_SUCCESS */
217
/*************************************************************************
218
Does an insert for MySQL. */
233
221
row_insert_for_mysql(
234
222
/*=================*/
235
byte* mysql_rec, /*!< in: row in the MySQL format */
236
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL
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
238
/*********************************************************************//**
227
/*************************************************************************
239
228
Builds a dummy query graph used in selects. */
242
231
row_prebuild_sel_graph(
243
232
/*===================*/
244
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL
233
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
246
/*********************************************************************//**
235
/*************************************************************************
247
236
Gets pointer to a prebuilt update vector used in updates. If the update
248
237
graph has not yet been built in the prebuilt struct, then this function
250
@return prebuilt update vector */
253
241
row_get_prebuilt_update_vector(
254
242
/*===========================*/
255
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL
243
/* out: prebuilt update vector */
244
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
257
/*********************************************************************//**
246
/*************************************************************************
258
247
Checks if a table is such that we automatically created a clustered
259
index on it (on row id).
260
@return TRUE if the clustered index was generated automatically */
248
index on it (on row id). */
263
251
row_table_got_default_clust_index(
264
252
/*==============================*/
265
const dict_table_t* table); /*!< in: table */
266
/*********************************************************************//**
267
Does an update or delete of a row for MySQL.
268
@return error code or DB_SUCCESS */
253
const dict_table_t* table);
254
/*************************************************************************
255
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 */
259
row_get_mysql_key_number_for_index(
260
/*===============================*/
261
const dict_index_t* index);
262
/*************************************************************************
263
Does an update or delete of a row for MySQL. */
271
266
row_update_for_mysql(
272
267
/*=================*/
273
byte* mysql_rec, /*!< in: the row to be updated, in
268
/* out: error code or DB_SUCCESS */
269
byte* mysql_rec, /* in: the row to be updated, in
274
270
the MySQL format */
275
row_prebuilt_t* prebuilt); /*!< in: prebuilt struct in MySQL
271
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
277
/*********************************************************************//**
278
This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
279
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
280
Before calling this function row_search_for_mysql() must have
281
initialized prebuilt->new_rec_locks to store the information which new
282
record locks really were set. This function removes a newly set
283
clustered index record lock under prebuilt->pcur or
284
prebuilt->clust_pcur. Thus, this implements a 'mini-rollback' that
285
releases the latest clustered index record lock we set.
286
@return error code or DB_SUCCESS */
273
/*************************************************************************
274
This can only be used when srv_locks_unsafe_for_binlog is TRUE or
275
session is using a READ COMMITTED isolation level. Before
276
calling this function we must use trx_reset_new_rec_lock_info() and
277
trx_register_new_rec_lock() to store the information which new record locks
278
really were set. This function removes a newly set lock under prebuilt->pcur,
279
and also under prebuilt->clust_pcur. Currently, this is only used and tested
280
in the case of an UPDATE or a DELETE statement, where the row lock is of the
282
Thus, this implements a 'mini-rollback' that releases the latest record
289
286
row_unlock_for_mysql(
290
287
/*=================*/
291
row_prebuilt_t* prebuilt, /*!< in/out: prebuilt struct in MySQL
288
/* out: error code or DB_SUCCESS */
289
row_prebuilt_t* prebuilt, /* in: prebuilt struct in MySQL
293
ibool has_latches_on_recs);/*!< in: TRUE if called
294
so that we have the latches on
295
the records under pcur and
296
clust_pcur, and we do not need
297
to reposition the cursors. */
298
/*********************************************************************//**
291
ibool has_latches_on_recs);/* TRUE if called so that we have
292
the latches on the records under pcur
293
and clust_pcur, and we do not need to
294
reposition the cursors. */
295
/*************************************************************************
299
296
Creates an query graph node of 'update' type to be used in the MySQL
301
@return own: update node */
304
300
row_create_update_node_for_mysql(
305
301
/*=============================*/
306
dict_table_t* table, /*!< in: table to update */
307
mem_heap_t* heap); /*!< in: mem heap from which allocated */
308
/**********************************************************************//**
309
Does a cascaded delete or set null in a foreign key operation.
310
@return error code or DB_SUCCESS */
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. */
313
309
row_update_cascade_for_mysql(
314
310
/*=========================*/
315
que_thr_t* thr, /*!< in: query thread */
316
upd_node_t* node, /*!< in: update node used in the cascade
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
317
314
or set null operation */
318
dict_table_t* table); /*!< in: table where we do the operation */
319
/*********************************************************************//**
315
dict_table_t* table); /* in: table where we do the operation */
316
/*************************************************************************
320
317
Locks the data dictionary exclusively for performing a table create or other
321
318
data dictionary modification operation. */
324
321
row_mysql_lock_data_dictionary_func(
325
322
/*================================*/
326
trx_t* trx, /*!< in/out: transaction */
327
const char* file, /*!< in: file name */
328
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 */
329
326
#define row_mysql_lock_data_dictionary(trx) \
330
327
row_mysql_lock_data_dictionary_func(trx, __FILE__, __LINE__)
331
/*********************************************************************//**
328
/*************************************************************************
332
329
Unlocks the data dictionary exclusive lock. */
335
332
row_mysql_unlock_data_dictionary(
336
333
/*=============================*/
337
trx_t* trx); /*!< in/out: transaction */
338
/*********************************************************************//**
334
trx_t* trx); /* in/out: transaction */
335
/*************************************************************************
339
336
Locks the data dictionary in shared mode from modifications, for performing
340
337
foreign key check, rollback, or other operation invisible to MySQL. */
343
340
row_mysql_freeze_data_dictionary_func(
344
341
/*==================================*/
345
trx_t* trx, /*!< in/out: transaction */
346
const char* file, /*!< in: file name */
347
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 */
348
345
#define row_mysql_freeze_data_dictionary(trx) \
349
346
row_mysql_freeze_data_dictionary_func(trx, __FILE__, __LINE__)
350
/*********************************************************************//**
347
/*************************************************************************
351
348
Unlocks the data dictionary shared lock. */
354
351
row_mysql_unfreeze_data_dictionary(
355
352
/*===============================*/
356
trx_t* trx); /*!< in/out: transaction */
357
/*********************************************************************//**
353
trx_t* trx); /* in/out: transaction */
354
#ifndef UNIV_HOTBACKUP
355
/*************************************************************************
358
356
Creates a table for MySQL. If the name of the table ends in
359
357
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
360
358
"innodb_table_monitor", then this will also start the printing of monitor
361
359
output by the master thread. If the table name ends in "innodb_mem_validate",
362
InnoDB will try to invoke mem_validate().
363
@return error code or DB_SUCCESS */
360
InnoDB will try to invoke mem_validate(). */
366
363
row_create_table_for_mysql(
367
364
/*=======================*/
368
dict_table_t* table, /*!< in, own: table definition
365
/* out: error code or DB_SUCCESS */
366
dict_table_t* table, /* in, own: table definition
369
367
(will be freed) */
370
trx_t* trx); /*!< in: transaction handle */
371
/*********************************************************************//**
368
trx_t* trx); /* in: transaction handle */
369
/*************************************************************************
372
370
Does an index creation operation for MySQL. TODO: currently failure
373
371
to create an index results in dropping the whole table! This is no problem
374
currently as all indexes must be created at the same time as the table.
375
@return error number or DB_SUCCESS */
372
currently as all indexes must be created at the same time as the table. */
378
375
row_create_index_for_mysql(
379
376
/*=======================*/
380
dict_index_t* index, /*!< in, own: index definition
377
/* out: error number or DB_SUCCESS */
378
dict_index_t* index, /* in, own: index definition
381
379
(will be freed) */
382
trx_t* trx, /*!< in: transaction handle */
383
const ulint* field_lengths); /*!< in: if not NULL, must contain
380
trx_t* trx, /* in: transaction handle */
381
const ulint* field_lengths); /* in: if not NULL, must contain
384
382
dict_index_get_n_fields(index)
385
383
actual field lengths for the
386
384
index columns, which are
387
385
then checked for not being too
389
/*********************************************************************//**
387
/*************************************************************************
390
388
Scans a table create SQL string and adds to the data dictionary
391
389
the foreign key constraints declared in the string. This function
392
390
should be called after the indexes for a table have been created.
393
391
Each foreign key constraint must be accompanied with indexes in
394
392
bot participating tables. The indexes are allowed to contain more
395
fields than mentioned in the constraint.
396
@return error code or DB_SUCCESS */
393
fields than mentioned in the constraint. */
399
396
row_table_add_foreign_constraints(
400
397
/*==============================*/
401
trx_t* trx, /*!< in: transaction */
402
const char* sql_string, /*!< in: table create statement where
398
/* out: error code or DB_SUCCESS */
399
trx_t* trx, /* in: transaction */
400
const char* sql_string, /* in: table create statement where
403
401
foreign keys are declared like:
404
402
FOREIGN KEY (a, b) REFERENCES table2(c, d),
405
403
table2 can be written also with the
406
404
database name before it: test.table2 */
407
size_t sql_length, /*!< in: length of sql_string */
408
const char* name, /*!< in: table full name in the
405
const char* name, /* in: table full name in the
410
407
database_name/table_name */
411
ibool reject_fks); /*!< in: if TRUE, fail with error
408
ibool reject_fks); /* in: if TRUE, fail with error
412
409
code DB_CANNOT_ADD_CONSTRAINT if
413
410
any foreign keys are found. */
415
/*********************************************************************//**
412
/*************************************************************************
416
413
The master thread in srv0srv.c calls this regularly to drop tables which
417
414
we must drop in background after queries to them have ended. Such lazy
418
dropping of tables is needed in ALTER TABLE on Unix.
419
@return how many tables dropped + remaining tables in list */
415
dropping of tables is needed in ALTER TABLE on Unix. */
422
418
row_drop_tables_for_mysql_in_background(void);
423
419
/*=========================================*/
424
/*********************************************************************//**
420
/* out: how many tables dropped
421
+ remaining tables in list */
422
/*************************************************************************
425
423
Get the background drop list length. NOTE: the caller must own the kernel
427
@return how many tables in list */
430
427
row_get_background_drop_list_len_low(void);
431
428
/*======================================*/
432
/*********************************************************************//**
433
Truncates a table for MySQL.
434
@return error code or DB_SUCCESS */
429
/* out: how many tables in list */
430
/*************************************************************************
431
Truncates a table for MySQL. */
437
434
row_truncate_table_for_mysql(
438
435
/*=========================*/
439
dict_table_t* table, /*!< in: table handle */
440
trx_t* trx); /*!< in: transaction handle */
441
/*********************************************************************//**
436
/* out: error code or DB_SUCCESS */
437
dict_table_t* table, /* in: table handle */
438
trx_t* trx); /* in: transaction handle */
439
/*************************************************************************
442
440
Drops a table for MySQL. If the name of the dropped table ends in
443
441
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
444
442
"innodb_table_monitor", then this will also stop the printing of monitor
445
443
output by the master thread. If the data dictionary was not already locked
446
444
by the transaction, the transaction will be committed. Otherwise, the
447
data dictionary will remain locked.
448
@return error code or DB_SUCCESS */
445
data dictionary will remain locked. */
451
448
row_drop_table_for_mysql(
452
449
/*=====================*/
453
const char* name, /*!< in: table name */
454
trx_t* trx, /*!< in: transaction handle */
455
ibool drop_db);/*!< in: TRUE=dropping whole database */
456
/*********************************************************************//**
457
Drop all temporary tables during crash recovery. */
460
row_mysql_drop_temp_tables(void);
461
/*============================*/
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 */
463
/*********************************************************************//**
455
/*************************************************************************
464
456
Discards the tablespace of a table which stored in an .ibd file. Discarding
465
457
means that this function deletes the .ibd file and assigns a new table id for
466
the table. Also the flag table->ibd_file_missing is set TRUE.
467
@return error code or DB_SUCCESS */
458
the table. Also the flag table->ibd_file_missing is set TRUE. */
470
461
row_discard_tablespace_for_mysql(
471
462
/*=============================*/
472
const char* name, /*!< in: table name */
473
trx_t* trx); /*!< in: transaction handle */
474
/*****************************************************************//**
463
/* out: error code or DB_SUCCESS */
464
const char* name, /* in: table name */
465
trx_t* trx); /* in: transaction handle */
466
/*********************************************************************
475
467
Imports a tablespace. The space id in the .ibd file must match the space id
476
of the table in the data dictionary.
477
@return error code or DB_SUCCESS */
468
of the table in the data dictionary. */
480
471
row_import_tablespace_for_mysql(
481
472
/*============================*/
482
const char* name, /*!< in: table name */
483
trx_t* trx); /*!< in: transaction handle */
484
/*********************************************************************//**
485
Drops a database for MySQL.
486
@return error code or DB_SUCCESS */
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. */
489
480
row_drop_database_for_mysql(
490
481
/*========================*/
491
const char* name, /*!< in: database name which ends to '/' */
492
trx_t* trx); /*!< in: transaction handle */
493
/*********************************************************************//**
494
Renames a table for MySQL.
495
@return error code or DB_SUCCESS */
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. */
498
489
row_rename_table_for_mysql(
499
490
/*=======================*/
500
const char* old_name, /*!< in: old table name */
501
const char* new_name, /*!< in: new table name */
502
trx_t* trx, /*!< in: transaction handle */
503
ibool commit); /*!< in: if TRUE then commit trx */
504
/*********************************************************************//**
505
Checks that the index contains entries in an ascending order, unique
506
constraint is not broken, and calculates the number of index entries
507
in the read view of the current transaction.
508
@return DB_SUCCESS if ok */
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. */
511
row_check_index_for_mysql(
500
row_check_table_for_mysql(
512
501
/*======================*/
513
row_prebuilt_t* prebuilt, /*!< in: prebuilt struct
515
const dict_index_t* index, /*!< in: index */
516
ulint* n_rows); /*!< out: number of entries
517
seen in the consistent read */
502
/* out: DB_ERROR or DB_SUCCESS */
503
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
505
#endif /* !UNIV_HOTBACKUP */
519
/*********************************************************************//**
520
Determines if a table is a magic monitor table.
521
@return TRUE if monitor table */
507
/*************************************************************************
508
Determines if a table is a magic monitor table. */
524
511
row_is_magic_monitor_table(
525
512
/*=======================*/
526
const char* table_name); /*!< in: name of the table, in the
513
/* out: TRUE if monitor table */
514
const char* table_name); /* in: name of the table, in the
527
515
form database/table_name */
529
517
/* A struct describing a place for an individual column in the MySQL