Skip to content

Commit 63c834e

Browse files
committed
Merge branch 'merge-xtradb-5.5' into 5.5
2 parents 24ac546 + c9e56d5 commit 63c834e

File tree

6 files changed

+60
-27
lines changed

6 files changed

+60
-27
lines changed

storage/xtradb/buf/buf0flu.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
55
This program is free software; you can redistribute it and/or modify it under
66
the terms of the GNU General Public License as published by the Free Software
@@ -2214,12 +2214,7 @@ buf_flush_stat_update(void)
22142214
ib_uint64_t lsn;
22152215
ulint n_flushed;
22162216

2217-
lsn = log_get_lsn_nowait();
2218-
2219-
/* log_get_lsn_nowait tries to get log_sys->mutex with
2220-
mutex_enter_nowait, if this does not succeed function
2221-
returns 0, do not use that value to update stats. */
2222-
if (lsn == 0) {
2217+
if (!log_peek_lsn(&lsn)) {
22232218
return;
22242219
}
22252220

storage/xtradb/handler/ha_innodb.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4440,7 +4440,7 @@ building based on the assumption that there is no concurrent
44404440
index creation/drop and DMLs that requires index lookup. All table
44414441
handle will be closed before the index creation/drop.
44424442
@return TRUE if index translation table built successfully */
4443-
static
4443+
UNIV_INTERN
44444444
ibool
44454445
innobase_build_index_translation(
44464446
/*=============================*/

storage/xtradb/handler/ha_innodb.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,3 +412,26 @@ innobase_index_name_is_reserved(
412412
ulint num_of_keys); /*!< in: Number of indexes to
413413
be created. */
414414

415+
/*******************************************************************//**
416+
This function builds a translation table in INNOBASE_SHARE
417+
structure for fast index location with mysql array number from its
418+
table->key_info structure. This also provides the necessary translation
419+
between the key order in mysql key_info and Innodb ib_table->indexes if
420+
they are not fully matched with each other.
421+
Note we do not have any mutex protecting the translation table
422+
building based on the assumption that there is no concurrent
423+
index creation/drop and DMLs that requires index lookup. All table
424+
handle will be closed before the index creation/drop.
425+
@return TRUE if index translation table built successfully */
426+
UNIV_INTERN
427+
ibool
428+
innobase_build_index_translation(
429+
/*=============================*/
430+
const TABLE* table, /*!< in: table in MySQL data
431+
dictionary */
432+
dict_table_t* ib_table, /*!< in: table in Innodb data
433+
dictionary */
434+
INNOBASE_SHARE* share); /*!< in/out: share structure
435+
where index translation table
436+
will be constructed in. */
437+

storage/xtradb/handler/handler0alter.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,22 @@ ha_innobase::final_add_index(
10831083

10841084
trx_free_for_mysql(trx);
10851085

1086+
/* Rebuild index translation table now for temporary tables if we are
1087+
restoring secondary keys, as ha_innobase::open will not be called for
1088+
the next access. */
1089+
if (add->indexed_table == prebuilt->table
1090+
&& dict_table_is_temporary(prebuilt->table))
1091+
{
1092+
if (!innobase_build_index_translation(add_arg->table,
1093+
prebuilt->table, share))
1094+
{
1095+
/* We don't know whether index translation build failed
1096+
because of DD mismatch or OOM, return non-specific
1097+
error code. */
1098+
err = -1;
1099+
}
1100+
}
1101+
10861102
/* There might be work for utility threads.*/
10871103
srv_active_wake_master_thread();
10881104

storage/xtradb/include/univ.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ component, i.e. we show M.N.P as M.N */
6464
(INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
6565

6666
#ifndef PERCONA_INNODB_VERSION
67-
#define PERCONA_INNODB_VERSION 37.7
67+
#define PERCONA_INNODB_VERSION 37.8
6868
#endif
6969

70-
#define INNODB_VERSION_STR "5.5.47-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
70+
#define INNODB_VERSION_STR "5.5.48-MariaDB-" IB_TO_STR(PERCONA_INNODB_VERSION)
7171

7272
#define REFMAN "http://dev.mysql.com/doc/refman/" \
7373
IB_TO_STR(MYSQL_MAJOR_VERSION) "." \

storage/xtradb/srv/srv0srv.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2008, 2009 Google Inc.
55
Copyright (c) 2009, Percona Inc.
66
Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved.
@@ -2902,6 +2902,8 @@ srv_lock_timeout_thread(
29022902
/*********************************************************************//**
29032903
A thread which prints warnings about semaphore waits which have lasted
29042904
too long. These can be used to track bugs which cause hangs.
2905+
Note: In order to make sync_arr_wake_threads_if_sema_free work as expected,
2906+
we should avoid waiting any mutexes in this function!
29052907
@return a dummy parameter */
29062908
UNIV_INTERN
29072909
os_thread_ret_t
@@ -2939,24 +2941,21 @@ srv_error_monitor_thread(
29392941

29402942
/* Try to track a strange bug reported by Harald Fuchs and others,
29412943
where the lsn seems to decrease at times */
2944+
if (log_peek_lsn(&new_lsn)) {
2945+
if (new_lsn < old_lsn) {
2946+
ut_print_timestamp(stderr);
2947+
fprintf(stderr,
2948+
" InnoDB: Error: old log sequence number %llu"
2949+
" was greater\n"
2950+
"InnoDB: than the new log sequence number %llu!\n"
2951+
"InnoDB: Please submit a bug report"
2952+
" to http://bugs.mysql.com\n",
2953+
old_lsn, new_lsn);
2954+
ut_ad(0);
2955+
}
29422956

2943-
/* We have to use nowait to ensure we don't block */
2944-
new_lsn= log_get_lsn_nowait();
2945-
2946-
if (new_lsn && new_lsn < old_lsn) {
2947-
ut_print_timestamp(stderr);
2948-
fprintf(stderr,
2949-
" InnoDB: Error: old log sequence number %llu"
2950-
" was greater\n"
2951-
"InnoDB: than the new log sequence number %llu!\n"
2952-
"InnoDB: Please submit a bug report"
2953-
" to http://bugs.mysql.com\n",
2954-
old_lsn, new_lsn);
2955-
ut_ad(0);
2956-
}
2957-
2958-
if (new_lsn)
29592957
old_lsn = new_lsn;
2958+
}
29602959

29612960
if (difftime(time(NULL), srv_last_monitor_time) > 60) {
29622961
/* We referesh InnoDB Monitor values so that averages are

0 commit comments

Comments
 (0)