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