47
47
Reads a >= 5.0.3 format true VARCHAR length, in the MySQL row format, and
48
48
returns a pointer to the data. */
51
51
row_mysql_read_true_varchar(
52
52
/*========================*/
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
53
/* out: pointer to the data, we skip the 1 or 2 bytes
54
at the start that are used to store the len */
55
ulint* len, /* out: variable-length field length */
56
byte* field, /* in: field in the MySQL format */
57
ulint lenlen);/* in: storage length of len: either 1 or 2 bytes */
60
58
/***********************************************************************
61
59
Stores a reference to a BLOB in the MySQL format. */
64
62
row_mysql_store_blob_ref(
65
63
/*=====================*/
66
byte* dest, /* in: where to store */
67
ulint col_len,/* in: dest buffer size: determines into
64
byte* dest, /* in: where to store */
65
ulint col_len, /* in: dest buffer size: determines into
68
66
how many bytes the BLOB length is stored,
69
the space for the length may vary from 1
71
const void* data, /* in: BLOB data; if the value to store
72
is SQL NULL this should be NULL pointer */
73
ulint len); /* in: BLOB length; if the value to store
74
is SQL NULL this should be 0; remember
75
also to set the NULL bit in the MySQL record
67
this may vary from 1 to 4 bytes */
68
byte* data, /* in: BLOB data */
69
ulint len); /* in: BLOB length */
77
70
/***********************************************************************
78
71
Reads a reference to a BLOB in the MySQL format. */
81
74
row_mysql_read_blob_ref(
82
75
/*====================*/
83
/* out: pointer to BLOB data */
84
ulint* len, /* out: BLOB length */
85
const byte* ref, /* in: BLOB reference in the
87
ulint col_len); /* in: BLOB reference length
76
/* out: pointer to BLOB data */
77
ulint* len, /* out: BLOB length */
78
byte* ref, /* in: BLOB reference in the MySQL format */
79
ulint col_len); /* in: BLOB reference length (not BLOB
89
81
/******************************************************************
90
82
Stores a non-SQL-NULL field given in the MySQL format in the InnoDB format.
91
83
The counterpart of this function is row_sel_field_store_in_mysql_format() in
95
87
row_mysql_store_col_in_innobase_format(
96
88
/*===================================*/
109
101
format differs in a row and in a
110
102
key value: in a key value the length
111
103
is always stored in 2 bytes! */
112
const byte* mysql_data, /* in: MySQL column value, not
104
byte* mysql_data, /* in: MySQL column value, not
113
105
SQL NULL; NOTE that dfield may also
114
106
get a pointer to mysql_data,
115
107
therefore do not discard this as long
145
137
dict_table_t* table); /* in: Innobase table handle */
146
138
/************************************************************************
147
139
Free a prebuilt struct for a MySQL table handle. */
150
142
row_prebuilt_free(
151
143
/*==============*/
152
row_prebuilt_t* prebuilt, /* in, own: prebuilt struct */
153
ibool dict_locked); /* in: TRUE=data dictionary locked */
144
row_prebuilt_t* prebuilt); /* in, own: prebuilt struct */
154
145
/*************************************************************************
155
146
Updates the transaction pointers in query graphs stored in the prebuilt
159
150
row_update_prebuilt_trx(
160
151
/*====================*/
230
221
/*************************************************************************
231
222
Checks if a table is such that we automatically created a clustered
232
223
index on it (on row id). */
235
226
row_table_got_default_clust_index(
236
227
/*==============================*/
237
const dict_table_t* table);
228
dict_table_t* table);
238
229
/*************************************************************************
239
230
Calculates the key number used inside MySQL for an Innobase index. We have
240
231
to take into account if we generated a default clustered index for the table */
243
234
row_get_mysql_key_number_for_index(
244
235
/*===============================*/
245
const dict_index_t* index);
236
dict_index_t* index);
246
237
/*************************************************************************
247
238
Does an update or delete of a row for MySQL. */
250
241
row_update_for_mysql(
251
242
/*=================*/
300
291
/*************************************************************************
301
292
Locks the data dictionary exclusively for performing a table create or other
302
293
data dictionary modification operation. */
305
296
row_mysql_lock_data_dictionary(
306
297
/*===========================*/
307
298
trx_t* trx); /* in: transaction */
308
299
/*************************************************************************
309
300
Unlocks the data dictionary exclusive lock. */
312
303
row_mysql_unlock_data_dictionary(
313
304
/*=============================*/
315
306
/*************************************************************************
316
307
Locks the data dictionary in shared mode from modifications, for performing
317
308
foreign key check, rollback, or other operation invisible to MySQL. */
320
311
row_mysql_freeze_data_dictionary(
321
312
/*=============================*/
322
313
trx_t* trx); /* in: transaction */
323
314
/*************************************************************************
324
315
Unlocks the data dictionary shared lock. */
327
318
row_mysql_unfreeze_data_dictionary(
328
319
/*===============================*/
329
320
trx_t* trx); /* in: transaction */
330
#ifndef UNIV_HOTBACKUP
331
321
/*************************************************************************
332
Creates a table for MySQL. If the name of the table ends in
322
Drops a table for MySQL. If the name of the table ends in
333
323
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
334
324
"innodb_table_monitor", then this will also start the printing of monitor
335
325
output by the master thread. If the table name ends in "innodb_mem_validate",
336
326
InnoDB will try to invoke mem_validate(). */
339
329
row_create_table_for_mysql(
340
330
/*=======================*/
396
386
/*************************************************************************
397
387
Get the background drop list length. NOTE: the caller must own the kernel
401
391
row_get_background_drop_list_len_low(void);
402
392
/*======================================*/
403
393
/* out: how many tables in list */
404
394
/*************************************************************************
405
395
Truncates a table for MySQL. */
408
398
row_truncate_table_for_mysql(
409
399
/*=========================*/
425
415
ibool drop_db);/* in: TRUE=dropping whole database */
427
417
/*************************************************************************
428
Drops a table for MySQL but does not commit the transaction. If the
429
name of the dropped table ends in one of "innodb_monitor",
430
"innodb_lock_monitor", "innodb_tablespace_monitor",
431
"innodb_table_monitor", then this will also stop the printing of
432
monitor output by the master thread. */
435
row_drop_table_for_mysql_no_commit(
436
/*===============================*/
437
/* out: error code or DB_SUCCESS */
438
const char* name, /* in: table name */
439
trx_t* trx, /* in: transaction handle */
440
ibool drop_db);/* in: TRUE=dropping whole database */
441
/*************************************************************************
442
418
Discards the tablespace of a table which stored in an .ibd file. Discarding
443
419
means that this function deletes the .ibd file and assigns a new table id for
444
420
the table. Also the flag table->ibd_file_missing is set TRUE. */
447
423
row_discard_tablespace_for_mysql(
448
424
/*=============================*/
470
446
trx_t* trx); /* in: transaction handle */
471
447
/*************************************************************************
472
448
Renames a table for MySQL. */
475
451
row_rename_table_for_mysql(
476
452
/*=======================*/
477
453
/* out: error code or DB_SUCCESS */
478
454
const char* old_name, /* in: old table name */
479
455
const char* new_name, /* in: new table name */
480
trx_t* trx, /* in: transaction handle */
481
ibool commit); /* in: if TRUE then commit trx */
456
trx_t* trx); /* in: transaction handle */
482
457
/*************************************************************************
483
458
Checks a table for corruption. */
486
461
row_check_table_for_mysql(
487
462
/*======================*/
488
463
/* out: DB_ERROR or DB_SUCCESS */
489
464
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
491
#endif /* !UNIV_HOTBACKUP */
493
/*************************************************************************
494
Determines if a table is a magic monitor table. */
497
row_is_magic_monitor_table(
498
/*=======================*/
499
/* out: TRUE if monitor table */
500
const char* table_name); /* in: name of the table, in the
501
form database/table_name */
503
467
/* A struct describing a place for an individual column in the MySQL
504
468
row format which is presented to the table handler in ha_innobase.
543
507
it is an unsigned integer type */
546
#define MYSQL_FETCH_CACHE_SIZE 8
510
#define DRIZZLE_FETCH_CACHE_SIZE 8
547
511
/* After fetching this many rows, we start caching them in fetch_cache */
548
#define MYSQL_FETCH_CACHE_THRESHOLD 4
512
#define DRIZZLE_FETCH_CACHE_THRESHOLD 4
550
514
#define ROW_PREBUILT_ALLOCATED 78540783
551
515
#define ROW_PREBUILT_FREED 26423527
558
522
struct row_prebuilt_struct {
559
523
ulint magic_n; /* this magic number is set to
560
ROW_PREBUILT_ALLOCATED when created,
561
or ROW_PREBUILT_FREED when the
562
struct has been freed */
524
ROW_PREBUILT_ALLOCATED when created
525
and to ROW_PREBUILT_FREED when the
526
struct has been freed; used in
563
528
dict_table_t* table; /* Innobase table handle */
564
529
trx_t* trx; /* current transaction handle */
565
530
ibool sql_stat_start; /* TRUE when we start processing of
592
557
unique search from a clustered index,
593
558
because HANDLER allows NEXT and PREV
594
559
in such a situation */
595
ulint template_type; /* ROW_MYSQL_WHOLE_ROW,
596
ROW_MYSQL_REC_FIELDS,
597
ROW_MYSQL_DUMMY_TEMPLATE, or
598
ROW_MYSQL_NO_TEMPLATE */
560
ulint template_type; /* ROW_DRIZZLE_WHOLE_ROW,
561
ROW_DRIZZLE_REC_FIELDS,
562
ROW_DRIZZLE_DUMMY_TEMPLATE, or
563
ROW_DRIZZLE_NO_TEMPLATE */
599
564
ulint n_template; /* number of elements in the
601
566
ulint null_bitmap_len;/* number of bytes in the SQL NULL
688
653
ulint n_rows_fetched; /* number of rows fetched after
689
654
positioning the current cursor */
690
655
ulint fetch_direction;/* ROW_SEL_NEXT or ROW_SEL_PREV */
691
byte* fetch_cache[MYSQL_FETCH_CACHE_SIZE];
656
byte* fetch_cache[DRIZZLE_FETCH_CACHE_SIZE];
692
657
/* a cache for fetched rows if we
693
658
fetch many rows from the same cursor:
694
659
it saves CPU time to fetch them in a
711
676
mem_heap_t* old_vers_heap; /* memory heap where a previous
712
677
version is built in consistent read */
713
ib_uint64_t last_value; /* last value of AUTO-INC interval */
714
UT_LIST_NODE_T(row_prebuilt_t) prebuilts;
715
/* list node of table->prebuilts */
716
index_cond_func_t idx_cond_func;/* Index Condition Pushdown function,
678
uint64_t last_value; /* last value of AUTO-INC interval */
680
index_cond_func_t idx_cond_func;/* Index Condition Pushdown function,
717
681
or NULL if there is none set */
718
void* idx_cond_func_arg;/* ICP function argument */
682
void* idx_cond_func_arg;/* ICP function argument */
719
683
ulint n_index_fields; /* Number of fields at the start of
720
684
mysql_template. Valid only when using
726
690
#define ROW_PREBUILT_FETCH_MAGIC_N 465765687
728
#define ROW_MYSQL_WHOLE_ROW 0
729
#define ROW_MYSQL_REC_FIELDS 1
730
#define ROW_MYSQL_NO_TEMPLATE 2
731
#define ROW_MYSQL_DUMMY_TEMPLATE 3 /* dummy template used in
692
#define ROW_DRIZZLE_WHOLE_ROW 0
693
#define ROW_DRIZZLE_REC_FIELDS 1
694
#define ROW_DRIZZLE_NO_TEMPLATE 2
695
#define ROW_DRIZZLE_DUMMY_TEMPLATE 3 /* dummy template used in
732
696
row_scan_and_check_index */
734
698
/* Values for hint_need_to_fetch_extra_cols */