Skip to content

Commit

Permalink
5.6.26
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Aug 3, 2015
1 parent 139ba26 commit 5654412
Show file tree
Hide file tree
Showing 15 changed files with 271 additions and 248 deletions.
12 changes: 8 additions & 4 deletions storage/innobase/api/api0api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ ib_open_table_by_id(
dict_mutex_enter_for_mysql();
}

table = dict_table_open_on_id(table_id, FALSE, DICT_TABLE_OP_NORMAL);
table = dict_table_open_on_id(table_id, TRUE, DICT_TABLE_OP_NORMAL);

if (table != NULL && table->ibd_file_missing) {
table = NULL;
Expand Down Expand Up @@ -2104,6 +2104,10 @@ ib_cursor_moveto(

n_fields = dict_index_get_n_ordering_defined_by_user(prebuilt->index);

if (n_fields > dtuple_get_n_fields(tuple->ptr)) {
n_fields = dtuple_get_n_fields(tuple->ptr);
}

dtuple_set_n_fields(search_tuple, n_fields);
dtuple_set_n_fields_cmp(search_tuple, n_fields);

Expand Down Expand Up @@ -3741,14 +3745,14 @@ ib_table_truncate(
if (trunc_err == DB_SUCCESS) {
ut_a(ib_trx_state(ib_trx) == static_cast<ib_trx_state_t>(
TRX_STATE_NOT_STARTED));

err = ib_trx_release(ib_trx);
ut_a(err == DB_SUCCESS);
} else {
err = ib_trx_rollback(ib_trx);
ut_a(err == DB_SUCCESS);
}

err = ib_trx_release(ib_trx);
ut_a(err == DB_SUCCESS);

/* Set the memcached_sync_count back. */
if (table != NULL && memcached_sync != 0) {
dict_mutex_enter_for_mysql();
Expand Down
6 changes: 3 additions & 3 deletions storage/innobase/buf/buf0flu.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2015, 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
Expand Down Expand Up @@ -929,11 +929,11 @@ buf_flush_write_block_low(
break;
case BUF_BLOCK_ZIP_DIRTY:
frame = bpage->zip.data;
mach_write_to_8(frame + FIL_PAGE_LSN,
bpage->newest_modification);

ut_a(page_zip_verify_checksum(frame, zip_size));

mach_write_to_8(frame + FIL_PAGE_LSN,
bpage->newest_modification);
memset(frame + FIL_PAGE_FILE_FLUSH_LSN, 0, 8);
break;
case BUF_BLOCK_FILE_PAGE:
Expand Down
65 changes: 0 additions & 65 deletions storage/innobase/dict/dict0dict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3233,71 +3233,6 @@ dict_table_is_referenced_by_foreign_key(
return(!table->referenced_set.empty());
}

/*********************************************************************//**
Check if the index is referenced by a foreign key, if TRUE return foreign
else return NULL
@return pointer to foreign key struct if index is defined for foreign
key, otherwise NULL */
UNIV_INTERN
dict_foreign_t*
dict_table_get_referenced_constraint(
/*=================================*/
dict_table_t* table, /*!< in: InnoDB table */
dict_index_t* index) /*!< in: InnoDB index */
{
dict_foreign_t* foreign;

ut_ad(index != NULL);
ut_ad(table != NULL);

for (dict_foreign_set::iterator it = table->referenced_set.begin();
it != table->referenced_set.end();
++it) {

foreign = *it;

if (foreign->referenced_index == index) {

return(foreign);
}
}

return(NULL);
}

/*********************************************************************//**
Checks if a index is defined for a foreign key constraint. Index is a part
of a foreign key constraint if the index is referenced by foreign key
or index is a foreign key index.
@return pointer to foreign key struct if index is defined for foreign
key, otherwise NULL */
UNIV_INTERN
dict_foreign_t*
dict_table_get_foreign_constraint(
/*==============================*/
dict_table_t* table, /*!< in: InnoDB table */
dict_index_t* index) /*!< in: InnoDB index */
{
dict_foreign_t* foreign;

ut_ad(index != NULL);
ut_ad(table != NULL);

for (dict_foreign_set::iterator it = table->foreign_set.begin();
it != table->foreign_set.end();
++it) {

foreign = *it;

if (foreign->foreign_index == index) {

return(foreign);
}
}

return(NULL);
}

/**********************************************************************//**
Removes a foreign constraint struct from the dictionary cache. */
UNIV_INTERN
Expand Down
9 changes: 5 additions & 4 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1995, 2015, 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
Expand Down Expand Up @@ -5575,9 +5575,10 @@ fil_io(

space = fil_space_get_by_id(space_id);

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

ib_logf(IB_LOG_LEVEL_ERROR,
Expand Down
12 changes: 11 additions & 1 deletion storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8506,7 +8506,8 @@ create_table_def(

/* MySQL does the name length check. But we do additional check
on the name length here */
if (strlen(table_name) > MAX_FULL_NAME_LEN) {
const size_t table_name_len = strlen(table_name);
if (table_name_len > MAX_FULL_NAME_LEN) {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
Expand All @@ -8515,6 +8516,15 @@ create_table_def(
DBUG_RETURN(ER_TABLE_NAME);
}

if (table_name[table_name_len - 1] == '/') {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
"InnoDB: Table name is empty");

DBUG_RETURN(ER_WRONG_TABLE_NAME);
}

n_cols = form->s->fields;

/* Check whether there already exists a FTS_DOC_ID column */
Expand Down
Loading

0 comments on commit 5654412

Please sign in to comment.