Commit 2b380909 authored by Sergey Vojtovich's avatar Sergey Vojtovich

Applying InnoDB snapshot

Detailed revision comments:

r6792 | marko | 2010-03-10 13:56:41 +0200 (Wed, 10 Mar 2010) | 1 line
branches/zip: Copy tests from branches/5.1 that were lost in some merge.
r6793 | marko | 2010-03-10 14:02:19 +0200 (Wed, 10 Mar 2010) | 60 lines
branches/zip: Merge revisions 6669:6788 from branches/5.1:

  ------------------------------------------------------------------------
  r6774 | calvin | 2010-03-03 23:56:10 +0200 (Wed, 03 Mar 2010) | 2 lines
  Changed paths:
     M /branches/5.1/trx/trx0sys.c

  branches/5.1: fix bug#51653: outdated reference to set-variable
  Non functional change.
  ------------------------------------------------------------------------
  r6780 | vasil | 2010-03-08 19:13:20 +0200 (Mon, 08 Mar 2010) | 4 lines
  Changed paths:
     M /branches/5.1/plug.in

  branches/5.1:

  Whitespace fixup.
  ------------------------------------------------------------------------
  r6783 | jyang | 2010-03-09 17:54:14 +0200 (Tue, 09 Mar 2010) | 9 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/mysql-test/innodb_bug21704.result
     A /branches/5.1/mysql-test/innodb_bug47621.result
     A /branches/5.1/mysql-test/innodb_bug47621.test

  branches/5.1: Fix bug #47621 "MySQL and InnoDB data dictionaries
  will become out of sync when renaming columns". MySQL does not
  provide new column name information to storage engine to
  update the system table. To avoid column name mismatch, we shall
  just request a table copy for now.

  rb://246 approved by Marko.
  ------------------------------------------------------------------------
  r6785 | vasil | 2010-03-10 09:04:38 +0200 (Wed, 10 Mar 2010) | 11 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb_bug38231.test

  branches/5.1:

  Add the missing --reap statements in innodb_bug38231.test. Probably MySQL
  enforced the presence of those recently and the test started failing like:

    main.innodb_bug38231                     [ fail ]
            Test ended at 2010-03-10 08:48:32

    CURRENT_TEST: main.innodb_bug38231
    mysqltest: At line 49: Cannot run query on connection between send and reap
  ------------------------------------------------------------------------
  r6788 | vasil | 2010-03-10 10:53:21 +0200 (Wed, 10 Mar 2010) | 8 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb_bug38231.test

  branches/5.1:

  In innodb_bug38231.test: replace the fragile sleep 0.2 that depends on timing
  with a more robust condition which waits for the TRUNCATE and LOCK commands
  to appear in information_schema.processlist. This could also break if there
  are other sessions executing the same SQL commands, but there are none during
  the execution of the mysql test.
  ------------------------------------------------------------------------
parent 96322594
2010-03-10 The InnoDB Team
* trx/trx0sys.c:
Fix Bug #51653 outdated reference to set-variable
2010-03-10 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb_bug21704.result,
mysql-test/innodb_bug47621.result, mysql-test/innodb_bug47621.test:
Fix Bug #47621 MySQL and InnoDB data dictionaries will become
out of sync when renaming columns
2010-03-10 The InnoDB Team
* handler/ha_innodb.cc:
......
......@@ -9833,33 +9833,60 @@ innobase_set_cursor_view(
(cursor_view_t*) curview);
}
/*******************************************************************//**
If col_name is not NULL, check whether the named column is being
renamed in the table. If col_name is not provided, check
whether any one of columns in the table is being renamed.
@return true if the column is being renamed */
static
bool
check_column_being_renamed(
/*=======================*/
const TABLE* table, /*!< in: MySQL table */
const char* col_name) /*!< in: name of the column */
{
uint k;
Field* field;
/***********************************************************************
Check whether any of the given columns is being renamed in the table. */
for (k = 0; k < table->s->fields; k++) {
field = table->field[k];
if (field->flags & FIELD_IS_RENAMED) {
/* If col_name is not provided, return
if the field is marked as being renamed. */
if (!col_name) {
return(true);
}
/* If col_name is provided, return only
if names match */
if (innobase_strcasecmp(field->field_name,
col_name) == 0) {
return(true);
}
}
}
return(false);
}
/*******************************************************************//**
Check whether any of the given columns is being renamed in the table.
@return true if any of col_names is being renamed in table */
static
bool
column_is_being_renamed(
/*====================*/
/* out: true if any of col_names is
being renamed in table */
TABLE* table, /* in: MySQL table */
uint n_cols, /* in: number of columns */
const char** col_names) /* in: names of the columns */
TABLE* table, /*!< in: MySQL table */
uint n_cols, /*!< in: number of columns */
const char** col_names) /*!< in: names of the columns */
{
uint j;
uint k;
Field* field;
const char* col_name;
for (j = 0; j < n_cols; j++) {
col_name = col_names[j];
for (k = 0; k < table->s->fields; k++) {
field = table->field[k];
if ((field->flags & FIELD_IS_RENAMED)
&& innobase_strcasecmp(field->field_name,
col_name) == 0) {
return(true);
}
if (check_column_being_renamed(table, col_names[j])) {
return(true);
}
}
......@@ -9943,6 +9970,15 @@ ha_innobase::check_if_incompatible_data(
return(COMPATIBLE_DATA_NO);
}
/* For column rename operation, MySQL does not supply enough
information (new column name etc.) for InnoDB to make appropriate
system metadata change. To avoid system metadata inconsistency,
currently we can just request a table rebuild/copy by returning
COMPATIBLE_DATA_NO */
if (check_column_being_renamed(table, NULL)) {
return COMPATIBLE_DATA_NO;
}
/* Check if a column participating in a foreign key is being renamed.
There is no mechanism for updating InnoDB foreign key definitions. */
if (foreign_key_column_is_being_renamed(prebuilt, table)) {
......
......@@ -584,8 +584,8 @@ trx_sys_doublewrite_init_or_restore_pages(
" recover the database"
" with the my.cnf\n"
"InnoDB: option:\n"
"InnoDB: set-variable="
"innodb_force_recovery=6\n");
"InnoDB:"
" innodb_force_recovery=6\n");
exit(1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment