Skip to content

Commit 6a821d7

Browse files
committed
5.6.26-74.0
1 parent 0b3eb45 commit 6a821d7

23 files changed

+416
-307
lines changed

storage/xtradb/api/api0api.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ ib_open_table_by_id(
245245
dict_mutex_enter_for_mysql();
246246
}
247247

248-
table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
248+
table = dict_table_open_on_id(table_id, TRUE, DICT_TABLE_OP_NORMAL);
249249

250250
if (table != NULL && table->ibd_file_missing) {
251251
table = NULL;
@@ -2104,6 +2104,10 @@ ib_cursor_moveto(
21042104

21052105
n_fields = dict_index_get_n_ordering_defined_by_user(prebuilt->index);
21062106

2107+
if (n_fields > dtuple_get_n_fields(tuple->ptr)) {
2108+
n_fields = dtuple_get_n_fields(tuple->ptr);
2109+
}
2110+
21072111
dtuple_set_n_fields(search_tuple, n_fields);
21082112
dtuple_set_n_fields_cmp(search_tuple, n_fields);
21092113

@@ -3741,14 +3745,14 @@ ib_table_truncate(
37413745
if (trunc_err == DB_SUCCESS) {
37423746
ut_a(ib_trx_state(ib_trx) == static_cast<ib_trx_state_t>(
37433747
TRX_STATE_NOT_STARTED));
3744-
3745-
err = ib_trx_release(ib_trx);
3746-
ut_a(err == DB_SUCCESS);
37473748
} else {
37483749
err = ib_trx_rollback(ib_trx);
37493750
ut_a(err == DB_SUCCESS);
37503751
}
37513752

3753+
err = ib_trx_release(ib_trx);
3754+
ut_a(err == DB_SUCCESS);
3755+
37523756
/* Set the memcached_sync_count back. */
37533757
if (table != NULL && memcached_sync != 0) {
37543758
dict_mutex_enter_for_mysql();

storage/xtradb/btr/btr0cur.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4129,6 +4129,14 @@ btr_estimate_number_of_different_key_vals(
41294129
page = btr_cur_get_page(&cursor);
41304130

41314131
SRV_CORRUPT_TABLE_CHECK(page, goto exit_loop;);
4132+
DBUG_EXECUTE_IF("ib_corrupt_page_while_stats_calc",
4133+
page = NULL;);
4134+
4135+
SRV_CORRUPT_TABLE_CHECK(page,
4136+
{
4137+
mtr_commit(&mtr);
4138+
goto exit_loop;
4139+
});
41324140

41334141
rec = page_rec_get_next(page_get_infimum_rec(page));
41344142

storage/xtradb/buf/buf0flu.cc

Lines changed: 8 additions & 21 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, 2015, 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
@@ -936,12 +936,12 @@ buf_flush_write_block_low(
936936
break;
937937
case BUF_BLOCK_ZIP_DIRTY:
938938
frame = bpage->zip.data;
939-
940939
mach_write_to_8(frame + FIL_PAGE_LSN,
941940
bpage->newest_modification);
942-
memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
943941

944942
ut_a(page_zip_verify_checksum(frame, zip_size));
943+
944+
memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
945945
break;
946946
case BUF_BLOCK_FILE_PAGE:
947947
frame = bpage->zip.data;
@@ -2209,10 +2209,9 @@ Clears up tail of the LRU lists:
22092209
* Put replaceable pages at the tail of LRU to the free list
22102210
* Flush dirty pages at the tail of LRU to the disk
22112211
The depth to which we scan each buffer pool is controlled by dynamic
2212-
config parameter innodb_LRU_scan_depth.
2213-
@return total pages flushed */
2212+
config parameter innodb_LRU_scan_depth. */
22142213
UNIV_INTERN
2215-
ulint
2214+
void
22162215
buf_flush_LRU_tail(void)
22172216
/*====================*/
22182217
{
@@ -2314,8 +2313,6 @@ buf_flush_LRU_tail(void)
23142313
MONITOR_LRU_BATCH_PAGES,
23152314
total_flushed);
23162315
}
2317-
2318-
return(total_flushed);
23192316
}
23202317

23212318
/*********************************************************************//**
@@ -2725,7 +2722,8 @@ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
27252722
}
27262723

27272724
/* Flush pages from flush_list if required */
2728-
n_flushed += page_cleaner_flush_pages_if_needed();
2725+
n_flushed = page_cleaner_flush_pages_if_needed();
2726+
27292727
} else {
27302728
n_flushed = page_cleaner_do_flush_batch(
27312729
PCT_IO(100),
@@ -2850,8 +2848,6 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
28502848
while (srv_shutdown_state == SRV_SHUTDOWN_NONE
28512849
|| srv_shutdown_state == SRV_SHUTDOWN_CLEANUP) {
28522850

2853-
ulint n_flushed_lru;
2854-
28552851
srv_current_thread_priority = srv_cleaner_thread_priority;
28562852

28572853
page_cleaner_sleep_if_needed(next_loop_time);
@@ -2860,16 +2856,7 @@ DECLARE_THREAD(buf_flush_lru_manager_thread)(
28602856

28612857
next_loop_time = ut_time_ms() + lru_sleep_time;
28622858

2863-
n_flushed_lru = buf_flush_LRU_tail();
2864-
2865-
if (n_flushed_lru) {
2866-
2867-
MONITOR_INC_VALUE_CUMULATIVE(
2868-
MONITOR_FLUSH_BACKGROUND_TOTAL_PAGE,
2869-
MONITOR_FLUSH_BACKGROUND_COUNT,
2870-
MONITOR_FLUSH_BACKGROUND_PAGES,
2871-
n_flushed_lru);
2872-
}
2859+
buf_flush_LRU_tail();
28732860
}
28742861

28752862
buf_lru_manager_is_active = false;

storage/xtradb/dict/dict0dict.cc

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,71 +3237,6 @@ dict_table_is_referenced_by_foreign_key(
32373237
return(!table->referenced_set.empty());
32383238
}
32393239

3240-
/*********************************************************************//**
3241-
Check if the index is referenced by a foreign key, if TRUE return foreign
3242-
else return NULL
3243-
@return pointer to foreign key struct if index is defined for foreign
3244-
key, otherwise NULL */
3245-
UNIV_INTERN
3246-
dict_foreign_t*
3247-
dict_table_get_referenced_constraint(
3248-
/*=================================*/
3249-
dict_table_t* table, /*!< in: InnoDB table */
3250-
dict_index_t* index) /*!< in: InnoDB index */
3251-
{
3252-
dict_foreign_t* foreign;
3253-
3254-
ut_ad(index != NULL);
3255-
ut_ad(table != NULL);
3256-
3257-
for (dict_foreign_set::iterator it = table->referenced_set.begin();
3258-
it != table->referenced_set.end();
3259-
++it) {
3260-
3261-
foreign = *it;
3262-
3263-
if (foreign->referenced_index == index) {
3264-
3265-
return(foreign);
3266-
}
3267-
}
3268-
3269-
return(NULL);
3270-
}
3271-
3272-
/*********************************************************************//**
3273-
Checks if a index is defined for a foreign key constraint. Index is a part
3274-
of a foreign key constraint if the index is referenced by foreign key
3275-
or index is a foreign key index.
3276-
@return pointer to foreign key struct if index is defined for foreign
3277-
key, otherwise NULL */
3278-
UNIV_INTERN
3279-
dict_foreign_t*
3280-
dict_table_get_foreign_constraint(
3281-
/*==============================*/
3282-
dict_table_t* table, /*!< in: InnoDB table */
3283-
dict_index_t* index) /*!< in: InnoDB index */
3284-
{
3285-
dict_foreign_t* foreign;
3286-
3287-
ut_ad(index != NULL);
3288-
ut_ad(table != NULL);
3289-
3290-
for (dict_foreign_set::iterator it = table->foreign_set.begin();
3291-
it != table->foreign_set.end();
3292-
++it) {
3293-
3294-
foreign = *it;
3295-
3296-
if (foreign->foreign_index == index) {
3297-
3298-
return(foreign);
3299-
}
3300-
}
3301-
3302-
return(NULL);
3303-
}
3304-
33053240
/**********************************************************************//**
33063241
Removes a foreign constraint struct from the dictionary cache. */
33073242
UNIV_INTERN

storage/xtradb/dict/dict0stats_bg.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,14 @@ DECLARE_THREAD(dict_stats_thread)(
352352
break;
353353
}
354354

355+
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
356+
if (srv_ibuf_disable_background_merge) {
357+
usleep(100000);
358+
os_event_reset(dict_stats_event);
359+
continue;
360+
}
361+
#endif
362+
355363
dict_stats_process_entry_from_recalc_pool();
356364

357365
os_event_reset(dict_stats_event);

storage/xtradb/fil/fil0fil.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*****************************************************************************
22
3-
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
3+
Copyright (c) 1995, 2015, 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
@@ -5630,9 +5630,10 @@ _fil_io(
56305630

56315631
space = fil_space_get_by_id(space_id);
56325632

5633-
/* If we are deleting a tablespace we don't allow any read
5634-
operations on that. However, we do allow write operations. */
5635-
if (space == 0 || (type == OS_FILE_READ && space->stop_new_ops)) {
5633+
/* If we are deleting a tablespace we don't allow async read operations
5634+
on that. However, we do allow write and sync read operations */
5635+
if (space == 0
5636+
|| (type == OS_FILE_READ && !sync && space->stop_new_ops)) {
56365637
mutex_exit(&fil_system->mutex);
56375638

56385639
ib_logf(IB_LOG_LEVEL_ERROR,

storage/xtradb/handler/ha_innodb.cc

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,15 @@ innobase_end(
11341134
handlerton* hton, /* in: Innodb handlerton */
11351135
ha_panic_function type);
11361136

1137+
/*****************************************************************//**
1138+
Stores the current binlog coordinates in the trx system header. */
1139+
static
1140+
int
1141+
innobase_store_binlog_info(
1142+
/*=======================*/
1143+
handlerton* hton, /*!< in: InnoDB handlerton */
1144+
THD* thd); /*!< in: MySQL thread handle */
1145+
11371146
/*****************************************************************//**
11381147
Creates an InnoDB transaction struct for the thd if it does not yet have one.
11391148
Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -3197,6 +3206,9 @@ innobase_init(
31973206
innobase_hton->clone_consistent_snapshot =
31983207
innobase_start_trx_and_clone_read_view;
31993208

3209+
innobase_hton->store_binlog_info =
3210+
innobase_store_binlog_info;
3211+
32003212
innobase_hton->flush_logs = innobase_flush_logs;
32013213
innobase_hton->show_status = innobase_show_status;
32023214
innobase_hton->flags = HTON_SUPPORTS_EXTENDED_KEYS |
@@ -3897,6 +3909,35 @@ innobase_commit_low(
38973909
}
38983910
}
38993911

3912+
/*****************************************************************//**
3913+
Stores the current binlog coordinates in the trx system header. */
3914+
static
3915+
int
3916+
innobase_store_binlog_info(
3917+
/*=======================*/
3918+
handlerton* hton, /*!< in: InnoDB handlerton */
3919+
THD* thd) /*!< in: MySQL thread handle */
3920+
{
3921+
const char* file_name;
3922+
unsigned long long pos;
3923+
mtr_t mtr;
3924+
3925+
DBUG_ENTER("innobase_store_binlog_info");
3926+
3927+
thd_binlog_pos(thd, &file_name, &pos);
3928+
3929+
mtr_start(&mtr);
3930+
3931+
trx_sys_update_mysql_binlog_offset(file_name, pos,
3932+
TRX_SYS_MYSQL_LOG_INFO, &mtr);
3933+
3934+
mtr_commit(&mtr);
3935+
3936+
innobase_flush_logs(hton);
3937+
3938+
DBUG_RETURN(0);
3939+
}
3940+
39003941
/*****************************************************************//**
39013942
Creates an InnoDB transaction struct for the thd if it does not yet have one.
39023943
Starts a new InnoDB transaction if a transaction is not yet started. And
@@ -9240,7 +9281,8 @@ create_table_def(
92409281

92419282
/* MySQL does the name length check. But we do additional check
92429283
on the name length here */
9243-
if (strlen(table_name) > MAX_FULL_NAME_LEN) {
9284+
const size_t table_name_len = strlen(table_name);
9285+
if (table_name_len > MAX_FULL_NAME_LEN) {
92449286
push_warning_printf(
92459287
thd, Sql_condition::WARN_LEVEL_WARN,
92469288
ER_TABLE_NAME,
@@ -9249,6 +9291,15 @@ create_table_def(
92499291
DBUG_RETURN(ER_TABLE_NAME);
92509292
}
92519293

9294+
if (table_name[table_name_len - 1] == '/') {
9295+
push_warning_printf(
9296+
thd, Sql_condition::WARN_LEVEL_WARN,
9297+
ER_TABLE_NAME,
9298+
"InnoDB: Table name is empty");
9299+
9300+
DBUG_RETURN(ER_WRONG_TABLE_NAME);
9301+
}
9302+
92529303
n_cols = form->s->fields;
92539304

92549305
/* Check whether there already exists a FTS_DOC_ID column */
@@ -10566,6 +10617,10 @@ ha_innobase::discard_or_import_tablespace(
1056610617
DBUG_RETURN(HA_ERR_TABLE_READONLY);
1056710618
}
1056810619

10620+
if (UNIV_UNLIKELY(prebuilt->trx->fake_changes)) {
10621+
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
10622+
}
10623+
1056910624
dict_table = prebuilt->table;
1057010625

1057110626
if (dict_table->space == TRX_SYS_SPACE) {
@@ -12239,8 +12294,8 @@ ha_innobase::check(
1223912294
thd_set_kill_status(user_thd);
1224012295
}
1224112296

12242-
if (UNIV_UNLIKELY(share->ib_table->is_corrupt)) {
12243-
return(HA_ADMIN_CORRUPT);
12297+
if (UNIV_UNLIKELY(prebuilt->table && prebuilt->table->corrupted)) {
12298+
DBUG_RETURN(HA_ADMIN_CORRUPT);
1224412299
}
1224512300

1224612301
DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
@@ -14720,6 +14775,9 @@ innodb_log_archive_update(
1472014775
void* var_ptr,
1472114776
const void* save)
1472214777
{
14778+
if (srv_read_only_mode)
14779+
return;
14780+
1472314781
my_bool in_val = *static_cast<const my_bool*>(save);
1472414782

1472514783
if (in_val) {

0 commit comments

Comments
 (0)