Merge for Matt for Innodb bug.

client/mysqldump.c:
  Auto merged
innobase/include/row0mysql.h:
  Auto merged
innobase/lock/lock0lock.c:
  Auto merged
innobase/row/row0mysql.c:
  Auto merged
innobase/row/row0sel.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/ndb_index_unique.result:
  Auto merged
mysql-test/r/rpl_start_stop_slave.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/ndb_grant.later:
  Auto merged
mysql-test/t/ndb_index_unique.test:
  Auto merged
ndb/include/ndbapi/NdbScanOperation.hpp:
  Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
  Auto merged
ndb/test/ndbapi/testScanPerf.cpp:
  Auto merged
netware/comp_err.def:
  Auto merged
netware/isamchk.def:
  Auto merged
netware/isamlog.def:
  Auto merged
netware/libmysql.def:
  Auto merged
netware/my_print_defaults.def:
  Auto merged
netware/myisam_ftdump.def:
  Auto merged
netware/myisamchk.def:
  Auto merged
netware/myisamlog.def:
  Auto merged
netware/myisampack.def:
  Auto merged
netware/mysql.def:
  Auto merged
netware/mysql_install.def:
  Auto merged
netware/mysql_install_db.def:
  Auto merged
netware/mysql_test_run.def:
  Auto merged
netware/mysql_waitpid.def:
  Auto merged
netware/mysqladmin.def:
  Auto merged
netware/mysqlbinlog.def:
  Auto merged
netware/mysqlcheck.def:
  Auto merged
netware/mysqld.def:
  Auto merged
netware/mysqld_safe.def:
  Auto merged
netware/mysqldump.def:
  Auto merged
netware/mysqlimport.def:
  Auto merged
netware/mysqlshow.def:
  Auto merged
netware/mysqltest.def:
  Auto merged
netware/pack_isam.def:
  Auto merged
netware/perror.def:
  Auto merged
netware/replace.def:
  Auto merged
netware/resolve_stack_dump.def:
  Auto merged
netware/resolveip.def:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
client/mysqladmin.cc:
  Merge for Netware changes. Indention fixes.
sql/field.cc:
  Merge fixes, warnings added from 4.1 to 5.0
sql/mysqld.cc:
  Merge fixes, just indention fixes.
This commit is contained in:
unknown 2004-11-30 10:10:40 -08:00
commit 9ada34b316
41 changed files with 849 additions and 744 deletions

View file

@ -2408,20 +2408,58 @@ ha_innobase::write_row(
position in the source table need not be adjusted after the
intermediate COMMIT, since writes by other transactions are
being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */
ut_a(prebuilt->trx->mysql_n_tables_locked == 2);
ut_a(UT_LIST_GET_LEN(prebuilt->trx->trx_locks) >= 2);
dict_table_t* table = lock_get_ix_table(
UT_LIST_GET_FIRST(prebuilt->trx->trx_locks));
dict_table_t* src_table;
ibool mode;
num_write_row = 0;
/* Commit the transaction. This will release the table
locks, so they have to be acquired again. */
innobase_commit(user_thd, prebuilt->trx);
/* Note that this transaction is still active. */
user_thd->transaction.all.innodb_active_trans = 1;
/* Re-acquire the IX table lock on the source table. */
row_lock_table_for_mysql(prebuilt, table);
/* We will need an IX lock on the destination table. */
prebuilt->sql_stat_start = TRUE;
/* Altering an InnoDB table */
/* Get the source table. */
src_table = lock_get_src_table(
prebuilt->trx, prebuilt->table, &mode);
if (!src_table) {
no_commit:
/* Unknown situation: do not commit */
/*
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB error: ALTER TABLE is holding lock"
" on %lu tables!\n",
prebuilt->trx->mysql_n_tables_locked);
*/
;
} else if (src_table == prebuilt->table) {
/* Source table is not in InnoDB format:
no need to re-acquire locks on it. */
/* Altering to InnoDB format */
innobase_commit(user_thd, prebuilt->trx);
/* Note that this transaction is still active. */
user_thd->transaction.all.innodb_active_trans = 1;
/* We will need an IX lock on the destination table. */
prebuilt->sql_stat_start = TRUE;
} else {
/* Ensure that there are no other table locks than
LOCK_IX and LOCK_AUTO_INC on the destination table. */
if (!lock_is_table_exclusive(prebuilt->table,
prebuilt->trx)) {
goto no_commit;
}
/* Commit the transaction. This will release the table
locks, so they have to be acquired again. */
innobase_commit(user_thd, prebuilt->trx);
/* Note that this transaction is still active. */
user_thd->transaction.all.innodb_active_trans = 1;
/* Re-acquire the table lock on the source table. */
row_lock_table_for_mysql(prebuilt, src_table, mode);
/* We will need an IX lock on the destination table. */
prebuilt->sql_stat_start = TRUE;
}
}
num_write_row++;
@ -5145,7 +5183,8 @@ ha_innobase::external_lock(
if (thd->in_lock_tables &&
thd->variables.innodb_table_locks) {
ulint error;
error = row_lock_table_for_mysql(prebuilt, 0);
error = row_lock_table_for_mysql(prebuilt,
NULL, LOCK_TABLE_EXP);
if (error != DB_SUCCESS) {
error = convert_error_code_to_mysql(