mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 3.23.51
Fixed wrong usage of sprintf() in ha_innodb.cc BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-global.h~e80d28157acfdcb5: Auto merged Docs/manual.ja.texi: Auto merged include/config-os2.h: Auto merged innobase/btr/btr0btr.c: Auto merged innobase/btr/btr0cur.c: Auto merged innobase/btr/btr0sea.c: Auto merged innobase/buf/buf0buf.c: Auto merged innobase/data/data0data.c: Auto merged innobase/dict/dict0crea.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/fsp/fsp0fsp.c: Auto merged innobase/ibuf/ibuf0ibuf.c: Auto merged innobase/include/buf0buf.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/log/log0log.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/os/os0file.c: Auto merged innobase/page/page0cur.c: Auto merged innobase/page/page0page.c: Auto merged innobase/rem/rem0cmp.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0purge.c: Auto merged innobase/row/row0umod.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/sync/sync0arr.c: Auto merged innobase/sync/sync0sync.c: Auto merged innobase/trx/trx0roll.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/trx/trx0undo.c: Auto merged innobase/ut/ut0ut.c: Auto merged isam/pack_isam.c: Auto merged mysys/Makefile.am: Auto merged sql/ha_innodb.h: Auto merged sql/key.cc: Auto merged sql/mini_client.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged support-files/my-huge.cnf.sh: Auto merged support-files/my-large.cnf.sh: Auto merged support-files/my-medium.cnf.sh: Auto merged support-files/my-small.cnf.sh: Auto merged Docs/manual.texi: Merge with 3.23.51 configure.in: Merge with 3.23.51 include/Makefile.am: Merge with 3.23.51 innobase/dict/dict0load.c: Merge with 3.23.51 innobase/include/univ.i: Merge with 3.23.51 innobase/row/row0mysql.c: Merge with 3.23.51 innobase/srv/srv0srv.c: Merge with 3.23.51 innobase/srv/srv0start.c: Merge with 3.23.51 myisam/mi_cache.c: Merge with 3.23.51 myisammrg/myrg_rnext.c: Merge with 3.23.51 myisammrg/myrg_rprev.c: Merge with 3.23.51 sql/ha_innodb.cc: Merge with 3.23.51 Changed used of sprintf() to make code portable. sql/handler.cc: Indentation change sql/lex.h: Comment cleanup sql/log.cc: Merge with 3.23.51 sql/log_event.h: Merge with 3.23.51 sql/mysql_priv.h: Merge with 3.23.51 sql/mysqld.cc: Merge with 3.23.51 Cleaned up handling of innodb_flush_log_at_trx_commit sql/share/portuguese/errmsg.txt: Merge with 3.23.51 sql/slave.cc: Not merged as this affects many files; Will be fixed in next changeset sql/slave.h: Merge with 3.23.51 sql/sql_acl.cc: Merge with 3.23.51 (no changes) sql/sql_db.cc: Merge with 3.23.51 sql/sql_parse.cc: Merge with 3.23.51 sql/sql_yacc.yy: Merge with 3.23.51 (Renamed NO_FOREIGN_KEY_CHECKS and RELAXED_UNIQUE_CHECKS) support-files/mysql.spec.sh: Merge with 3.23.51
This commit is contained in:
@ -934,6 +934,7 @@ row_update_for_mysql(
|
||||
ut_ad(!prebuilt->sql_stat_start);
|
||||
|
||||
que_thr_move_to_run_state_for_mysql(thr, trx);
|
||||
|
||||
run_again:
|
||||
thr->run_node = node;
|
||||
thr->prev_node = node;
|
||||
@ -998,7 +999,6 @@ row_update_cascade_for_mysql(
|
||||
trx_t* trx;
|
||||
|
||||
trx = thr_get_trx(thr);
|
||||
|
||||
run_again:
|
||||
thr->run_node = node;
|
||||
thr->prev_node = node;
|
||||
@ -1130,6 +1130,35 @@ row_mysql_recover_tmp_table(
|
||||
return(row_rename_table_for_mysql(old_name, table->name, trx));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Locks the data dictionary exclusively for performing a table create
|
||||
operation. */
|
||||
|
||||
void
|
||||
row_mysql_lock_data_dictionary(void)
|
||||
/*================================*/
|
||||
{
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks or lock waits can occur then in these operations */
|
||||
|
||||
rw_lock_x_lock(&(dict_foreign_key_check_lock));
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Unlocks the data dictionary exclusively lock. */
|
||||
|
||||
void
|
||||
row_mysql_unlock_data_dictionary(void)
|
||||
/*==================================*/
|
||||
{
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks can occur then in these operations */
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Does a table creation operation for MySQL. If the name of the created
|
||||
table ends to characters INNODB_MONITOR, then this also starts
|
||||
@ -1150,6 +1179,7 @@ row_create_table_for_mysql(
|
||||
ulint err;
|
||||
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
if (srv_created_new_raw || srv_force_recovery) {
|
||||
fprintf(stderr,
|
||||
@ -1265,19 +1295,13 @@ row_create_table_for_mysql(
|
||||
"to use this feature you must compile InnoDB with\n"
|
||||
"UNIV_MEM_DEBUG defined in univ.i and the server must be\n"
|
||||
"quiet because allocation from a mem heap is not protected\n"
|
||||
"by any semaphore.\n");
|
||||
"by any semaphore.\n");
|
||||
|
||||
ut_a(mem_validate());
|
||||
|
||||
printf("Memory validated\n");
|
||||
}
|
||||
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks can occur then in these operations */
|
||||
|
||||
rw_lock_x_lock(&(dict_foreign_key_check_lock));
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
heap = mem_heap_create(512);
|
||||
|
||||
trx->dict_operation = TRUE;
|
||||
@ -1327,9 +1351,6 @@ row_create_table_for_mysql(
|
||||
trx->error_state = DB_SUCCESS;
|
||||
}
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
|
||||
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
trx->op_info = (char *) "";
|
||||
@ -1356,6 +1377,7 @@ row_create_index_for_mysql(
|
||||
ulint keywordlen;
|
||||
ulint err;
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
|
||||
trx->op_info = (char *) "creating index";
|
||||
@ -1374,12 +1396,6 @@ row_create_index_for_mysql(
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks can occur then in these operations */
|
||||
|
||||
rw_lock_x_lock(&(dict_foreign_key_check_lock));
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
heap = mem_heap_create(512);
|
||||
|
||||
trx->dict_operation = TRUE;
|
||||
@ -1407,9 +1423,6 @@ row_create_index_for_mysql(
|
||||
trx->error_state = DB_SUCCESS;
|
||||
}
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
|
||||
|
||||
que_graph_free((que_t*) que_node_get_parent(thr));
|
||||
|
||||
trx->op_info = (char *) "";
|
||||
@ -1443,6 +1456,7 @@ row_table_add_foreign_constraints(
|
||||
ulint keywordlen;
|
||||
ulint err;
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
ut_a(sql_string);
|
||||
|
||||
trx->op_info = (char *) "adding foreign keys";
|
||||
@ -1461,12 +1475,6 @@ row_table_add_foreign_constraints(
|
||||
return(DB_SUCCESS);
|
||||
}
|
||||
|
||||
/* Serialize data dictionary operations with dictionary mutex:
|
||||
no deadlocks can occur then in these operations */
|
||||
|
||||
rw_lock_x_lock(&(dict_foreign_key_check_lock));
|
||||
mutex_enter(&(dict_sys->mutex));
|
||||
|
||||
trx->dict_operation = TRUE;
|
||||
|
||||
err = dict_create_foreign_constraints(trx, sql_string, name);
|
||||
@ -1488,9 +1496,6 @@ row_table_add_foreign_constraints(
|
||||
trx->error_state = DB_SUCCESS;
|
||||
}
|
||||
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
|
||||
|
||||
return((int) err);
|
||||
}
|
||||
|
||||
@ -1922,6 +1927,13 @@ row_drop_table_for_mysql(
|
||||
ut_a(0);
|
||||
} else {
|
||||
dict_table_remove_from_cache(table);
|
||||
|
||||
if (dict_load_table(name) != NULL) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
" InnoDB: Error: dropping of table %s failed!\n", name);
|
||||
|
||||
}
|
||||
}
|
||||
funct_exit:
|
||||
rw_lock_s_unlock(&(purge_sys->purge_is_running));
|
||||
@ -1979,6 +1991,7 @@ loop:
|
||||
|
||||
if (table->n_mysql_handles_opened > 0) {
|
||||
mutex_exit(&(dict_sys->mutex));
|
||||
rw_lock_x_unlock(&(dict_foreign_key_check_lock));
|
||||
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
@ -2409,6 +2422,14 @@ row_check_table_for_mysql(
|
||||
index = dict_table_get_next_index(index);
|
||||
}
|
||||
|
||||
/* We validate also the whole adaptive hash index for all tables
|
||||
at every CHECK TABLE */
|
||||
|
||||
if (!btr_search_validate()) {
|
||||
|
||||
ret = DB_ERROR;
|
||||
}
|
||||
|
||||
prebuilt->trx->op_info = (char *) "";
|
||||
|
||||
return(ret);
|
||||
|
Reference in New Issue
Block a user