Merge from mysql-5.1-innodb to mysql-5.5-innodb

This commit is contained in:
Jimmy Yang 2010-10-11 05:56:44 -07:00
commit 5c15a5a103
3 changed files with 18 additions and 3 deletions

View file

@ -9584,7 +9584,11 @@ ha_innobase::innobase_peek_autoinc(void)
auto_inc = dict_table_autoinc_read(innodb_table);
ut_a(auto_inc > 0);
if (auto_inc == 0) {
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: AUTOINC next value generation "
"is disabled for '%s'\n", innodb_table->name);
}
dict_table_autoinc_unlock(innodb_table);

View file

@ -3348,6 +3348,7 @@ row_search_for_mysql(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
ulint* offsets = offsets_;
ibool table_lock_waited = FALSE;
rec_offs_init(offsets_);
@ -3734,13 +3735,15 @@ release_search_latch_if_needed:
trx_assign_read_view(trx);
prebuilt->sql_stat_start = FALSE;
} else {
wait_table_again:
err = lock_table(0, index->table,
prebuilt->select_lock_type == LOCK_S
? LOCK_IS : LOCK_IX, thr);
if (err != DB_SUCCESS) {
goto lock_wait_or_error;
table_lock_waited = TRUE;
goto lock_table_wait;
}
prebuilt->sql_stat_start = FALSE;
}
@ -4551,6 +4554,7 @@ lock_wait_or_error:
btr_pcur_store_position(pcur, &mtr);
lock_table_wait:
mtr_commit(&mtr);
mtr_has_extra_clust_latch = FALSE;
@ -4568,6 +4572,14 @@ lock_wait_or_error:
thr->lock_state = QUE_THR_LOCK_NOLOCK;
mtr_start(&mtr);
/* Table lock waited, go try to obtain table lock
again */
if (table_lock_waited) {
table_lock_waited = FALSE;
goto wait_table_again;
}
sel_restore_position_for_mysql(&same_user_rec,
BTR_SEARCH_LEAF, pcur,
moves_up, &mtr);