From: Date: March 31 2006 10:32pm Subject: bk commit into 5.0 tree (aivanov:1.2117) BUG#15650 List-Archive: http://lists.mysql.com/commits/4370 X-Bug: 15650 Message-Id: Below is the list of changes that have just been committed into a local 5.0 repository of alexi. When alexi does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2117 06/04/01 00:31:56 aivanov@stripped +2 -0 Applied innodb-5.0-ss398 snapshot. * Fix BUG#15650: DELETE with LEF JOIN crashes server with innodb_locks_unsafe_for_binlog. * Fix compilation problem with non-C99 compilers in btr0sea.c. sql/ha_innodb.cc 1.291 06/04/01 00:31:52 aivanov@stripped +8 -2 Applied innodb-5.0-ss398 snapshot. Remove assertion ut_error which crashes the mysqld server if it prints a warning about the adaptive latch. innobase/btr/btr0sea.c 1.41 06/04/01 00:31:51 aivanov@stripped +8 -6 Applied innodb-5.0-ss398 snapshot. Fix compilation problem with non-C99 compilers. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: aivanov # Host: mysqld.localdomain # Root: /home/alexi/innodb/mysql-5.0-ss398 --- 1.40/innobase/btr/btr0sea.c 2006-03-30 10:08:44 +04:00 +++ 1.41/innobase/btr/btr0sea.c 2006-04-01 00:31:51 +04:00 @@ -59,9 +59,6 @@ #define BTR_SEARCH_BUILD_LIMIT 100 -/* How many cells to check before temporarily releasing btr_search_latch */ -#define BTR_CHUNK_SIZE 10000 - /************************************************************************ Builds a hash index on a page with the given parameters. If the page already has a hash index with different parameters, the old hash index is removed. @@ -1607,6 +1604,11 @@ mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; + + /* How many cells to check before temporarily releasing + btr_search_latch. */ + ulint chunk_size = 10000; + *offsets_ = (sizeof offsets_) / sizeof *offsets_; rw_lock_x_lock(&btr_search_latch); @@ -1616,7 +1618,7 @@ for (i = 0; i < cell_count; i++) { /* We release btr_search_latch every once in a while to give other queries a chance to run. */ - if ((i != 0) && ((i % BTR_CHUNK_SIZE) == 0)) { + if ((i != 0) && ((i % chunk_size) == 0)) { rw_lock_x_unlock(&btr_search_latch); os_thread_yield(); rw_lock_x_lock(&btr_search_latch); @@ -1675,8 +1677,8 @@ } } - for (i = 0; i < cell_count; i += BTR_CHUNK_SIZE) { - ulint end_index = ut_min(i + BTR_CHUNK_SIZE - 1, cell_count - 1); + for (i = 0; i < cell_count; i += chunk_size) { + ulint end_index = ut_min(i + chunk_size - 1, cell_count - 1); /* We release btr_search_latch every once in a while to give other queries a chance to run. */ --- 1.290/sql/ha_innodb.cc 2006-03-29 23:04:27 +04:00 +++ 1.291/sql/ha_innodb.cc 2006-04-01 00:31:52 +04:00 @@ -989,7 +989,6 @@ mutex_enter_noninline(&kernel_mutex); trx_print(stderr, trx, 1024); mutex_exit_noninline(&kernel_mutex); - ut_error; } innobase_release_stat_resources(trx); @@ -3832,7 +3831,14 @@ mem_analyze_corruption((byte *) prebuilt->trx); ut_error; } - + + /* Consistent read does not take any locks, thus there is + nothing to unlock. */ + + if (prebuilt->select_lock_type == LOCK_NONE) { + DBUG_VOID_RETURN; + } + if (srv_locks_unsafe_for_binlog) { row_unlock_for_mysql(prebuilt, FALSE); }