diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2012-08-21 10:59:11 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2012-08-21 10:59:11 +0300 |
commit | b2529335511c3c1dafefd914ac5ea24014a58312 (patch) | |
tree | d3ed5b7c454e73231c3cb43c83fe93a9f4bb39a6 /storage | |
parent | 6c6d9b46a9c000d6a662c037d3a485158faf2eb1 (diff) | |
parent | 3f249921f81bec183ef2da02b839fc2f10577218 (diff) | |
download | mariadb-git-b2529335511c3c1dafefd914ac5ea24014a58312.tar.gz |
Merge mysql-5.1 to mysql-5.5.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/ibuf/ibuf0ibuf.c | 17 | ||||
-rw-r--r-- | storage/innobase/row/row0ins.c | 9 |
2 files changed, 20 insertions, 6 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index e534e165c0c..c7887afef92 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -3604,11 +3604,18 @@ bitmap_fail: root = ibuf_tree_root_get(&mtr); - err = btr_cur_pessimistic_insert(BTR_NO_LOCKING_FLAG - | BTR_NO_UNDO_LOG_FLAG, - cursor, - ibuf_entry, &ins_rec, - &dummy_big_rec, 0, thr, &mtr); + err = btr_cur_optimistic_insert( + BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG, + cursor, ibuf_entry, &ins_rec, + &dummy_big_rec, 0, thr, &mtr); + + if (err == DB_FAIL) { + err = btr_cur_pessimistic_insert( + BTR_NO_LOCKING_FLAG | BTR_NO_UNDO_LOG_FLAG, + cursor, ibuf_entry, &ins_rec, + &dummy_big_rec, 0, thr, &mtr); + } + mutex_exit(&ibuf_pessimistic_insert_mutex); ibuf_size_update(root, &mtr); mutex_exit(&ibuf_mutex); diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index 60a66ea3945..18486514267 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -2168,9 +2168,16 @@ row_ins_index_entry_low( goto function_exit; } - err = btr_cur_pessimistic_insert( + + err = btr_cur_optimistic_insert( 0, &cursor, entry, &insert_rec, &big_rec, n_ext, thr, &mtr); + + if (err == DB_FAIL) { + err = btr_cur_pessimistic_insert( + 0, &cursor, entry, &insert_rec, + &big_rec, n_ext, thr, &mtr); + } } } |