From d60b4df1ef923d337ccff1be3c358d54ae72707e Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 2 Jun 2014 23:25:54 +0200 Subject: [PATCH] percona-server-5.5.37-35.0.tar.gz --- buf/buf0buf.c | 4 +++- fil/fil0fil.c | 22 ++++++++++++++------ handler/ha_innodb.cc | 22 +++++++++++++++++--- handler/ha_innodb.h | 1 + handler/handler0alter.cc | 4 ++-- include/univ.i | 2 +- row/row0ins.c | 6 +++++- row/row0upd.c | 43 +++++++++------------------------------- srv/srv0start.c | 6 +++++- 9 files changed, 61 insertions(+), 49 deletions(-) diff --git a/buf/buf0buf.c b/buf/buf0buf.c index c0909715972..7f5ce7c5462 100644 --- a/buf/buf0buf.c +++ b/buf/buf0buf.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Portions of this file contain modifications contributed and copyrighted by @@ -2519,7 +2519,9 @@ loop: rw_lock_s_unlock(&buf_pool->page_hash_latch); } +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG loop2: +#endif if (block && buf_pool_watch_is_sentinel(buf_pool, &block->page)) { mutex_exit(block_mutex); block = NULL; diff --git a/fil/fil0fil.c b/fil/fil0fil.c index 2ab74b1595d..67ad5ef7855 100644 --- a/fil/fil0fil.c +++ b/fil/fil0fil.c @@ -4953,14 +4953,24 @@ fil_extend_space_to_desired_size( #ifdef HAVE_POSIX_FALLOCATE if (srv_use_posix_fallocate) { - offset_high = (size_after_extend - file_start_page_no) - * page_size / (4ULL * 1024 * 1024 * 1024); - offset_low = (size_after_extend - file_start_page_no) - * page_size % (4ULL * 1024 * 1024 * 1024); + + ib_int64_t start_offset + = file_start_page_no * page_size; + ib_int64_t end_offset + = (size_after_extend - file_start_page_no) * page_size; mutex_exit(&fil_system->mutex); - success = os_file_set_size(node->name, node->handle, - offset_low, offset_high); + success = (posix_fallocate(node->handle, start_offset, + end_offset) == 0); + if (!success) + { + fprintf(stderr, + "InnoDB: Error: preallocating file space for " + "file \'%s\' failed. Current size %lld, " + "len %lld, desired size %lld\n", node->name, + start_offset, end_offset, + start_offset + end_offset); + } mutex_enter(&fil_system->mutex); if (success) { node->size += (size_after_extend - start_page_no); diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index 148b872f337..396a33cdf13 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2000, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2000, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. @@ -2936,7 +2936,8 @@ skip_relay: internal_innobase_data_file_path); if (ret == FALSE) { sql_print_error( - "InnoDB: syntax error in innodb_data_file_path"); + "InnoDB: syntax error in innodb_data_file_path" + " or size specified is less than 1 megabyte"); mem_free_and_error: srv_free_paths_and_sizes(); my_free(internal_innobase_data_file_path); @@ -11329,6 +11330,21 @@ ha_innobase::get_auto_increment( current = *first_value > col_max_value ? autoinc : *first_value; + /* If the increment step of the auto increment column + decreases then it is not affecting the immediate + next value in the series. */ + if (prebuilt->autoinc_increment > increment) { + + current = autoinc - prebuilt->autoinc_increment; + + current = innobase_next_autoinc( + current, 1, increment, 1, col_max_value); + + dict_table_autoinc_initialize(prebuilt->table, current); + + *first_value = current; + } + /* Compute the last value in the interval */ next_value = innobase_next_autoinc( current, *nb_reserved_values, increment, offset, @@ -13070,7 +13086,7 @@ static MYSQL_SYSVAR_ULONG(thread_concurrency, srv_thread_concurrency, static MYSQL_SYSVAR_ULONG(thread_sleep_delay, srv_thread_sleep_delay, PLUGIN_VAR_RQCMDARG, "Time of innodb thread sleeping before joining InnoDB queue (usec). Value 0 disable a sleep", - NULL, NULL, 10000L, 0L, ~0UL, 0); + NULL, NULL, 10000L, 0L, 1000000L, 0); static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, diff --git a/handler/ha_innodb.h b/handler/ha_innodb.h index 640abda20c3..773a0bbc035 100644 --- a/handler/ha_innodb.h +++ b/handler/ha_innodb.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2000, 2010, MySQL AB & Innobase Oy. All Rights Reserved. + Use is subject to license terms This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff --git a/handler/handler0alter.cc b/handler/handler0alter.cc index 7014479df70..b4d63fc23b7 100644 --- a/handler/handler0alter.cc +++ b/handler/handler0alter.cc @@ -110,16 +110,16 @@ innobase_col_to_mysql( /* These column types should never be shipped to MySQL. */ ut_ad(0); - case DATA_FIXBINARY: case DATA_FLOAT: case DATA_DOUBLE: case DATA_DECIMAL: /* Above are the valid column types for MySQL data. */ ut_ad(flen == len); /* fall through */ + case DATA_FIXBINARY: case DATA_CHAR: /* We may have flen > len when there is a shorter - prefix on a CHAR column. */ + prefix on the CHAR and BINARY column. */ ut_ad(flen >= len); #else /* UNIV_DEBUG */ default: diff --git a/include/univ.i b/include/univ.i index 318be0430d7..43eec268805 100644 --- a/include/univ.i +++ b/include/univ.i @@ -64,7 +64,7 @@ component, i.e. we show M.N.P as M.N */ (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR) #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 34.0 +#define PERCONA_INNODB_VERSION 35.0 #endif #define INNODB_VERSION_STR MYSQL_SERVER_VERSION "-" IB_TO_STR(PERCONA_INNODB_VERSION) diff --git a/row/row0ins.c b/row/row0ins.c index 0d9db2f6d1f..af2692b2f2e 100644 --- a/row/row0ins.c +++ b/row/row0ins.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2290,6 +2290,10 @@ row_ins_index_entry( { ulint err; + DBUG_EXECUTE_IF("row_ins_index_entry_timeout", { + DBUG_SET("-d,row_ins_index_entry_timeout"); + return(DB_LOCK_WAIT);}); + if (foreign && UT_LIST_GET_FIRST(index->table->foreign_list)) { err = row_ins_check_foreign_constraints(index->table, index, entry, thr); diff --git a/row/row0upd.c b/row/row0upd.c index 3560ec88e2e..370a46dc3c4 100644 --- a/row/row0upd.c +++ b/row/row0upd.c @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1789,9 +1789,7 @@ row_upd_clust_rec_by_insert_inherit_func( data += len - BTR_EXTERN_FIELD_REF_SIZE; /* The pointer must not be zero. */ ut_a(memcmp(data, field_ref_zero, BTR_EXTERN_FIELD_REF_SIZE)); - /* The BLOB must be owned. */ - ut_a(!(data[BTR_EXTERN_LEN] & BTR_EXTERN_OWNER_FLAG)); - + data[BTR_EXTERN_LEN] &= ~BTR_EXTERN_OWNER_FLAG; data[BTR_EXTERN_LEN] |= BTR_EXTERN_INHERITED_FLAG; /* The BTR_EXTERN_INHERITED_FLAG only matters in rollback. Purge will always free the extern fields of @@ -1896,7 +1894,13 @@ err_exit: rec, offsets, entry, node->update); if (change_ownership) { - btr_pcur_store_position(pcur, mtr); + /* The blobs are disowned here, expecting the + insert down below to inherit them. But if the + insert fails, then this disown will be undone + when the operation is rolled back. */ + btr_cur_disown_inherited_fields( + btr_cur_get_page_zip(btr_cur), + rec, index, offsets, node->update, mtr); } } @@ -1922,35 +1926,6 @@ err_exit: ? UPD_NODE_INSERT_BLOB : UPD_NODE_INSERT_CLUSTERED; - if (err == DB_SUCCESS && change_ownership) { - /* Mark the non-updated fields disowned by the old record. */ - - /* NOTE: this transaction has an x-lock on the record - and therefore other transactions cannot modify the - record when we have no latch on the page. In addition, - we assume that other query threads of the same - transaction do not modify the record in the meantime. - Therefore we can assert that the restoration of the - cursor succeeds. */ - - mtr_start(mtr); - - if (!btr_pcur_restore_position(BTR_MODIFY_LEAF, pcur, mtr)) { - ut_error; - } - - rec = btr_cur_get_rec(btr_cur); - offsets = rec_get_offsets(rec, index, offsets, - ULINT_UNDEFINED, &heap); - ut_ad(page_rec_is_user_rec(rec)); - - btr_cur_disown_inherited_fields( - btr_cur_get_page_zip(btr_cur), - rec, index, offsets, node->update, mtr); - - mtr_commit(mtr); - } - mem_heap_free(heap); return(err); diff --git a/srv/srv0start.c b/srv/srv0start.c index 46094759092..5c40e0b703e 100644 --- a/srv/srv0start.c +++ b/srv/srv0start.c @@ -150,7 +150,7 @@ UNIV_INTERN mysql_pfs_key_t srv_log_tracking_thread_key; #endif /* UNIV_PFS_THREAD */ /*********************************************************************//** -Convert a numeric string that optionally ends in G or M, to a number +Convert a numeric string that optionally ends in G or M or K, to a number containing megabytes. @return next character in string */ static @@ -174,6 +174,10 @@ srv_parse_megabytes( case 'M': case 'm': str++; break; + case 'K': case 'k': + size /= 1024; + str++; + break; default: size /= 1024 * 1024; break;