51 #define ROW_INS_PREV 1
52 #define ROW_INS_NEXT 2
81 node->ins_type = ins_type;
83 node->
state = INS_NODE_SET_IX_LOCK;
94 node->magic_n = INS_NODE_MAGIC_N;
110 ut_ad(node->entry_sys_heap);
114 index = dict_table_get_first_index(node->
table);
116 while (index != NULL) {
118 node->entry_sys_heap);
121 index = dict_table_get_next_index(index);
129 row_ins_alloc_sys_fields(
142 heap = node->entry_sys_heap;
144 ut_ad(row && table && heap);
149 col = dict_table_get_sys_col(table, DATA_ROW_ID);
157 node->row_id_buf = ptr;
161 col = dict_table_get_sys_col(table, DATA_TRX_ID);
168 node->trx_id_buf = ptr;
172 col = dict_table_get_sys_col(table, DATA_ROLL_PTR);
191 node->
state = INS_NODE_SET_IX_LOCK;
205 row_ins_alloc_sys_fields(node);
220 row_ins_sec_index_entry_by_modify(
257 update, 0, thr, mtr);
261 case DB_ZIP_OVERFLOW:
268 err = DB_LOCK_TABLE_FULL;
274 &heap, &dummy_big_rec, update,
276 ut_ad(!dummy_big_rec);
291 row_ins_clust_index_entry_by_modify(
338 case DB_ZIP_OVERFLOW:
345 return(DB_LOCK_TABLE_FULL);
349 heap, big_rec, update,
362 row_ins_cascade_ancestor_updates_table(
376 if (upd_node->
table == table && upd_node->is_delete == FALSE) {
395 row_ins_cascade_n_ancestors(
400 ulint n_ancestors = 0;
424 row_ins_cascade_calc_update_vec(
440 upd_t* parent_update;
442 ulint n_fields_updated;
443 ulint parent_field_no;
458 parent_table = node->
table;
461 parent_update = node->
update;
468 n_fields_updated = 0;
470 for (i = 0; i < foreign->
n_fields; i++) {
476 for (j = 0; j < parent_update->
n_fields; j++) {
477 parent_ufield = parent_update->
fields + j;
479 if (parent_ufield->
field_no == parent_field_no) {
491 ufield = update->
fields + n_fields_updated;
508 && (col->
prtype & DATA_NOT_NULL)) {
510 return(ULINT_UNDEFINED);
521 static_cast<const char *>(dfield_get_data(&ufield->
new_val)))
524 return(ULINT_UNDEFINED);
539 if (min_size > ufield_len) {
549 pad = padded_data + ufield_len;
550 pad_len = min_size - ufield_len;
553 dfield_get_data(&ufield
559 ut_ad(!(ufield_len % mbminlen));
560 ut_ad(!(min_size % mbminlen));
565 == DATA_MYSQL_BINARY_CHARSET_COLL) {
567 return(ULINT_UNDEFINED);
573 padded_data, min_size);
581 update->
n_fields = n_fields_updated;
583 return(n_fields_updated);
591 row_ins_set_detailed(
596 mutex_enter(&srv_misc_tmpfile_mutex);
597 rewind(srv_misc_tmpfile);
603 srv_misc_tmpfile, trx, foreign, FALSE);
609 mutex_exit(&srv_misc_tmpfile_mutex);
617 row_ins_foreign_report_err(
629 FILE* ef = dict_foreign_err_file;
632 row_ins_set_detailed(trx, foreign);
634 mutex_enter(&dict_foreign_err_mutex);
637 fputs(
" Transaction:\n", ef);
640 fputs(
"Foreign key constraint fails for table ", ef);
647 fputs(
" in parent table, in index ", ef);
650 fputs(
" tuple:\n", ef);
653 fputs(
"\nBut in child table ", ef);
655 fputs(
", in index ", ef);
658 fputs(
", there is a record:\n", ef);
661 fputs(
", the record is not available\n", ef);
665 mutex_exit(&dict_foreign_err_mutex);
674 row_ins_foreign_report_add_err(
684 FILE* ef = dict_foreign_err_file;
686 row_ins_set_detailed(trx, foreign);
688 mutex_enter(&dict_foreign_err_mutex);
691 fputs(
" Transaction:\n", ef);
693 fputs(
"Foreign key constraint fails for table ", ef);
698 fputs(
"\nTrying to add in child table, in index ", ef);
701 fputs(
" tuple:\n", ef);
706 fputs(
"\nBut in parent table ", ef);
708 fputs(
", in index ", ef);
710 fputs(
",\nthe closest match we can find is record:\n", ef);
723 mutex_exit(&dict_foreign_err_mutex);
730 row_ins_invalidate_query_cache(
739 ulint len = strlen(name) + 1;
745 ptr = strchr(buf,
'/');
759 row_ins_foreign_check_on_constraint(
780 const rec_t* clust_rec;
802 row_ins_invalidate_query_cache(thr, table->
name);
806 if (node->is_delete && 0 == (foreign->
type
810 row_ins_foreign_report_err(
"Trying to delete",
812 btr_pcur_get_rec(pcur), entry);
814 return(DB_ROW_IS_REFERENCED);
817 if (!node->is_delete && 0 == (foreign->
type
823 row_ins_foreign_report_err(
"Trying to update",
825 btr_pcur_get_rec(pcur), entry);
827 return(DB_ROW_IS_REFERENCED);
830 if (node->cascade_node == NULL) {
837 table, node->cascade_heap);
846 cascade = node->cascade_node;
848 cascade->
table = table;
850 cascade->foreign = foreign;
854 cascade->is_delete = TRUE;
856 cascade->is_delete = FALSE;
858 if (foreign->
n_fields > cascade->update_n_fields) {
863 cascade->update_n_fields = foreign->
n_fields;
875 if (!cascade->is_delete
876 && row_ins_cascade_ancestor_updates_table(cascade, table)) {
881 err = DB_ROW_IS_REFERENCED;
883 row_ins_foreign_report_err(
884 "Trying an update, possibly causing a cyclic"
886 "in the child table,", thr, foreign,
887 btr_pcur_get_rec(pcur), entry);
889 goto nonstandard_exit_func;
892 if (row_ins_cascade_n_ancestors(cascade) >= 15) {
893 err = DB_ROW_IS_REFERENCED;
895 row_ins_foreign_report_err(
896 "Trying a too deep cascaded delete or update\n",
897 thr, foreign, btr_pcur_get_rec(pcur), entry);
899 goto nonstandard_exit_func;
902 index = btr_pcur_get_btr_cur(pcur)->index;
906 rec = btr_pcur_get_rec(pcur);
914 clust_block = btr_pcur_get_block(pcur);
919 clust_index = dict_table_get_first_index(table);
925 btr_pcur_open_with_no_init(clust_index, ref,
927 cascade->
pcur, 0, mtr);
929 clust_rec = btr_pcur_get_rec(cascade->
pcur);
930 clust_block = btr_pcur_get_block(cascade->
pcur);
936 fputs(
"InnoDB: error in cascade of a foreign key op\n"
941 "InnoDB: record ", stderr);
944 "InnoDB: clustered record ", stderr);
945 rec_print(stderr, clust_rec, clust_index);
947 "InnoDB: Submit a detailed bug report to"
948 " http://bugs.mysql.com\n", stderr);
952 goto nonstandard_exit_func;
960 if (err == DB_SUCCESS) {
966 0, clust_block, clust_rec, clust_index,
970 if (err != DB_SUCCESS) {
972 goto nonstandard_exit_func;
981 goto nonstandard_exit_func;
997 for (i = 0; i < foreign->
n_fields; i++) {
1009 if (!node->is_delete
1017 n_to_update = row_ins_cascade_calc_update_vec(node, foreign,
1019 if (n_to_update == ULINT_UNDEFINED) {
1020 err = DB_ROW_IS_REFERENCED;
1022 row_ins_foreign_report_err(
1023 "Trying a cascaded update where the"
1024 " updated value in the child\n"
1025 "table would not fit in the length"
1026 " of the column, or the value would\n"
1027 "be NULL and the column is"
1028 " declared as not NULL in the child table,",
1029 thr, foreign, btr_pcur_get_rec(pcur), entry);
1031 goto nonstandard_exit_func;
1042 goto nonstandard_exit_func;
1051 if (index == clust_index) {
1061 cascade->
state = UPD_NODE_UPDATE_CLUSTERED;
1068 "InnoDB: error: table %s has the counter 0"
1069 " though there is\n"
1070 "InnoDB: a FOREIGN KEY check running on it.\n",
1081 row_mysql_freeze_data_dictionary(
thr_get_trx(thr));
1099 nonstandard_exit_func:
1124 row_ins_set_shared_rec_lock(
1131 const ulint* offsets,
1140 0, block, rec, index, offsets, LOCK_S, type, thr);
1143 0, block, rec, index, offsets, LOCK_S, type, thr);
1155 row_ins_set_exclusive_rec_lock(
1162 const ulint* offsets,
1171 0, block, rec, index, offsets, LOCK_X, type, thr);
1174 0, block, rec, index, offsets, LOCK_X, type, thr);
1211 ulint offsets_[REC_OFFS_NORMAL_SIZE];
1212 ulint* offsets = offsets_;
1213 rec_offs_init(offsets_);
1216 #ifdef UNIV_SYNC_DEBUG
1222 if (trx->check_foreigns == FALSE) {
1232 for (i = 0; i < foreign->
n_fields; i++) {
1234 dtuple_get_nth_field(entry, i))) {
1243 if (!(upd_node->is_delete) && upd_node->foreign == foreign) {
1274 FILE* ef = dict_foreign_err_file;
1276 row_ins_set_detailed(trx, foreign);
1278 mutex_enter(&dict_foreign_err_mutex);
1281 fputs(
" Transaction:\n", ef);
1283 fputs(
"Foreign key constraint fails for table ", ef);
1288 ef, trx, foreign, TRUE);
1289 fputs(
"\nTrying to add to index ", ef);
1292 fputs(
" tuple:\n", ef);
1294 fputs(
"\nBut the parent table ", ef);
1297 fputs(
"\nor its .ibd file does"
1298 " not currently exist!\n", ef);
1299 mutex_exit(&dict_foreign_err_mutex);
1301 err = DB_NO_REFERENCED_ROW;
1310 if (check_table != table) {
1314 err =
lock_table(0, check_table, LOCK_IS, thr);
1316 if (err != DB_SUCCESS) {
1318 goto do_possible_lock_wait;
1330 btr_pcur_open(check_index, entry, PAGE_CUR_GE,
1336 const rec_t* rec = btr_pcur_get_rec(&pcur);
1337 const buf_block_t* block = btr_pcur_get_block(&pcur);
1344 offsets = rec_get_offsets(rec, check_index,
1345 offsets, ULINT_UNDEFINED, &heap);
1366 err = row_ins_set_shared_rec_lock(
1368 rec, check_index, offsets, thr);
1381 err = row_ins_set_shared_rec_lock(
1383 rec, check_index, offsets, thr);
1397 }
else if (foreign->
type != 0) {
1402 err = row_ins_foreign_check_on_constraint(
1403 thr, foreign, &pcur, entry,
1405 if (err != DB_SUCCESS) {
1418 if (err == DB_DUPLICATE_KEY) {
1419 err = DB_FOREIGN_DUPLICATE_KEY;
1428 block = btr_pcur_get_block(&pcur);
1430 row_ins_foreign_report_err(
1431 "Trying to delete or update",
1432 thr, foreign, rec, entry);
1434 err = DB_ROW_IS_REFERENCED;
1441 err = row_ins_set_shared_rec_lock(
1443 rec, check_index, offsets, thr);
1449 err = DB_NO_REFERENCED_ROW;
1450 row_ins_foreign_report_add_err(
1451 trx, foreign, rec, entry);
1462 row_ins_foreign_report_add_err(
1463 trx, foreign, btr_pcur_get_rec(&pcur), entry);
1464 err = DB_NO_REFERENCED_ROW;
1477 do_possible_lock_wait:
1478 if (err == DB_LOCK_WAIT) {
1494 if (UNIV_LIKELY_NULL(heap)) {
1509 row_ins_check_foreign_constraints(
1519 ibool got_s_lock = FALSE;
1536 row_mysql_freeze_data_dictionary(trx);
1554 TRUE, foreign, table, entry, thr);
1571 if (err != DB_SUCCESS) {
1588 row_ins_dupl_error_with_rec(
1595 const ulint* offsets)
1597 ulint matched_fields;
1598 ulint matched_bytes;
1610 &matched_fields, &matched_bytes);
1612 if (matched_fields < n_unique) {
1622 for (i = 0; i < n_unique; i++) {
1624 dtuple_get_nth_field(entry, i))) {
1641 row_ins_scan_sec_index_for_duplicate(
1652 ulint err = DB_SUCCESS;
1653 unsigned allow_duplicates;
1656 ulint offsets_[REC_OFFS_NORMAL_SIZE];
1657 ulint* offsets = offsets_;
1658 rec_offs_init(offsets_);
1666 for (i = 0; i < n_unique; i++) {
1668 dtuple_get_nth_field(entry, i))) {
1682 btr_pcur_open(index, entry, PAGE_CUR_GE,
BTR_SEARCH_LEAF, &pcur, &mtr);
1689 const rec_t* rec = btr_pcur_get_rec(&pcur);
1690 const buf_block_t* block = btr_pcur_get_block(&pcur);
1697 offsets = rec_get_offsets(rec, index, offsets,
1698 ULINT_UNDEFINED, &heap);
1700 if (allow_duplicates) {
1707 err = row_ins_set_exclusive_rec_lock(
1709 rec, index, offsets, thr);
1712 err = row_ins_set_shared_rec_lock(
1714 rec, index, offsets, thr);
1734 if (row_ins_dupl_error_with_rec(rec, entry,
1736 err = DB_DUPLICATE_KEY;
1749 if (UNIV_LIKELY_NULL(heap)) {
1769 row_ins_duplicate_error_in_clust(
1781 ulint offsets_[REC_OFFS_NORMAL_SIZE];
1782 ulint* offsets = offsets_;
1783 rec_offs_init(offsets_);
1810 offsets = rec_get_offsets(rec, cursor->
index, offsets,
1811 ULINT_UNDEFINED, &heap);
1825 err = row_ins_set_exclusive_rec_lock(
1828 rec, cursor->
index, offsets, thr);
1831 err = row_ins_set_shared_rec_lock(
1834 cursor->
index, offsets, thr);
1845 if (row_ins_dupl_error_with_rec(
1846 rec, entry, cursor->
index, offsets)) {
1848 err = DB_DUPLICATE_KEY;
1854 if (cursor->
up_match >= n_unique) {
1859 offsets = rec_get_offsets(rec, cursor->
index, offsets,
1860 ULINT_UNDEFINED, &heap);
1869 err = row_ins_set_exclusive_rec_lock(
1872 rec, cursor->
index, offsets, thr);
1875 err = row_ins_set_shared_rec_lock(
1878 rec, cursor->
index, offsets, thr);
1889 if (row_ins_dupl_error_with_rec(
1890 rec, entry, cursor->
index, offsets)) {
1892 err = DB_DUPLICATE_KEY;
1903 if (UNIV_LIKELY_NULL(heap)) {
1920 row_ins_must_modify(
1936 if (cursor->
low_match >= enough_match) {
1942 return(ROW_INS_PREV);
1962 row_ins_index_entry_low(
1995 }
else if (!(
thr_get_trx(thr)->check_unique_secondary)) {
2003 &cursor, 0, __FILE__, __LINE__, &mtr);
2019 page_get_infimum_rec(page));
2036 err = row_ins_duplicate_error_in_clust(
2037 &cursor, entry, thr, &mtr);
2038 if (err != DB_SUCCESS) {
2044 err = row_ins_scan_sec_index_for_duplicate(
2048 if (err != DB_SUCCESS) {
2063 __FILE__, __LINE__, &mtr);
2067 modify = row_ins_must_modify(&cursor);
2074 if (modify == ROW_INS_NEXT) {
2082 err = row_ins_clust_index_entry_by_modify(
2083 mode, &cursor, &heap, &big_rec, entry,
2087 err = row_ins_sec_index_entry_by_modify(
2088 mode, &cursor, entry, thr, &mtr);
2093 0, &cursor, entry, &insert_rec, &big_rec,
2099 err = DB_LOCK_TABLE_FULL;
2104 0, &cursor, entry, &insert_rec, &big_rec,
2112 if (UNIV_LIKELY_NULL(big_rec)) {
2119 __FILE__, __LINE__, &mtr);
2121 offsets = rec_get_offsets(exit_rec, index, NULL,
2122 ULINT_UNDEFINED, &heap);
2126 exit_rec, offsets, &mtr, FALSE, big_rec);
2137 if (UNIV_LIKELY_NULL(heap)) {
2163 err =
static_cast<db_err>(row_ins_check_foreign_constraints(index->
table, index,
2165 if (err != DB_SUCCESS) {
2175 if (err != DB_FAIL) {
2192 row_ins_index_entry_set_vals(
2201 ut_ad(entry && row);
2205 for (i = 0; i < n_fields; i++) {
2211 field = dtuple_get_nth_field(entry, i);
2212 ind_field = dict_index_get_nth_field(index, i);
2213 row_field = dtuple_get_nth_field(row, ind_field->
col->
ind);
2226 len, static_cast<const char *>(dfield_get_data(row_field)));
2245 row_ins_index_entry_step(
2254 row_ins_index_entry_set_vals(node->
index, node->
entry, node->
row);
2267 row_ins_alloc_row_id_step(
2293 row_ins_get_row_from_values(
2297 que_node_t* list_node;
2309 list_node = node->values_list;
2314 dfield = dtuple_get_nth_field(row, i);
2326 row_ins_get_row_from_select(
2330 que_node_t* list_node;
2345 dfield = dtuple_get_nth_field(row, i);
2368 if (node->
state == INS_NODE_ALLOC_ROW_ID) {
2370 row_ins_alloc_row_id_step(node);
2372 node->
index = dict_table_get_first_index(node->
table);
2375 if (node->ins_type == INS_SEARCHED) {
2377 row_ins_get_row_from_select(node);
2379 }
else if (node->ins_type == INS_VALUES) {
2381 row_ins_get_row_from_values(node);
2384 node->
state = INS_NODE_INSERT_ENTRIES;
2387 ut_ad(node->
state == INS_NODE_INSERT_ENTRIES);
2389 while (node->
index != NULL) {
2390 err = row_ins_index_entry_step(node, thr);
2392 if (err != DB_SUCCESS) {
2397 node->
index = dict_table_get_next_index(node->
index);
2403 node->
state = INS_NODE_ALLOC_ROW_ID;
2438 node->
state = INS_NODE_SET_IX_LOCK;
2453 if (node->
state == INS_NODE_SET_IX_LOCK) {
2466 if (err != DB_SUCCESS) {
2468 goto error_handling;
2473 node->
state = INS_NODE_ALLOC_ROW_ID;
2475 if (node->ins_type == INS_SEARCHED) {
2487 if ((node->ins_type == INS_SEARCHED)
2500 err = row_ins(node, thr);
2505 if (err != DB_SUCCESS) {
2512 if (node->ins_type == INS_SEARCHED) {
UNIV_INTERN ins_node_t * ins_node_create(ulint ins_type, dict_table_t *table, mem_heap_t *heap)
UNIV_INLINE ulint btr_pcur_get_low_match(const btr_pcur_t *cursor)
UNIV_INLINE ulint dict_index_get_nth_col_no(const dict_index_t *index, ulint pos)
#define UT_LIST_GET_NEXT(NAME, N)
UNIV_INLINE void trx_start_if_not_started(trx_t *trx)
UNIV_INTERN void dtuple_convert_back_big_rec(dict_index_t *index, dtuple_t *entry, big_rec_t *vector)
UNIV_INLINE void trx_write_trx_id(byte *ptr, trx_id_t id)
enum sel_node_state state
char * foreign_table_name
UNIV_INTERN void dict_print_info_on_foreign_key_in_create_format(FILE *file, trx_t *trx, dict_foreign_t *foreign, ibool add_newline)
UNIV_INLINE void dfield_set_len(dfield_t *field, ulint len)
UNIV_INTERN int cmp_dtuple_rec(const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets)
UNIV_INTERN ulint lock_table(ulint flags, dict_table_t *table, enum lock_mode mode, que_thr_t *thr)
UNIV_INTERN void btr_cur_search_to_nth_level(dict_index_t *index, ulint level, const dtuple_t *tuple, ulint mode, ulint latch_mode, btr_cur_t *cursor, ulint has_search_latch, const char *file, ulint line, mtr_t *mtr)
const dict_index_t * error_info
UNIV_INLINE ulint dfield_is_ext(const dfield_t *field)
char * referenced_table_name_lookup
UNIV_INTERN ulint dtype_get_at_most_n_mbchars(ulint prtype, ulint mbminmaxlen, ulint prefix_len, ulint data_len, const char *str)
UNIV_INLINE ibool dict_table_is_comp(const dict_table_t *table)
UNIV_INTERN ulint btr_cur_optimistic_update(ulint flags, btr_cur_t *cursor, const upd_t *update, ulint cmpl_info, que_thr_t *thr, mtr_t *mtr)
UNIV_INTERN ulint btr_cur_pessimistic_insert(ulint flags, btr_cur_t *cursor, dtuple_t *entry, rec_t **rec, big_rec_t **big_rec, ulint n_ext, que_thr_t *thr, mtr_t *mtr)
UNIV_INTERN void ins_node_set_new_row(ins_node_t *node, dtuple_t *row)
#define DICT_FOREIGN_ON_UPDATE_CASCADE
UNIV_INTERN dtuple_t * row_build_index_entry(const dtuple_t *row, row_ext_t *ext, dict_index_t *index, mem_heap_t *heap)
UNIV_INLINE rec_t * page_rec_get_next(rec_t *rec)
#define DICT_FOREIGN_ON_DELETE_SET_NULL
UNIV_INTERN void rec_print(FILE *file, const rec_t *rec, const dict_index_t *index)
#define mem_heap_free(heap)
UNIV_INLINE page_t * btr_cur_get_page(btr_cur_t *cursor)
UNIV_INTERN void dtuple_print(FILE *f, const dtuple_t *tuple)
UNIV_INLINE const dict_col_t * dict_index_get_nth_col(const dict_index_t *index, ulint pos)
UNIV_INLINE void dfield_copy_data(dfield_t *field1, const dfield_t *field2)
UNIV_INLINE ulint dict_col_get_mbminlen(const dict_col_t *col)
char * referenced_table_name
UNIV_INTERN void row_mysql_pad_col(ulint mbminlen, byte *pad, ulint len)
UNIV_INLINE ulint dtuple_get_n_fields(const dtuple_t *tuple)
dict_index_t * foreign_index
UNIV_INLINE void btr_pcur_close(btr_pcur_t *cursor)
UNIV_INTERN void row_mysql_unfreeze_data_dictionary(trx_t *trx)
UNIV_INLINE row_id_t dict_sys_get_new_row_id(void)
UNIV_INLINE ulint dict_index_get_n_unique_in_tree(const dict_index_t *index)
UNIV_INLINE ulint rec_get_deleted_flag(const rec_t *rec, ulint comp)
UNIV_INTERN ulint btr_cur_optimistic_insert(ulint flags, btr_cur_t *cursor, dtuple_t *entry, rec_t **rec, big_rec_t **big_rec, ulint n_ext, que_thr_t *thr, mtr_t *mtr)
#define DICT_FOREIGN_ON_DELETE_CASCADE
UNIV_INLINE void eval_exp(que_node_t *exp_node)
UNIV_INLINE const rec_t * page_rec_get_prev_const(const rec_t *rec)
UNIV_INTERN void mtr_commit(mtr_t *mtr) __attribute__((nonnull))
UNIV_INLINE void log_free_check(void)
UNIV_INLINE void dfield_set_data(dfield_t *field, const void *data, ulint len)
UNIV_INLINE ulint dfield_get_len(const dfield_t *field)
#define BTR_IGNORE_SEC_UNIQUE
UNIV_INLINE void dict_sys_write_row_id(byte *field, row_id_t row_id)
UNIV_INLINE ulint rec_offs_comp(const ulint *offsets)
UNIV_INTERN int cmp_dtuple_rec_with_match(const dtuple_t *dtuple, const rec_t *rec, const ulint *offsets, ulint *matched_fields, ulint *matched_bytes)
UNIV_INTERN ibool os_file_set_eof(FILE *file)
UNIV_INTERN enum db_err lock_sec_rec_read_check_and_lock(ulint flags, const buf_block_t *block, const rec_t *rec, dict_index_t *index, const ulint *offsets, enum lock_mode mode, ulint gap_mode, que_thr_t *thr)
UNIV_INLINE void que_node_set_parent(que_node_t *node, que_node_t *parent)
UNIV_INTERN void trx_print(FILE *f, trx_t *trx, ulint max_query_len)
UNIV_INTERN ulint lock_clust_rec_read_check_and_lock_alt(ulint flags, const buf_block_t *block, const rec_t *rec, dict_index_t *index, enum lock_mode mode, ulint gap_mode, que_thr_t *thr)
UNIV_INTERN void btr_pcur_copy_stored_position(btr_pcur_t *pcur_receive, btr_pcur_t *pcur_donate)
UNIV_INTERN ulint row_update_cascade_for_mysql(que_thr_t *thr, upd_node_t *node, dict_table_t *table)
UNIV_INLINE ulint dict_col_get_no(const dict_col_t *col)
UNIV_INLINE ulint dict_index_is_clust(const dict_index_t *index) __attribute__((pure))
UNIV_INLINE ulint dtuple_get_n_fields_cmp(const dtuple_t *tuple)
UNIV_INTERN ibool dtuple_check_typed(const dtuple_t *tuple)
UNIV_INTERN void btr_pcur_store_position(btr_pcur_t *cursor, mtr_t *mtr)
ulint dict_operation_lock_mode
UNIV_INLINE rec_t * btr_cur_get_rec(btr_cur_t *cursor)
UNIV_INTERN enum db_err lock_clust_rec_read_check_and_lock(ulint flags, const buf_block_t *block, const rec_t *rec, dict_index_t *index, const ulint *offsets, enum lock_mode mode, ulint gap_mode, que_thr_t *thr)
UNIV_INTERN void ut_print_name(FILE *f, struct trx_struct *trx, ibool table_id, const char *name)
UNIV_INLINE const dict_col_t * dict_field_get_col(const dict_field_t *field)
UNIV_INTERN upd_node_t * row_create_update_node_for_mysql(dict_table_t *table, mem_heap_t *heap)
UNIV_INTERN ulint row_ins_check_foreign_constraint(ibool check_ref, dict_foreign_t *foreign, dict_table_t *table, dtuple_t *entry, que_thr_t *thr)
UNIV_INLINE void * mem_heap_alloc(mem_heap_t *heap, ulint n)
#define mem_heap_create(N)
UNIV_INTERN upd_t * row_upd_build_difference_binary(dict_index_t *index, const dtuple_t *entry, const rec_t *rec, trx_t *trx, mem_heap_t *heap)
UNIV_INLINE ibool page_rec_is_supremum(const rec_t *rec) __attribute__((const ))
UNIV_INLINE void * mem_heap_zalloc(mem_heap_t *heap, ulint n)
#define UT_LIST_ADD_LAST(NAME, BASE, N)
#define UT_LIST_GET_FIRST(BASE)
UNIV_INTERN void que_thr_stop_for_mysql(que_thr_t *thr)
UNIV_INLINE void mem_heap_empty(mem_heap_t *heap)
UNIV_INTERN dtuple_t * row_build_row_ref(ulint type, dict_index_t *index, const rec_t *rec, mem_heap_t *heap)
UNIV_INLINE ulint dfield_is_null(const dfield_t *field)
#define DICT_FOREIGN_ON_UPDATE_SET_NULL
dict_table_t * referenced_table
UNIV_INLINE void dtuple_big_rec_free(big_rec_t *vector)
UNIV_INTERN void srv_suspend_mysql_thread(que_thr_t *thr)
unsigned ibd_file_missing
UNIV_INLINE void dtuple_set_n_fields_cmp(dtuple_t *tuple, ulint n_fields_cmp)
UNIV_INLINE ulint dict_table_get_n_cols(const dict_table_t *table)
#define UT_LIST_INIT(BASE)
UNIV_INLINE que_node_t * que_node_get_parent(que_node_t *node)
ulint n_foreign_key_checks_running
UNIV_INLINE char * mem_strdupl(const char *str, ulint len)
UNIV_INLINE ulint dict_index_get_n_unique(const dict_index_t *index)
UNIV_INLINE ulint que_node_get_type(que_node_t *node)
UNIV_INLINE ulint dtype_get_charset_coll(ulint prtype)
UNIV_INTERN void trx_set_detailed_error(trx_t *trx, const char *msg)
UNIV_INLINE ibool page_rec_is_user_rec(const rec_t *rec) __attribute__((const ))
UNIV_INLINE void dfield_set_null(dfield_t *field)
UNIV_INLINE void btr_cur_position(dict_index_t *index, rec_t *rec, buf_block_t *block, btr_cur_t *cursor)
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INLINE ulint rec_get_n_fields(const rec_t *rec, const dict_index_t *index)
UNIV_INLINE ulint dict_index_is_unique(const dict_index_t *index) __attribute__((pure))
UNIV_INLINE trx_t * thr_get_trx(que_thr_t *thr)
UNIV_INLINE buf_block_t * btr_cur_get_block(btr_cur_t *cursor)
UNIV_INTERN upd_t * row_upd_build_sec_rec_difference_binary(dict_index_t *index, const dtuple_t *entry, const rec_t *rec, trx_t *trx, mem_heap_t *heap)
UNIV_INTERN void ins_node_create_entry_list(ins_node_t *node)
UNIV_INTERN ulint row_ins_index_entry(dict_index_t *index, dtuple_t *entry, ulint n_ext, ibool foreign, que_thr_t *thr)
UNIV_INTERN que_thr_t * row_ins_step(que_thr_t *thr)
UNIV_INTERN ulint dict_table_get_nth_col_pos(const dict_table_t *table, ulint n)
UNIV_INLINE void mtr_start(mtr_t *mtr) __attribute__((nonnull))
UNIV_INTERN ibool buf_LRU_buf_pool_running_out(void)
UNIV_INTERN void trx_set_detailed_error_from_file(trx_t *trx, FILE *file)
UNIV_INLINE ibool page_rec_is_infimum(const rec_t *rec) __attribute__((const ))
UNIV_INTERN dict_table_t * dict_table_get(const char *table_name, ibool inc_mysql_count)
UNIV_INLINE ulint dict_col_get_min_size(const dict_col_t *col)
dict_table_t * foreign_table
UNIV_INLINE dfield_t * que_node_get_val(que_node_t *node)
UNIV_INLINE void dfield_set_ext(dfield_t *field)
UNIV_INTERN void dict_index_name_print(FILE *file, trx_t *trx, const dict_index_t *index)
UNIV_INLINE que_node_t * que_node_get_next(que_node_t *node)
rw_lock_t dict_operation_lock
the data dictionary rw-latch protecting dict_sys
UNIV_INLINE ibool btr_pcur_move_to_next(btr_pcur_t *cursor, mtr_t *mtr)
UNIV_INLINE upd_t * upd_create(ulint n, mem_heap_t *heap)
UNIV_INTERN ulint btr_cur_pessimistic_update(ulint flags, btr_cur_t *cursor, mem_heap_t **heap, big_rec_t **big_rec, const upd_t *update, ulint cmpl_info, que_thr_t *thr, mtr_t *mtr)
UNIV_INLINE ibool rec_offs_validate(const rec_t *rec, const dict_index_t *index, const ulint *offsets)
dict_index_t * referenced_index
#define btr_store_big_rec_extern_fields(index, b, rec, offsets, mtr, upd, big)