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