Merge mysql-trunk-bugfixing -> mysql-trunk-innodb

(resolving conflicts in mysql-test/suite/rpl/t/rpl_sync-slave.opt and
configure.cmake)
This commit is contained in:
Vasil Dimov 2010-07-21 17:22:29 +03:00
commit 5ba3936517
883 changed files with 23625 additions and 16328 deletions

View file

@ -101,7 +101,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
#include <pthread.h>
#include <string.h>
int main(int argc, char** argv) {
int main() {
pthread_t x1;
pthread_t x2;
pthread_t x3;
@ -274,6 +274,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137")
ELSE()
# New plugin support, cross-platform , base name for shared module is "ha_innodb"
MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
DEFAULT
MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY})
ENDIF()

View file

@ -323,14 +323,14 @@ libinnobase_a_SOURCES= \
ut/ut0vec.c \
ut/ut0wqueue.c
libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
libinnobase_a_CXXFLAGS= $(AM_CXXFLAGS)
libinnobase_a_CFLAGS= $(AM_CFLAGS)
EXTRA_LTLIBRARIES= ha_innodb.la
pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir)
ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_CXXFLAGS= $(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_CFLAGS= $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_la_SOURCES= $(libinnobase_a_SOURCES)

View file

@ -240,17 +240,29 @@ dict_build_table_def_step(
ibool is_path;
mtr_t mtr;
ulint space = 0;
ibool file_per_table;
ut_ad(mutex_own(&(dict_sys->mutex)));
table = node->table;
dict_hdr_get_new_id(&table->id, NULL,
srv_file_per_table ? &space : NULL);
/* Cache the global variable "srv_file_per_table" to
a local variable before using it. Please note
"srv_file_per_table" is not under dict_sys mutex
protection, and could be changed while executing
this function. So better to cache the current value
to a local variable, and all future reference to
"srv_file_per_table" should use this local variable. */
file_per_table = srv_file_per_table;
dict_hdr_get_new_id(&table->id, NULL, NULL);
thr_get_trx(thr)->table_id = table->id;
if (srv_file_per_table) {
if (file_per_table) {
/* Get a new space id if srv_file_per_table is set */
dict_hdr_get_new_id(NULL, NULL, &space);
if (UNIV_UNLIKELY(space == ULINT_UNDEFINED)) {
return(DB_ERROR);
}

View file

@ -187,10 +187,6 @@ static ulong innobase_active_counter = 0;
static hash_table_t* innobase_open_tables;
#ifdef __NETWARE__ /* some special cleanup for NetWare */
bool nw_panic = FALSE;
#endif
/** Allowed values of innodb_change_buffering */
static const char* innobase_change_buffering_values[IBUF_USE_COUNT] = {
"none", /* IBUF_USE_NONE */
@ -429,7 +425,7 @@ static MYSQL_THDVAR_BOOL(table_locks, PLUGIN_VAR_OPCMDARG,
static MYSQL_THDVAR_BOOL(strict_mode, PLUGIN_VAR_OPCMDARG,
"Use strict mode when evaluating create options.",
NULL, NULL, FALSE);
NULL, NULL, TRUE);
static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG,
"Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
@ -2201,8 +2197,7 @@ innobase_init(
"InnoDB: syntax error in innodb_data_file_path");
mem_free_and_error:
srv_free_paths_and_sizes();
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
my_free(internal_innobase_data_file_path);
goto error;
}
@ -2473,11 +2468,6 @@ innobase_end(
DBUG_ENTER("innobase_end");
DBUG_ASSERT(hton == innodb_hton_ptr);
#ifdef __NETWARE__ /* some special cleanup for NetWare */
if (nw_panic) {
set_panic_flag_for_netware();
}
#endif
if (innodb_inited) {
srv_fast_shutdown = (ulint) innobase_fast_shutdown;
@ -2488,8 +2478,7 @@ innobase_end(
err = 1;
}
srv_free_paths_and_sizes();
my_free(internal_innobase_data_file_path,
MYF(MY_ALLOW_ZERO_PTR));
my_free(internal_innobase_data_file_path);
mysql_mutex_destroy(&innobase_share_mutex);
mysql_mutex_destroy(&prepare_commit_mutex);
mysql_mutex_destroy(&commit_threads_m);
@ -3442,7 +3431,7 @@ innobase_build_index_translation(
func_exit:
if (!ret) {
/* Build translation table failed. */
my_free(index_mapping, MYF(MY_ALLOW_ZERO_PTR));
my_free(index_mapping);
share->idx_trans_tbl.array_size = 0;
share->idx_trans_tbl.index_count = 0;
@ -3676,7 +3665,7 @@ retry:
"how you can resolve the problem.\n",
norm_name);
free_share(share);
my_free(upd_buff, MYF(0));
my_free(upd_buff);
my_errno = ENOENT;
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
@ -3692,7 +3681,7 @@ retry:
"how you can resolve the problem.\n",
norm_name);
free_share(share);
my_free(upd_buff, MYF(0));
my_free(upd_buff);
my_errno = ENOENT;
dict_table_decrement_handle_count(ib_table, FALSE);
@ -3886,7 +3875,7 @@ ha_innobase::close(void)
row_prebuilt_free(prebuilt, FALSE);
my_free(upd_buff, MYF(0));
my_free(upd_buff);
free_share(share);
/* Tell InnoDB server that there might be work for
@ -4142,6 +4131,11 @@ get_innobase_type_from_mysql_type(
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_LONG_BLOB:
return(DATA_BLOB);
case MYSQL_TYPE_NULL:
/* MySQL currently accepts "NULL" datatype, but will
reject such datatype in the next release. We will cope
with it and not trigger assertion failure in 5.1 */
break;
default:
ut_error;
}
@ -6190,7 +6184,22 @@ create_table_def(
field = form->field[i];
col_type = get_innobase_type_from_mysql_type(&unsigned_type,
field);
field);
if (!col_type) {
push_warning_printf(
(THD*) trx->mysql_thd,
MYSQL_ERROR::WARN_LEVEL_WARN,
ER_CANT_CREATE_TABLE,
"Error creating table '%s' with "
"column '%s'. Please check its "
"column type and try to re-create "
"the table with an appropriate "
"column type.",
table->name, (char*) field->field_name);
goto err_col;
}
if (field->null_ptr) {
nulls_allowed = 0;
} else {
@ -6248,7 +6257,7 @@ create_table_def(
if (dict_col_name_is_reserved(field->field_name)){
my_error(ER_WRONG_COLUMN_NAME, MYF(0),
field->field_name);
err_col:
dict_mem_table_free(table);
trx_commit_for_mysql(trx);
@ -6408,7 +6417,7 @@ create_index(
error = convert_error_code_to_mysql(error, flags, NULL);
my_free(field_lengths, MYF(0));
my_free(field_lengths);
DBUG_RETURN(error);
}
@ -7220,7 +7229,7 @@ innobase_drop_database(
trx = innobase_trx_allocate(thd);
#endif
error = row_drop_database_for_mysql(namebuf, trx);
my_free(namebuf, MYF(0));
my_free(namebuf);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
@ -7296,8 +7305,8 @@ innobase_rename_table(
log_buffer_flush_to_disk();
}
my_free(norm_to, MYF(0));
my_free(norm_from, MYF(0));
my_free(norm_to);
my_free(norm_from);
return error;
}
@ -7464,7 +7473,7 @@ ha_innobase::records_in_range(
mem_heap_free(heap);
func_exit:
my_free(key_val_buff2, MYF(0));
my_free(key_val_buff2);
prebuilt->trx->op_info = (char*)"";
@ -8473,7 +8482,7 @@ ha_innobase::free_foreign_key_create_info(
char* str) /*!< in, own: create info string to free */
{
if (str) {
my_free(str, MYF(0));
my_free(str);
}
}
@ -9017,7 +9026,7 @@ innodb_show_status(
STRING_WITH_LEN(""), str, flen)) {
result= TRUE;
}
my_free(str, MYF(0));
my_free(str);
DBUG_RETURN(FALSE);
}
@ -9288,10 +9297,9 @@ static void free_share(INNOBASE_SHARE* share)
thr_lock_delete(&share->lock);
/* Free any memory from index translation table */
my_free(share->idx_trans_tbl.index_mapping,
MYF(MY_ALLOW_ZERO_PTR));
my_free(share->idx_trans_tbl.index_mapping);
my_free(share, MYF(0));
my_free(share);
/* TODO: invoke HASH_MIGRATE if innobase_open_tables
shrinks too much */
@ -10806,25 +10814,19 @@ static MYSQL_SYSVAR_ULONG(purge_threads, srv_n_purge_threads,
static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
PLUGIN_VAR_OPCMDARG,
"Speeds up the shutdown process of the InnoDB storage engine. Possible "
"values are 0, 1 (faster)"
/*
NetWare can't close unclosed files, can't automatically kill remaining
threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
*/
IF_NETWARE("", " or 2 (fastest - crash-like)")
".",
NULL, NULL, 1, 0, IF_NETWARE(1,2), 0);
"values are 0, 1 (faster) or 2 (fastest - crash-like).",
NULL, NULL, 1, 0, 2, 0);
static MYSQL_SYSVAR_BOOL(file_per_table, srv_file_per_table,
PLUGIN_VAR_NOCMDARG,
"Stores each InnoDB table to an .ibd file in the database dir.",
NULL, NULL, FALSE);
NULL, NULL, TRUE);
static MYSQL_SYSVAR_STR(file_format, innobase_file_format_name,
PLUGIN_VAR_RQCMDARG,
"File format to use for new tables in .ibd files.",
innodb_file_format_name_validate,
innodb_file_format_name_update, "Antelope");
innodb_file_format_name_update, "Barracuda");
/* "innobase_file_format_check" decides whether we would continue
booting the server if the file format stamped on the system

View file

@ -201,12 +201,12 @@ various file I/O operations with performance schema.
used to register file creation, opening, closing and renaming.
2) register_pfs_file_io_begin() and register_pfs_file_io_end() are
used to register actual file read, write and flush */
# define register_pfs_file_open_begin(locker, key, op, name, \
# define register_pfs_file_open_begin(state, locker, key, op, name, \
src_file, src_line) \
do { \
if (PSI_server) { \
locker = PSI_server->get_thread_file_name_locker( \
key, op, name, &locker); \
state, key, op, name, &locker); \
if (locker) { \
PSI_server->start_file_open_wait( \
locker, src_file, src_line); \
@ -222,12 +222,12 @@ do { \
} \
} while (0)
# define register_pfs_file_io_begin(locker, file, count, op, \
# define register_pfs_file_io_begin(state, locker, file, count, op, \
src_file, src_line) \
do { \
if (PSI_server) { \
locker = PSI_server->get_thread_file_descriptor_locker( \
file, op); \
state, file, op); \
if (locker) { \
PSI_server->start_file_wait( \
locker, count, src_file, src_line); \
@ -391,8 +391,6 @@ os_io_init_simple(void);
/***********************************************************************//**
Creates a temporary file. This function is like tmpfile(3), but
the temporary file is created in the MySQL temporary directory.
On Netware, this function is like tmpfile(3), because the C run-time
library of Netware does not expose the delete-on-close flag.
@return temporary file handle, or NULL on error */
FILE*
@ -1174,7 +1172,7 @@ os_file_get_status(
os_file_stat_t* stat_info); /*!< information of a file in a
directory */
#if !defined(UNIV_HOTBACKUP) && !defined(__NETWARE__)
#if !defined(UNIV_HOTBACKUP)
/*********************************************************************//**
Creates a temporary file that will be deleted on close.
This function is defined in ha_innodb.cc.
@ -1183,7 +1181,7 @@ UNIV_INTERN
int
innobase_mysql_tmpfile(void);
/*========================*/
#endif /* !UNIV_HOTBACKUP && !__NETWARE__ */
#endif /* !UNIV_HOTBACKUP */
#if defined(LINUX_NATIVE_AIO)

View file

@ -55,9 +55,10 @@ pfs_os_file_create_simple_func(
{
os_file_t file;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
/* register a file open or creation depending on "create_mode" */
register_pfs_file_open_begin(locker, key,
register_pfs_file_open_begin(&state, locker, key,
((create_mode == OS_FILE_CREATE)
? PSI_FILE_CREATE
: PSI_FILE_OPEN),
@ -101,9 +102,10 @@ pfs_os_file_create_simple_no_error_handling_func(
{
os_file_t file;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
/* register a file open or creation depending on "create_mode" */
register_pfs_file_open_begin(locker, key,
register_pfs_file_open_begin(&state, locker, key,
((create_mode == OS_FILE_CREATE)
? PSI_FILE_CREATE
: PSI_FILE_OPEN),
@ -153,9 +155,10 @@ pfs_os_file_create_func(
{
os_file_t file;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
/* register a file open or creation depending on "create_mode" */
register_pfs_file_open_begin(locker, key,
register_pfs_file_open_begin(&state, locker, key,
((create_mode == OS_FILE_CREATE)
? PSI_FILE_CREATE
: PSI_FILE_OPEN),
@ -183,9 +186,10 @@ pfs_os_file_close_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
/* register the file close */
register_pfs_file_io_begin(locker, file, 0, PSI_FILE_CLOSE,
register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_CLOSE,
src_file, src_line);
result = os_file_close_func(file);
@ -230,9 +234,10 @@ pfs_os_aio_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
/* Register the read or write I/O depending on "type" */
register_pfs_file_io_begin(locker, file, n,
register_pfs_file_io_begin(&state, locker, file, n,
(type == OS_FILE_WRITE)
? PSI_FILE_WRITE
: PSI_FILE_READ,
@ -268,8 +273,9 @@ pfs_os_file_read_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_io_begin(locker, file, n, PSI_FILE_READ,
register_pfs_file_io_begin(&state, locker, file, n, PSI_FILE_READ,
src_file, src_line);
result = os_file_read_func(file, buf, offset, offset_high, n);
@ -303,8 +309,9 @@ pfs_os_file_read_no_error_handling_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_io_begin(locker, file, n, PSI_FILE_READ,
register_pfs_file_io_begin(&state, locker, file, n, PSI_FILE_READ,
src_file, src_line);
result = os_file_read_no_error_handling_func(file, buf, offset,
@ -339,8 +346,9 @@ pfs_os_file_write_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_io_begin(locker, file, n, PSI_FILE_WRITE,
register_pfs_file_io_begin(&state, locker, file, n, PSI_FILE_WRITE,
src_file, src_line);
result = os_file_write_func(name, file, buf, offset, offset_high, n);
@ -366,8 +374,9 @@ pfs_os_file_flush_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_io_begin(locker, file, 0, PSI_FILE_SYNC,
register_pfs_file_io_begin(&state, locker, file, 0, PSI_FILE_SYNC,
src_file, src_line);
result = os_file_flush_func(file);
@ -395,8 +404,9 @@ pfs_os_file_rename_func(
{
ibool result;
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_open_begin(locker, key, PSI_FILE_RENAME, newpath,
register_pfs_file_open_begin(&state, locker, key, PSI_FILE_RENAME, newpath,
src_file, src_line);
result = os_file_rename_func(oldpath, newpath);

View file

@ -91,10 +91,6 @@ extern ib_uint64_t srv_shutdown_lsn;
/** Log sequence number immediately after startup */
extern ib_uint64_t srv_start_lsn;
#ifdef __NETWARE__
void set_panic_flag_for_netware(void);
#endif
#ifdef HAVE_DARWIN_THREADS
/** TRUE if the F_FULLFSYNC option is available */
extern ibool srv_have_fullfsync;

View file

@ -675,12 +675,13 @@ pfs_rw_lock_x_lock_func(
const char* file_name,/*!< in: file name where lock requested */
ulint line) /*!< in: line where requested */
{
struct PSI_rwlock_locker* locker = NULL;
struct PSI_rwlock_locker* locker = NULL;
PSI_rwlock_locker_state state;
/* Record the entry of rw x lock request in performance schema */
if (UNIV_LIKELY(PSI_server && lock->pfs_psi)) {
locker = PSI_server->get_thread_rwlock_locker(
lock->pfs_psi, PSI_RWLOCK_WRITELOCK);
&state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK);
if (locker) {
PSI_server->start_rwlock_wrwait(locker,
@ -709,13 +710,14 @@ pfs_rw_lock_x_lock_func_nowait(
requested */
ulint line) /*!< in: line where requested */
{
struct PSI_rwlock_locker* locker = NULL;
struct PSI_rwlock_locker* locker = NULL;
PSI_rwlock_locker_state state;
ibool ret;
/* Record the entry of rw x lock request in performance schema */
if (UNIV_LIKELY(PSI_server && lock->pfs_psi)) {
locker = PSI_server->get_thread_rwlock_locker(
lock->pfs_psi, PSI_RWLOCK_WRITELOCK);
&state, lock->pfs_psi, PSI_RWLOCK_WRITELOCK);
if (locker) {
PSI_server->start_rwlock_wrwait(locker,
@ -764,12 +766,13 @@ pfs_rw_lock_s_lock_func(
requested */
ulint line) /*!< in: line where requested */
{
struct PSI_rwlock_locker* locker = NULL;
struct PSI_rwlock_locker* locker = NULL;
PSI_rwlock_locker_state state;
/* Instrumented to inform we are aquiring a shared rwlock */
if (UNIV_LIKELY(PSI_server && lock->pfs_psi)) {
locker = PSI_server->get_thread_rwlock_locker(
lock->pfs_psi, PSI_RWLOCK_READLOCK);
&state, lock->pfs_psi, PSI_RWLOCK_READLOCK);
if (locker) {
PSI_server->start_rwlock_rdwait(locker,
file_name, line);
@ -798,14 +801,14 @@ pfs_rw_lock_s_lock_low(
const char* file_name, /*!< in: file name where lock requested */
ulint line) /*!< in: line where requested */
{
struct PSI_rwlock_locker* locker = NULL;
struct PSI_rwlock_locker* locker = NULL;
PSI_rwlock_locker_state state;
ibool ret;
/* Instrumented to inform we are aquiring a shared rwlock */
if (UNIV_LIKELY(PSI_server && lock->pfs_psi)) {
locker = PSI_server->get_thread_rwlock_locker(
lock->pfs_psi, PSI_RWLOCK_READLOCK);
&state, lock->pfs_psi, PSI_RWLOCK_READLOCK);
if (locker) {
PSI_server->start_rwlock_rdwait(locker,
file_name, line);
@ -838,11 +841,7 @@ pfs_rw_lock_x_unlock_func(
{
/* Inform performance schema we are unlocking the lock */
if (UNIV_LIKELY(PSI_server && lock->pfs_psi)) {
struct PSI_thread* thread;
thread = PSI_server->get_thread();
if (thread) {
PSI_server->unlock_rwlock(thread, lock->pfs_psi);
}
PSI_server->unlock_rwlock(lock->pfs_psi);
}
rw_lock_x_unlock_func(
@ -869,11 +868,7 @@ pfs_rw_lock_s_unlock_func(
{
/* Inform performance schema we are unlocking the lock */
if (UNIV_LIKELY(PSI_server && lock->pfs_psi)) {
struct PSI_thread* thread;
thread = PSI_server->get_thread();
if (thread) {
PSI_server->unlock_rwlock(thread, lock->pfs_psi);
}
PSI_server->unlock_rwlock(lock->pfs_psi);
}
rw_lock_s_unlock_func(

View file

@ -237,11 +237,12 @@ pfs_mutex_enter_func(
ulint line) /*!< in: line where locked */
{
struct PSI_mutex_locker* locker = NULL;
PSI_mutex_locker_state state;
int result = 0;
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
locker = PSI_server->get_thread_mutex_locker(
mutex->pfs_psi, PSI_MUTEX_LOCK);
&state, mutex->pfs_psi, PSI_MUTEX_LOCK);
if (locker) {
PSI_server->start_mutex_wait(locker, file_name, line);
}
@ -270,11 +271,12 @@ pfs_mutex_enter_nowait_func(
{
ulint ret;
struct PSI_mutex_locker* locker = NULL;
PSI_mutex_locker_state state;
int result = 0;
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
locker = PSI_server->get_thread_mutex_locker(
mutex->pfs_psi, PSI_MUTEX_LOCK);
&state, mutex->pfs_psi, PSI_MUTEX_LOCK);
if (locker) {
PSI_server->start_mutex_wait(locker, file_name, line);
}
@ -300,12 +302,7 @@ pfs_mutex_exit_func(
mutex_t* mutex) /*!< in: pointer to mutex */
{
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
struct PSI_thread* thread;
thread = PSI_server->get_thread();
if (thread) {
PSI_server->unlock_mutex(thread, mutex->pfs_psi);
}
PSI_server->unlock_mutex(mutex->pfs_psi);
}
mutex_exit_func(mutex);

View file

@ -115,7 +115,7 @@ if we are compiling on Windows. */
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
# include <sys/stat.h>
# if !defined(__NETWARE__) && !defined(__WIN__)
# if !defined(__WIN__)
# include <sys/mman.h> /* mmap() for os0proc.c */
# endif

View file

@ -54,29 +54,18 @@ ut_dbg_assertion_failed(
const char* file, /*!< in: source file containing the assertion */
ulint line); /*!< in: line number of the assertion */
#ifdef __NETWARE__
/** Flag for ignoring further assertion failures. This is set to TRUE
when on NetWare there happens an InnoDB assertion failure or other
fatal error condition that requires an immediate shutdown. */
extern ibool panic_shutdown;
/* Abort the execution. */
void ut_dbg_panic(void);
# define UT_DBG_PANIC ut_dbg_panic()
/* Stop threads in ut_a(). */
# define UT_DBG_STOP do {} while (0) /* We do not do this on NetWare */
#else /* __NETWARE__ */
# if defined(__WIN__) || defined(__INTEL_COMPILER)
# undef UT_DBG_USE_ABORT
# elif defined(__GNUC__) && (__GNUC__ > 2)
# define UT_DBG_USE_ABORT
# endif
#if defined(__WIN__) || defined(__INTEL_COMPILER)
# undef UT_DBG_USE_ABORT
#elif defined(__GNUC__) && (__GNUC__ > 2)
# define UT_DBG_USE_ABORT
#endif
# ifndef UT_DBG_USE_ABORT
#ifndef UT_DBG_USE_ABORT
/** A null pointer that will be dereferenced to trigger a memory trap */
extern ulint* ut_dbg_null_ptr;
# endif
#endif
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
will stop at the next ut_a() or ut_ad(). */
extern ibool ut_dbg_stop_threads;
@ -89,24 +78,23 @@ ut_dbg_stop_thread(
/*===============*/
const char* file,
ulint line);
# endif
#endif
# ifdef UT_DBG_USE_ABORT
#ifdef UT_DBG_USE_ABORT
/** Abort the execution. */
# define UT_DBG_PANIC abort()
# define UT_DBG_PANIC abort()
/** Stop threads (null operation) */
# define UT_DBG_STOP do {} while (0)
# else /* UT_DBG_USE_ABORT */
# define UT_DBG_STOP do {} while (0)
#else /* UT_DBG_USE_ABORT */
/** Abort the execution. */
# define UT_DBG_PANIC \
# define UT_DBG_PANIC \
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
/** Stop threads in ut_a(). */
# define UT_DBG_STOP do \
# define UT_DBG_STOP do \
if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
} while (0)
# endif /* UT_DBG_USE_ABORT */
#endif /* __NETWARE__ */
#endif /* UT_DBG_USE_ABORT */
/** Abort execution if EXPR does not evaluate to nonzero.
@param EXPR assertion expression that should hold */

View file

@ -632,7 +632,7 @@ os_file_handle_error_no_exit(
#undef USE_FILE_LOCK
#define USE_FILE_LOCK
#if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
#if defined(UNIV_HOTBACKUP) || defined(__WIN__)
/* InnoDB Hot Backup does not lock the data files.
* On Windows, mandatory locking is used.
*/
@ -692,35 +692,27 @@ os_io_init_simple(void)
/***********************************************************************//**
Creates a temporary file. This function is like tmpfile(3), but
the temporary file is created in the MySQL temporary directory.
On Netware, this function is like tmpfile(3), because the C run-time
library of Netware does not expose the delete-on-close flag.
@return temporary file handle, or NULL on error */
UNIV_INTERN
FILE*
os_file_create_tmpfile(void)
/*========================*/
{
#ifdef __NETWARE__
FILE* file = tmpfile();
#else /* __NETWARE__ */
FILE* file = NULL;
int fd = innobase_mysql_tmpfile();
if (fd >= 0) {
file = fdopen(fd, "w+b");
}
#endif /* __NETWARE__ */
if (!file) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Error: unable to create temporary file;"
" errno: %d\n", errno);
#ifndef __NETWARE__
if (fd >= 0) {
close(fd);
}
#endif /* !__NETWARE__ */
}
return(file);
@ -1462,7 +1454,11 @@ try_again:
/* When srv_file_per_table is on, file creation failure may not
be critical to the whole instance. Do not crash the server in
case of unknown errors. */
case of unknown errors.
Please note "srv_file_per_table" is a global variable with
no explicit synchronization protection. It could be
changed during this execution path. It might not have the
same value as the one when building the table definition */
if (srv_file_per_table) {
retry = os_file_handle_error_no_exit(name,
create_mode == OS_FILE_CREATE ?
@ -1549,7 +1545,11 @@ try_again:
/* When srv_file_per_table is on, file creation failure may not
be critical to the whole instance. Do not crash the server in
case of unknown errors. */
case of unknown errors.
Please note "srv_file_per_table" is a global variable with
no explicit synchronization protection. It could be
changed during this execution path. It might not have the
same value as the one when building the table definition */
if (srv_file_per_table) {
retry = os_file_handle_error_no_exit(name,
create_mode == OS_FILE_CREATE ?

View file

@ -145,7 +145,7 @@ skip:
os_fast_mutex_unlock(&ut_list_mutex);
UNIV_MEM_ALLOC(ptr, size);
}
#elif defined __NETWARE__ || !defined OS_MAP_ANON
#elif !defined OS_MAP_ANON
size = *n;
ptr = ut_malloc_low(size, TRUE, FALSE);
#else
@ -213,7 +213,7 @@ os_mem_free_large(
os_fast_mutex_unlock(&ut_list_mutex);
UNIV_MEM_FREE(ptr, size);
}
#elif defined __NETWARE__ || !defined OS_MAP_ANON
#elif !defined OS_MAP_ANON
ut_free(ptr);
#else
if (munmap(ptr, size)) {

View file

@ -162,16 +162,6 @@ os_thread_create(
" returned %d\n", ret);
exit(1);
}
#endif
#ifdef __NETWARE__
ret = pthread_attr_setstacksize(&attr,
(size_t) NW_THD_STACKSIZE);
if (ret) {
fprintf(stderr,
"InnoDB: Error: pthread_attr_setstacksize"
" returned %d\n", ret);
exit(1);
}
#endif
os_mutex_enter(os_sync_mutex);
os_thread_count++;
@ -275,8 +265,6 @@ os_thread_sleep(
{
#ifdef __WIN__
Sleep((DWORD) tm / 1000);
#elif defined(__NETWARE__)
delay(tm / 1000);
#else
struct timeval t;

View file

@ -2169,8 +2169,9 @@ row_merge_file_create(
/* This temp file open does not go through normal
file APIs, add instrumentation to register with
performance schema */
struct PSI_file_locker* locker = NULL;
register_pfs_file_open_begin(locker, innodb_file_temp_key,
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_open_begin(&state, locker, innodb_file_temp_key,
PSI_FILE_OPEN,
"Innodb Merge Temp File",
__FILE__, __LINE__);
@ -2192,8 +2193,9 @@ row_merge_file_destroy(
merge_file_t* merge_file) /*!< out: merge file structure */
{
#ifdef UNIV_PFS_IO
struct PSI_file_locker* locker = NULL;
register_pfs_file_io_begin(locker, merge_file->fd, 0, PSI_FILE_CLOSE,
struct PSI_file_locker* locker = NULL;
PSI_file_locker_state state;
register_pfs_file_io_begin(&state, locker, merge_file->fd, 0, PSI_FILE_CLOSE,
__FILE__, __LINE__);
#endif
if (merge_file->fd != -1) {

View file

@ -1239,14 +1239,6 @@ innobase_start_or_create_for_mysql(void)
maximum number of threads that can wait in the 'srv_conc array' for
their time to enter InnoDB. */
#if defined(__NETWARE__)
/* Create less event semaphores because Win 98/ME had
difficulty creating 40000 event semaphores. Comment from
Novell, Inc.: also, these just take a lot of memory on
NetWare. */
srv_max_n_threads = 1000;
#else
if (srv_buf_pool_size >= 1000 * 1024 * 1024) {
/* If buffer pool is less than 1000 MB,
assume fewer threads. Also use only one
@ -1263,7 +1255,7 @@ innobase_start_or_create_for_mysql(void)
especially in 64-bit
computers */
}
#endif
err = srv_boot();
if (err != DB_SUCCESS) {
@ -1940,9 +1932,6 @@ innobase_shutdown_for_mysql(void)
/*=============================*/
{
ulint i;
#ifdef __NETWARE__
extern ibool panic_shutdown;
#endif
if (!srv_was_started) {
if (srv_is_being_started) {
ut_print_timestamp(stderr);
@ -1971,10 +1960,7 @@ innobase_shutdown_for_mysql(void)
"InnoDB will do a crash recovery!\n");
}
#ifdef __NETWARE__
if (!panic_shutdown)
#endif
logs_empty_and_mark_files_at_shutdown();
logs_empty_and_mark_files_at_shutdown();
if (srv_conc_n_threads != 0) {
fprintf(stderr,
@ -2141,12 +2127,4 @@ innobase_shutdown_for_mysql(void)
return((int) DB_SUCCESS);
}
#ifdef __NETWARE__
void set_panic_flag_for_netware()
{
extern ibool panic_shutdown;
panic_shutdown = TRUE;
}
#endif /* __NETWARE__ */
#endif /* !UNIV_HOTBACKUP */

View file

@ -37,12 +37,7 @@ UNIV_INTERN ulint ut_dbg_zero = 0;
will stop at the next ut_a() or ut_ad(). */
UNIV_INTERN ibool ut_dbg_stop_threads = FALSE;
#endif
#ifdef __NETWARE__
/** Flag for ignoring further assertion failures. This is set to TRUE
when on NetWare there happens an InnoDB assertion failure or other
fatal error condition that requires an immediate shutdown. */
UNIV_INTERN ibool panic_shutdown = FALSE;
#elif !defined(UT_DBG_USE_ABORT)
#ifndef UT_DBG_USE_ABORT
/** A null pointer that will be dereferenced to trigger a memory trap */
UNIV_INTERN ulint* ut_dbg_null_ptr = NULL;
#endif
@ -86,22 +81,7 @@ ut_dbg_assertion_failed(
#endif
}
#ifdef __NETWARE__
/*************************************************************//**
Shut down MySQL/InnoDB after assertion failure. */
UNIV_INTERN
void
ut_dbg_panic(void)
/*==============*/
{
if (!panic_shutdown) {
panic_shutdown = TRUE;
innobase_shutdown_for_mysql();
}
exit(1);
}
#else /* __NETWARE__ */
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
/*************************************************************//**
Stop a thread after assertion failure. */
UNIV_INTERN
@ -117,8 +97,7 @@ ut_dbg_stop_thread(
os_thread_sleep(1000000000);
#endif /* !UNIV_HOTBACKUP */
}
# endif
#endif /* __NETWARE__ */
#endif
#ifdef UNIV_COMPILE_TEST_FUNCS

View file

@ -179,9 +179,6 @@ retry:
/* Make an intentional seg fault so that we get a stack
trace */
/* Intentional segfault on NetWare causes an abend. Avoid this
by graceful exit handling in ut_a(). */
#if (!defined __NETWARE__)
if (assert_on_error) {
ut_print_timestamp(stderr);
@ -194,9 +191,6 @@ retry:
} else {
return(NULL);
}
#else
ut_a(0);
#endif
}
if (set_to_zero) {