Commit 18bb6008 authored by heikki@hundin.mysql.fi's avatar heikki@hundin.mysql.fi
Browse files

row0ins.c:

  The UNIV_DEBUG version asserted if a foreign key check failed because of a lock wait timeout
btr0cur.c:
  Fix a bug: if the primary key was updated (or delete + insert) so that only the case of characters changed, we were left with a dangling adaptive hash index pointer, often causing an assertion failure in page0page.ic line 515
parent 1111a8d6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1355,6 +1355,12 @@ btr_cur_update_in_place(
	block = buf_block_align(rec);

	if (block->is_hashed) {
	        if (row_upd_changes_ord_field_binary(NULL, index, update)) {

		        /* Remove possible hash index pointer to this record */
	                btr_search_update_hash_on_delete(cursor);
	        }

		rw_lock_x_lock(&btr_search_latch);
	}

+8 −2
Original line number Diff line number Diff line
@@ -627,6 +627,7 @@ row_ins_check_foreign_constraint(
	dict_table_t*	check_table;
	dict_index_t*	check_index;
	ulint		n_fields_cmp;
	ibool           timeout_expired;
	rec_t*		rec;
	btr_pcur_t	pcur;
	ibool		moved;
@@ -791,11 +792,16 @@ row_ins_check_foreign_constraint(

		que_thr_stop_for_mysql(thr);

		row_mysql_handle_errors(&err, thr_get_trx(thr), thr, NULL);
		timeout_expired = srv_suspend_mysql_thread(thr);
	
		if (!timeout_expired) {

		        goto run_again;
		}

		err = DB_LOCK_WAIT_TIMEOUT;
	}

	return(err);
}