merge from mysql-trunk-bugfixing

This commit is contained in:
Jon Olav Hauglid 2010-07-19 10:27:53 +02:00
commit 7467ee7bc6
480 changed files with 4932 additions and 9554 deletions

View file

@ -90,22 +90,19 @@ SSL_LIBRARY=--with-ssl
if [ "x$warning_mode" != "xpedantic" ]; then
# Both C and C++ warnings
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
# For more warnings, uncomment the following line
# warnings="$global_warnings -Wshadow"
# warnings="$warnings -Wshadow"
# C warnings
c_warnings="$warnings -Wunused-parameter"
c_warnings="$warnings"
# C++ warnings
cxx_warnings="$warnings"
cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
cxx_warnings="$cxx_warnings -Wreorder"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized"
debug_extra_cflags="-O0 -g3 -gdwarf-2"
else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings"

View file

@ -1066,7 +1066,6 @@ set_with_debug_flags()
if test "x$with_debug_flag" = "xyes" ; then
if test "x$developer_flag" = "xyes" ; then
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
loc_debug_flags="$loc_debug_flags"
compiler_flags="$compiler_flags $loc_debug_flags"
fi
fi

View file

@ -187,69 +187,76 @@ check_cpu () {
cc=$CC
fi
if test "x$compiler" = "x" ; then
cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
if test "x$core2" = "xyes" ; then
cpu_arg="core2"
fi
if test "x$compiler" != "x" ; then
return 0
fi
# check if compiler is gcc and dump its version
cc_verno=`$cc -dumpversion 2>/dev/null`
if test "x$?" = "x0" ; then
set -- `echo $cc_verno | tr '.' ' '`
cc_ver="GCC"
cc_major=$1
cc_minor=$2
cc_patch=$3
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
check_cpu_cflags="-mcpu=${cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
check_cpu_cflags="-mtune=${cpu_arg}"
fi
;;
ppc-*)
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
;;
2.95.*)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_cflags="-m${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
# now we check whether the compiler really understands the cpu type
touch __test.c
fi
while [ "$cpu_arg" ] ; do
printf "testing $cpu_arg ... " >&2
# compile check
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
if test "x$?" = "x0" ; then
echo ok >&2
break;
fi
echo failed >&2
case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
check_cpu_cflags="-mcpu=${cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
check_cpu_cflags="-mtune=${cpu_arg}"
fi
;;
ppc-*)
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
;;
2.95.*)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_cflags="-m${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
# now we check whether the compiler really understands the cpu type
touch __test.c
while [ "$cpu_arg" ] ; do
printf "testing $cpu_arg ... " >&2
# compile check
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
if test "x$?" = "x0" ; then
echo ok >&2
break;
done
rm __test.*
fi
if test "x$core2" = "xyes" ; then
cpu_arg="core2"
fi
fi
echo failed >&2
check_cpu_cflags=""
break;
done
rm __test.*
return 0
}
check_cpu

34
CMakeLists.txt Executable file → Normal file
View file

@ -104,6 +104,27 @@ IF(DEFINED ENV{CPPFLAGS})
ADD_DEFINITIONS($ENV{CPPFLAGS})
ENDIF()
#
# Control aspects of the development environment which are
# specific to MySQL maintainers and developers.
#
OPTION(MYSQL_MAINTAINER_MODE "MySQL maintainer-specific development environment" OFF)
# Whether the maintainer mode should be enabled.
IF(MYSQL_MAINTAINER_MODE)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(MY_MAINTAINER_C_WARNINGS "-Wall -Wextra -Wunused -Wwrite-strings -Werror"
CACHE STRING "C warning options used in maintainer builds.")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_C_WARNINGS} -Wno-unused-parameter"
CACHE STRING "C++ warning options used in maintainer builds.")
ENDIF()
# Do not make warnings in checks into errors.
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")
ENDIF()
ENDIF()
# Add macros
INCLUDE(character_sets)
INCLUDE(zlib)
@ -226,6 +247,19 @@ MYSQL_CHECK_SSL()
# Add readline or libedit.
MYSQL_CHECK_READLINE()
#
# Setup maintainer mode options by the end. Platform checks are
# not run with the warning options as to not perturb fragile checks
# (i.e. do not make warnings into errors).
#
IF(MYSQL_MAINTAINER_MODE)
# Set compiler flags required under maintainer mode.
MESSAGE(STATUS "C warning options: ${MY_MAINTAINER_C_WARNINGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_MAINTAINER_C_WARNINGS}")
MESSAGE(STATUS "C++ warning options: ${MY_MAINTAINER_CXX_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_MAINTAINER_CXX_WARNINGS}")
ENDIF()
IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.

View file

@ -27,7 +27,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@pstack_dir@ libservices \
@sql_union_dirs@ unittest \
@sql_server@ @man_dirs@ tests \
netware @libmysqld_dirs@ \
@libmysqld_dirs@ \
mysql-test support-files sql-bench \
win \
cmake
@ -36,7 +36,7 @@ DIST_SUBDIRS = . include Docs zlib \
pstack libservices \
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
vio sql man tests \
netware libmysqld \
libmysqld \
mysql-test support-files sql-bench \
win \
cmake \

0
client/CMakeLists.txt Executable file → Normal file
View file

View file

@ -60,7 +60,7 @@ enum options_client
OPT_IMPORT_USE_THREADS,
OPT_MYSQL_NUMBER_OF_QUERY,
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_CREATE_SLAP_SCHEMA,
OPT_TZ_UTC, OPT_CREATE_SLAP_SCHEMA,
OPT_MYSQLDUMP_SLAVE_APPLY,
OPT_MYSQLDUMP_SLAVE_DATA,
OPT_MYSQLDUMP_INCLUDE_MASTER_HOST_PORT,

View file

@ -88,10 +88,9 @@ extern "C" {
#endif
#endif
#undef bcmp // Fix problem with new readline
#if defined(__WIN__)
#include <conio.h>
#elif !defined(__NETWARE__)
#else
#include <readline/readline.h>
#define HAVE_READLINE
#endif
@ -109,7 +108,7 @@ extern "C" {
#define cmp_database(cs,A,B) strcmp((A),(B))
#endif
#if !defined(__WIN__) && !defined(__NETWARE__) && !defined(THREAD)
#if !defined(__WIN__) && !defined(THREAD)
#define USE_POPEN
#endif
@ -1365,10 +1364,6 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0},
{"help", 'I', "Synonym for -?", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"auto-rehash", OPT_AUTO_REHASH,
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table "
"and field completion, but startup and reconnecting may take a longer time. "
@ -1582,11 +1577,6 @@ static struct my_option my_long_options[] =
static void usage(int version)
{
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#endif
#if defined(USE_LIBEDIT_INTERFACE)
const char* readline= "";
#else
@ -1609,10 +1599,6 @@ static void usage(int version)
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
my_print_variables(my_long_options);
NETWARE_SET_SCREEN_MODE(1);
#ifdef __NETWARE__
#undef printf
#endif
}
@ -1621,11 +1607,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case OPT_CHARSETS_DIR:
strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1);
charsets_dir = mysql_charsets_dir;
@ -1851,10 +1832,6 @@ static int get_options(int argc, char **argv)
static int read_and_execute(bool interactive)
{
#if defined(__NETWARE__)
char linebuffer[254];
String buffer;
#endif
#if defined(__WIN__)
String tmpbuf;
String buffer;
@ -1900,18 +1877,8 @@ static int read_and_execute(bool interactive)
if (opt_outfile && glob_buffer.is_empty())
fflush(OUTFILE);
#if defined(__WIN__) || defined(__NETWARE__)
#if defined(__WIN__)
tee_fputs(prompt, stdout);
#if defined(__NETWARE__)
line=fgets(linebuffer, sizeof(linebuffer)-1, stdin);
/* Remove the '\n' */
if (line)
{
char *p = strrchr(line, '\n');
if (p != NULL)
*p = '\0';
}
#else
if (!tmpbuf.is_alloced())
tmpbuf.alloc(65535);
tmpbuf.length(0);
@ -1932,12 +1899,11 @@ static int read_and_execute(bool interactive)
*/
if (line)
line= buffer.c_ptr();
#endif /* __NETWARE__ */
#else
if (opt_outfile)
fputs(prompt, OUTFILE);
line= readline(prompt);
#endif /* defined(__WIN__) || defined(__NETWARE__) */
#endif /* defined(__WIN__) */
/*
When Ctrl+d or Ctrl+z is pressed, the line may be NULL on some OS
@ -1985,10 +1951,8 @@ static int read_and_execute(bool interactive)
}
}
#if defined(__WIN__) || defined(__NETWARE__)
buffer.free();
#endif
#if defined(__WIN__)
buffer.free();
tmpbuf.free();
#endif
@ -3945,8 +3909,6 @@ static int
com_quit(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
/* let the screen auto close on a normal shutdown */
NETWARE_SET_SCREEN_MODE(SCR_AUTOCLOSE_ON_EXIT);
status.exit_status=0;
return 1;
}
@ -4664,7 +4626,6 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
{
va_list args;
NETWARE_YIELD;
va_start(args, fmt);
(void) vfprintf(file, fmt, args);
va_end(args);
@ -4680,7 +4641,6 @@ void tee_fprintf(FILE *file, const char *fmt, ...)
void tee_fputs(const char *s, FILE *file)
{
NETWARE_YIELD;
fputs(s, file);
if (opt_outfile)
fputs(s, OUTFILE);
@ -4689,7 +4649,6 @@ void tee_fputs(const char *s, FILE *file)
void tee_puts(const char *s, FILE *file)
{
NETWARE_YIELD;
fputs(s, file);
fputc('\n', file);
if (opt_outfile)
@ -4706,7 +4665,7 @@ void tee_putc(int c, FILE *file)
putc(c, OUTFILE);
}
#if defined(__WIN__) || defined(__NETWARE__)
#if defined(__WIN__)
#include <time.h>
#else
#include <sys/times.h>
@ -4718,8 +4677,8 @@ void tee_putc(int c, FILE *file)
static ulong start_timer(void)
{
#if defined(__WIN__) || defined(__NETWARE__)
return clock();
#if defined(__WIN__)
return clock();
#else
struct tms tms_tmp;
return times(&tms_tmp);

View file

@ -57,8 +57,6 @@ static my_bool not_used; /* Can't use GET_BOOL without a value pointer */
static my_bool opt_write_binlog;
#include <help_start.h>
static struct my_option my_long_options[]=
{
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
@ -139,8 +137,6 @@ static struct my_option my_long_options[]=
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
#include <help_end.h>
static void free_used_memory(void)
{
@ -809,9 +805,6 @@ int main(int argc, char **argv)
char self_name[FN_REFLEN];
MY_INIT(argv[0]);
#ifdef __NETWARE__
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
#endif
#if __WIN__
if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0)

View file

@ -116,10 +116,6 @@ static TYPELIB command_typelib=
static struct my_option my_long_options[] =
{
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"count", 'c',
"Number of iterations to make. This works with -i (--sleep) only.",
&nr_iterations, &nr_iterations, 0, GET_UINT,
@ -222,11 +218,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int error = 0;
switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'c':
opt_count_iterations= 1;
break;
@ -1068,13 +1059,11 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
return 0;
}
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s on %s\n",my_progname,ADMIN_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
}
@ -1118,7 +1107,6 @@ static void usage(void)
version Get version info from server");
}
#include <help_end.h>
static int drop_db(MYSQL *mysql, const char *db)
{

View file

@ -436,7 +436,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
ptr= fname + target_dir_name_len;
memcpy(ptr,bname,blen);
ptr+= blen;
ptr+= my_sprintf(ptr, (ptr, "-%x", file_id));
ptr+= sprintf(ptr, "-%x", file_id);
if ((file= create_unique_file(fname,ptr)) < 0)
{
@ -1002,10 +1002,6 @@ static struct my_option my_long_options[] =
{
{"help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"base64-output", OPT_BASE64_OUTPUT_MODE,
/* 'unspec' is not mentioned because it is just a placeholder. */
"Determine when the output statements should be base64-encoded BINLOG "
@ -1233,12 +1229,10 @@ static void cleanup()
mysql_close(mysql);
}
#include <help_start.h>
static void print_version()
{
printf("%s Ver 3.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
}
@ -1280,7 +1274,6 @@ static my_time_t convert_str_to_timestamp(const char* str)
my_system_gmt_sec(&l_time, &dummy_my_timezone, &dummy_in_dst_time_gap);
}
#include <help_end.h>
extern "C" my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@ -1288,11 +1281,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
{
bool tty_password=0;
switch (optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
#ifndef DBUG_OFF
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);

View file

@ -62,10 +62,6 @@ static struct my_option my_long_options[] =
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
&opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"auto-repair", OPT_AUTO_REPAIR,
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
&opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
@ -208,13 +204,11 @@ static uint fixed_name_length(const char *name);
static char *fix_table_name(char *dest, char *src);
int what_to_do = 0;
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, CHECK_VERSION,
MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} /* print_version */
@ -245,18 +239,12 @@ static void usage(void)
my_print_variables(my_long_options);
} /* usage */
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'a':
what_to_do = DO_ANALYZE;
break;
@ -708,8 +696,7 @@ static int handle_request_for_tables(char *tables, uint length)
if (opt_all_in_1)
{
/* No backticks here as we added them before */
query_length= my_sprintf(query,
(query, "%s TABLE %s %s", op, tables, options));
query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
}
else
{

View file

@ -212,10 +212,6 @@ static struct my_option my_long_options[] =
"Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump.",
&opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -433,10 +429,10 @@ static struct my_option my_long_options[] =
&opt_replace_into, &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"result-file", 'r',
"Direct output to a given file. This option should be used in MSDOS, "
"because it prevents new line '\\n' from being converted to '\\r\\n' "
"(carriage return + line feed).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
"Direct output to a given file. This option should be used in systems "
"(e.g., DOS, Windows) that use carriage-return linefeed pairs (\\r\\n) "
"to separate text lines. This option ensures that only a single newline "
"is used.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"routines", 'R', "Dump stored routines (functions and procedures).",
&opt_routines, &opt_routines, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
@ -531,7 +527,6 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
static int dump_tablespaces_for_databases(char** databases);
static int dump_tablespaces(char* ts_where);
#include <help_start.h>
/*
Print the supplied message if in verbose mode
@ -575,7 +570,6 @@ static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
} /* print_version */
@ -585,7 +579,6 @@ static void short_usage_sub(void)
printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
my_progname);
printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname);
NETWARE_SET_SCREEN_MODE(1);
}
@ -608,8 +601,6 @@ static void short_usage(void)
printf("For more options, use %s --help\n", my_progname);
}
#include <help_end.h>
static void write_header(FILE *sql_file, char *db_name)
{
@ -728,11 +719,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch (optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */

View file

@ -67,10 +67,6 @@ static char *shared_memory_base_name=0;
static struct my_option my_long_options[] =
{
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -184,13 +180,11 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqlimport","client",0 };
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n" ,my_progname,
IMPORT_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
}
@ -212,18 +206,12 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
my_print_variables(my_long_options);
}
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'p':
if (argument == disabled_my_option)
argument= (char*) ""; /* Don't require password */

View file

@ -160,10 +160,6 @@ int main(int argc, char **argv)
static struct my_option my_long_options[] =
{
#ifdef __NETWARE__
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"character-sets-dir", 'c', "Directory for character set files.",
&charsets_dir, &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
0, 0, 0, 0, 0},
@ -240,14 +236,11 @@ static struct my_option my_long_options[] =
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,SHOW_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
NETWARE_SET_SCREEN_MODE(1);
}
@ -270,18 +263,12 @@ are shown.");
my_print_variables(my_long_options);
}
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'v':
opt_verbose++;
break;
@ -670,8 +657,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
char query[1024],*end;
MYSQL_RES *result;
MYSQL_ROW row;
ulong rows;
LINT_INIT(rows);
ulong UNINIT_VAR(rows);
if (mysql_select_db(mysql,db))
{

View file

@ -676,8 +676,6 @@ static struct my_option my_long_options[] =
};
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname, SLAP_VERSION,
@ -696,7 +694,6 @@ static void usage(void)
my_print_help(my_long_options);
}
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@ -704,11 +701,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
{
DBUG_ENTER("get_one_option");
switch(optid) {
#ifdef __NETWARE__
case OPT_AUTO_CLOSE:
setscreenmode(SCR_AUTOCLOSE_ON_EXIT);
break;
#endif
case 'v':
verbose++;
break;

View file

@ -3707,7 +3707,6 @@ void do_send_quit(struct st_command *command)
void do_change_user(struct st_command *command)
{
MYSQL *mysql = &cur_con->mysql;
/* static keyword to make the NetWare compiler happy. */
static DYNAMIC_STRING ds_user, ds_passwd, ds_db;
const struct command_arg change_user_args[] = {
{ "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
@ -5828,7 +5827,7 @@ int read_command(struct st_command** command_ptr)
(struct st_command*) my_malloc(sizeof(*command),
MYF(MY_WME|MY_ZEROFILL))) ||
insert_dynamic(&q_lines, (uchar*) &command))
die(NullS);
die("Out of memory");
command->type= Q_UNKNOWN;
read_command_buf[0]= 0;
@ -6006,8 +6005,6 @@ static struct my_option my_long_options[] =
};
#include <help_start.h>
void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION,
@ -6026,8 +6023,6 @@ void usage()
my_print_variables(my_long_options);
}
#include <help_end.h>
/*
Read arguments for embedded server and put them into
@ -6319,7 +6314,7 @@ void init_win_path_patterns()
}
if (insert_dynamic(&patterns, (uchar*) &p))
die(NullS);
die("Out of memory");
DBUG_PRINT("info", ("p: %s", p));
while (*p)
@ -9411,8 +9406,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
for (i=1 ; i <= found_sets ; i++)
{
pos=from[found_set[i-1].table_offset];
rep_str[i].found= !bcmp((const uchar*) pos,
(const uchar*) "\\^", 3) ? 2 : 1;
rep_str[i].found= !memcmp(pos, "\\^", 3) ? 2 : 1;
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@ -9540,8 +9534,8 @@ void copy_bits(REP_SET *to,REP_SET *from)
int cmp_bits(REP_SET *set1,REP_SET *set2)
{
return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
sizeof(uint) * set1->size_of_bits);
return memcmp(set1->bits, set2->bits,
sizeof(uint) * set1->size_of_bits);
}
@ -9610,17 +9604,15 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
uint start_at_word(char * pos)
{
return (((!bcmp((const uchar*) pos, (const uchar*) "\\b",2) && pos[2]) ||
!bcmp((const uchar*) pos, (const uchar*) "\\^", 2)) ? 1 : 0);
return (((!memcmp(pos, "\\b",2) && pos[2]) ||
!memcmp(pos, "\\^", 2)) ? 1 : 0);
}
uint end_of_word(char * pos)
{
char * end=strend(pos);
return ((end > pos+2 && !bcmp((const uchar*) end-2,
(const uchar*) "\\b", 2)) ||
(end >= pos+2 && !bcmp((const uchar*) end-2,
(const uchar*) "\\$",2))) ? 1 : 0;
return ((end > pos+2 && !memcmp(end-2, "\\b", 2)) ||
(end >= pos+2 && !memcmp(end-2, "\\$",2))) ? 1 : 0;
}
/****************************************************************************

View file

@ -184,6 +184,12 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DWITH_DEBUG_FULL=1";
next;
}
if ($option =~ /mysql-maintainer-mode/)
{
$cmakeargs = $cmakeargs." -DMYSQL_MAINTAINER_MODE=" .
($option =~ /enable/ ? "1" : "0");
next;
}
$option = uc($option);
$option =~ s/-/_/g;

0
cmake/install_layout.cmake Executable file → Normal file
View file

View file

@ -30,7 +30,6 @@ SET(HAVE_ASM_MSR_H CACHE INTERNAL "")
SET(HAVE_BACKTRACE CACHE INTERNAL "")
SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "")
SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "")
SET(HAVE_BCMP CACHE INTERNAL "")
SET(HAVE_BFILL CACHE INTERNAL "")
SET(HAVE_BMOVE CACHE INTERNAL "")
SET(HAVE_BSD_SIGNALS CACHE INTERNAL "")

View file

@ -26,11 +26,10 @@ IF(NOT VERSION)
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1)
SET(DEFAULT_PLATFORM ${CMAKE_SYSTEM_NAME})
SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
MESSAGE("SIZEOF_VOIDP=${SIZEOF_VOIDP}")
IF(SIZEOF_VOIDP EQUAL 8)
SET(64BIT 1)
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "Windows")
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0)
SET(DEFAULT_PLATFORM "win")

View file

@ -31,4 +31,4 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1

View file

@ -125,7 +125,6 @@
#cmakedefine HAVE_AIOWAIT 1
#cmakedefine HAVE_ALARM 1
#cmakedefine HAVE_ALLOCA 1
#cmakedefine HAVE_BCMP 1
#cmakedefine HAVE_BFILL 1
#cmakedefine HAVE_BMOVE 1
#cmakedefine HAVE_BZERO 1

View file

@ -0,0 +1,64 @@
#
# Control aspects of the development environment which are
# specific to MySQL maintainers and developers.
#
AC_DEFUN([MY_MAINTAINER_MODE], [
AC_MSG_CHECKING([whether to enable the maintainer-specific development environment])
AC_ARG_ENABLE([mysql-maintainer-mode],
[AS_HELP_STRING([--enable-mysql-maintainer-mode],
[Enable a MySQL maintainer-specific development environment])],
[USE_MYSQL_MAINTAINER_MODE=$enableval],
[USE_MYSQL_MAINTAINER_MODE=no])
AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
])
# Set warning options required under maintainer mode.
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
# Setup GCC warning options.
AS_IF([test "$GCC" = "yes"], [
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
])
# Test whether the warning options work.
# Test C options
AS_IF([test -n "$C_WARNINGS"], [
save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}])
AC_LANG_PUSH(C)
CFLAGS="$CFLAGS ${C_WARNINGS}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes],
[myac_c_warning_flags=no])
AC_LANG_POP()
AC_MSG_RESULT([$myac_c_warning_flags])
CFLAGS="$save_CFLAGS"
])
# Test C++ options
AS_IF([test -n "$CXX_WARNINGS"], [
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}])
AC_LANG_PUSH(C++)
CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes],
[myac_cxx_warning_flags=no])
AC_LANG_POP()
AC_MSG_RESULT([$myac_cxx_warning_flags])
CXXFLAGS="$save_CXXFLAGS"
])
# Set compile flag variables.
AS_IF([test "$myac_c_warning_flags" = "yes"], [
AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}"
AC_SUBST([AM_CFLAGS])])
AS_IF([test "$myac_cxx_warning_flags" = "yes"], [
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}"
AC_SUBST([AM_CXXFLAGS])])
])
# Set compiler flags required under maintainer mode.
AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [
AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"],
[MY_MAINTAINER_MODE_WARNINGS])
])

View file

@ -617,25 +617,19 @@ fi
AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [
case $SYSTEM_TYPE in
*netware*)
CXX_VERSION=`$CXX -version | grep -i version`
;;
*)
CXX_VERSION=`$CXX --version | sed 1q`
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI
fi
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha
fi
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=""
fi
esac
CXX_VERSION=`$CXX --version | sed 1q`
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI
fi
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha
fi
if test $? -ne "0" -o -z "$CXX_VERSION"
then
CXX_VERSION=""
fi
if test "$CXX_VERSION"
then
AC_MSG_CHECKING("C++ compiler version")

View file

@ -273,7 +273,6 @@ CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE)
CHECK_FUNCTION_EXISTS (backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
CHECK_FUNCTION_EXISTS (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD)
CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK)
CHECK_FUNCTION_EXISTS (bcmp HAVE_BCMP)
CHECK_FUNCTION_EXISTS (bfill HAVE_BFILL)
CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE)
CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH)

View file

@ -80,6 +80,7 @@ MYSQL_TCP_PORT_DEFAULT=3306
MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
dnl Include m4
sinclude(config/ac-macros/maintainer.m4)
sinclude(config/ac-macros/alloca.m4)
sinclude(config/ac-macros/check_cpu.m4)
sinclude(config/ac-macros/character_sets.m4)
@ -118,6 +119,8 @@ AC_SUBST(SHARED_LIB_MAJOR_VERSION)
AC_SUBST(SHARED_LIB_VERSION)
AC_SUBST(AVAILABLE_LANGUAGES)
# Whether the maintainer mode should be enabled.
MY_MAINTAINER_MODE
# Canonicalize the configuration name.
@ -226,14 +229,7 @@ AC_PROG_CXX
AC_PROG_CPP
# Print version of CC and CXX compiler (if they support --version)
case $SYSTEM_TYPE in
*netware*)
CC_VERSION=`$CC -version | grep -i version`
;;
*)
CC_VERSION=`$CC --version | sed 1q`
;;
esac
if test $? -eq "0"
then
AC_MSG_CHECKING("C Compiler version")
@ -291,40 +287,6 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
AC_CHECK_PROG(DVIS, tex, manual.dvi)
#check the return type of sprintf
AC_MSG_CHECKING("return type of sprintf")
AC_TRY_RUN([
int main()
{
char* s = "hello";
char buf[6];
if((int)sprintf(buf, s) == strlen(s))
return 0;
return -1;
}
],
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
AC_MSG_RESULT("int")],
[AC_TRY_RUN([
int main()
{
char* s = "hello";
char buf[6];
if((char*)sprintf(buf,s) == buf + strlen(s))
return 0;
return -1;
} ],
[AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
AC_MSG_RESULT("ptr")],
[AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
AC_MSG_RESULT("garbage")]
)],
# Cross compile, assume POSIX
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
AC_MSG_RESULT("int (we assume)")]
)
AC_PATH_PROG(uname_prog, uname, no)
# We should go through this and put all the explictly system dependent
@ -458,15 +420,10 @@ dnl Find paths to some shell programs
AC_PATH_PROG(LN, ln, ln)
# This must be able to take a -f flag like normal unix ln.
AC_PATH_PROG(LN_CP_F, ln, ln)
case $SYSTEM_TYPE in
*netware*) ;;
*)
# If ln -f does not exists use -s (AFS systems)
if test -n "$LN_CP_F"; then
LN_CP_F="$LN_CP_F -s"
fi
;;
esac
# If ln -f does not exists use -s (AFS systems)
if test -n "$LN_CP_F"; then
LN_CP_F="$LN_CP_F -s"
fi
AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(RM, rm, rm)
@ -506,7 +463,16 @@ if test "$GCC" != "yes" || expr "$CC" : ".*icc.*"
then
ABI_CHECK=""
else
ABI_CHECK="abi_check"
# Workaround GCC >= 4.5 - See Bug#52514
case `$CC -dumpversion` in
[[4-9]].[[5-9]]*)
AC_MSG_WARN([ABI check disabled (GCC >= 4.5)])
ABI_CHECK=""
;;
*)
ABI_CHECK="abi_check"
;;
esac
fi
AC_SUBST(ABI_CHECK)
@ -550,9 +516,6 @@ else
*cygwin*)
FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null"
;;
*netware*)
FIND_PROC=
;;
*)
AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.])
esac
@ -1354,98 +1317,6 @@ dnl Is this the right match for DEC OSF on alpha?
# fix to handle include of <stdint.h> correctly on OSF1 with cxx compiler
CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk"
;;
*netware*)
# No need for curses library so set it to null
with_named_curses=""
# No thread library - in LibC
with_named_thread=""
#
# Edit Makefile.in files.
#
echo -n "configuring Makefile.in files for NetWare... "
for file in sql/Makefile.in extra/Makefile.in client/Makefile.in
do
# echo "#### $file ####"
filedir="`dirname $file`"
filebase="`basename $file`"
filesed=$filedir/$filebase.sed
#
# Backup and always use original file
#
if test -f $file.bk
then
cp -fp $file.bk $file
else
cp -fp $file $file.bk
fi
case $file in
sql/Makefile.in)
# Use gen_lex_hash.linux instead of gen_lex_hash
# Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(pstack_libs) \$(openssl_libs) \$(yassl_libs)"
cat > $filesed << EOF
s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
s%\(mysqld_DEPENDENCIES = \)%\1$lib_DEPENDENCIES %
EOF
;;
extra/Makefile.in)
cat > $filesed << EOF
s,\(extra/comp_err\)\$(EXEEXT),\1.linux,
EOF
;;
libmysql/Makefile.in)
cat > $filesed << EOF
s,libyassl.la,.libs/libyassl.a,
s,libtaocrypt.la,.libs/libtaocrypt.a,
EOF
;;
libmysql_r/Makefile.in)
cat > $filesed << EOF
s,libyassl.la,.libs/libyassl.a,
s,libtaocrypt.la,.libs/libtaocrypt.a,
EOF
;;
client/Makefile.in)
#
cat > $filesed << EOF
s,libmysqlclient.la,.libs/libmysqlclient.a,
EOF
;;
esac
if `sed -f $filesed $file > $file.nw`;\
then
mv -f $file.nw $file
rm -f $filesed
else
exit 1
fi
# wait for file system changes to complete
sleep 1
done
echo "done"
#
# Make sure the following files are writable.
#
# When the files are retrieved from some source code control systems they are read-only.
#
echo -n "making sure specific build files are writable... "
for file in \
Docs/manual.chm \
Docs/mysql.info \
Docs/INSTALL-BINARY \
INSTALL-SOURCE \
COPYING
do
if test -e $file; then
chmod +w $file
fi
done
echo "done"
;;
esac
@ -1818,12 +1689,7 @@ esac
# System characteristics
case $SYSTEM_TYPE in
*netware*) ;;
*)
AC_SYS_RESTARTABLE_SYSCALLS
;;
esac
# Build optimized or debug version ?
# First check for gcc and g++
@ -1863,17 +1729,6 @@ else
esac
fi
case $SYSTEM_TYPE in
*netware*)
DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_OPTIMIZE_CC="-DDEBUG"
DEBUG_OPTIMIZE_CXX="-DDEBUG"
OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
;;
esac
# If the user specified CFLAGS, we won't add any optimizations
if test -n "$SAVE_CFLAGS"
then
@ -2221,18 +2076,13 @@ MYSQL_TZNAME
# Do the c++ compiler have a bool type
MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc
case $SYSTEM_TYPE in
*netware*) ;;
*)
MYSQL_CHECK_LONGLONG_TO_FLOAT
if test "$ac_cv_conv_longlong_to_float" != "yes"
then
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
again])
fi
;;
esac
MYSQL_CHECK_LONGLONG_TO_FLOAT
if test "$ac_cv_conv_longlong_to_float" != "yes"
then
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3
or newer and try again])
fi
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
AC_CHECK_TYPES([u_int32_t])
@ -2340,7 +2190,7 @@ MYSQL_TYPE_QSORT
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \
chsize cuserid fchmod fcntl \
fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
@ -2930,66 +2780,58 @@ readline_h_ln_cmd=""
readline_link=""
want_to_use_readline="no"
case $SYSTEM_TYPE in
*netware*)
# For NetWare, do not need readline
echo "Skipping readline"
;;
*)
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
then
readline_topdir="cmd-line-utils"
readline_basedir="libedit"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline"
compile_libedit=yes
AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
elif test "$with_readline" = "yes"
then
readline_topdir="cmd-line-utils"
readline_basedir="readline"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
compile_readline=yes
want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
else
# Use system readline library
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
MYSQL_CHECK_LIBEDIT_INTERFACE
MYSQL_CHECK_NEW_RL_INTERFACE
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
AC_LANG_RESTORE
if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"]
then
readline_topdir="cmd-line-utils"
readline_basedir="libedit"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline"
compile_libedit=yes
AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1)
AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1)
elif test "$with_readline" = "yes"
# Use the new readline interface, but only if the package includes a bundled libreadline
# this way we avoid linking commercial source with GPL readline
readline_link="-lreadline"
want_to_use_readline="yes"
elif [test "$mysql_cv_libedit_interface" = "yes"]
then
readline_topdir="cmd-line-utils"
readline_basedir="readline"
readline_dir="$readline_topdir/$readline_basedir"
readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a"
readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline"
compile_readline=yes
want_to_use_readline="yes"
AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1)
# Use libedit
readline_link="-ledit"
else
# Use system readline library
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
MYSQL_CHECK_LIBEDIT_INTERFACE
MYSQL_CHECK_NEW_RL_INTERFACE
MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY
AC_LANG_RESTORE
if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"]
then
# Use the new readline interface, but only if the package includes a bundled libreadline
# this way we avoid linking commercial source with GPL readline
readline_link="-lreadline"
want_to_use_readline="yes"
elif [test "$mysql_cv_libedit_interface" = "yes"]
then
# Use libedit
readline_link="-ledit"
else
AC_MSG_ERROR([Could not find system readline or libedit libraries
Use --with-readline or --with-libedit to use the bundled
versions of libedit or readline])
fi
AC_MSG_ERROR([Could not find system readline or libedit libraries
Use --with-readline or --with-libedit to use the bundled
versions of libedit or readline])
fi
fi
# if there is no readline, but we want to build with readline, we fail
if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"]
then
AC_MSG_ERROR([This commercially licensed MySQL source package can't
be built with libreadline. Please use --with-libedit to use
the bundled version of libedit instead.])
fi
;;
esac
# if there is no readline, but we want to build with readline, we fail
if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"]
then
AC_MSG_ERROR([This commercially licensed MySQL source package can't
be built with libreadline. Please use --with-libedit to use
the bundled version of libedit instead.])
fi
AC_SUBST(readline_dir)
AC_SUBST(readline_topdir)
@ -3079,15 +2921,6 @@ AC_SUBST(NON_THREADED_LIBS)
AC_SUBST(STATIC_NSS_FLAGS)
AC_SUBST(sql_client_dirs)
# If configuring for NetWare, build the netware directory
netware_dir=
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
then
netware_dir="netware"
fi
AC_SUBST(netware_dir)
AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware")
if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"
then
AC_DEFINE([THREAD], [1],
@ -3140,19 +2973,17 @@ do
done
AC_SUBST(sql_union_dirs)
#
# Setup maintainer mode options by the end to not disturb
# system and other checks.
#
MY_MAINTAINER_MODE_SETUP
# Some usefull subst
AC_SUBST(CC)
AC_SUBST(GXX)
# Set configuration options for make_binary_distribution
case $SYSTEM_TYPE in
*netware*)
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
;;
*)
: # no change for other platforms yet
;;
esac
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
#--------------------------------------------------------------------
@ -3225,8 +3056,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
libmysqld/Makefile libmysqld/examples/Makefile dnl
mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl
netware/Makefile sql-bench/Makefile dnl
include/mysql_version.h plugin/Makefile win/Makefile
sql-bench/Makefile include/mysql_version.h plugin/Makefile win/Makefile dnl
cmake/Makefile
)

0
dbug/CMakeLists.txt Executable file → Normal file
View file

View file

@ -95,7 +95,7 @@
#define fnmatch(A,B,C) strcmp(A,B)
#endif
#if defined(MSDOS) || defined(__WIN__)
#if defined(__WIN__)
#include <process.h>
#endif
@ -302,7 +302,7 @@ static int DoTrace(CODE_STATE *cs);
#define DISABLE_TRACE 4
/* Test to see if file is writable */
#if defined(HAVE_ACCESS) && !defined(MSDOS)
#if defined(HAVE_ACCESS)
static BOOLEAN Writable(const char *pathname);
/* Change file owner and group */
static void ChangeOwner(CODE_STATE *cs, char *pathname);
@ -336,23 +336,19 @@ static unsigned long Clock(void);
#define ERR_OPEN "%s: can't open debug output stream \"%s\": "
#define ERR_CLOSE "%s: can't close debug file: "
#define ERR_ABORT "%s: debugger aborting because %s\n"
#define ERR_CHOWN "%s: can't change owner/group of \"%s\": "
/*
* Macros and defines for testing file accessibility under UNIX and MSDOS.
*/
#undef EXISTS
#if !defined(HAVE_ACCESS) || defined(MSDOS)
#if !defined(HAVE_ACCESS)
#define EXISTS(pathname) (FALSE) /* Assume no existance */
#define Writable(name) (TRUE)
#else
#define EXISTS(pathname) (access(pathname, F_OK) == 0)
#define WRITABLE(pathname) (access(pathname, W_OK) == 0)
#endif
#ifndef MSDOS
#define ChangeOwner(cs,name)
#endif
/*
@ -2008,10 +2004,6 @@ static void DBUGOpenFile(CODE_STATE *cs,
else
{
cs->stack->out_file= fp;
if (newfile)
{
ChangeOwner(cs, name);
}
}
}
}
@ -2069,10 +2061,6 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name)
else
{
cs->stack->prof_file= fp;
if (newfile)
{
ChangeOwner(cs, name);
}
}
}
return fp;
@ -2263,42 +2251,6 @@ static BOOLEAN Writable(const char *pathname)
#endif
/*
* FUNCTION
*
* ChangeOwner change owner to real user for suid programs
*
* SYNOPSIS
*
* static VOID ChangeOwner(pathname)
*
* DESCRIPTION
*
* For unix systems, change the owner of the newly created debug
* file to the real owner. This is strictly for the benefit of
* programs that are running with the set-user-id bit set.
*
* Note that at this point, the fact that pathname represents
* a newly created file has already been established. If the
* program that the debugger is linked to is not running with
* the suid bit set, then this operation is redundant (but
* harmless).
*
*/
#ifndef ChangeOwner
static void ChangeOwner(CODE_STATE *cs, char *pathname)
{
if (chown(pathname, getuid(), getgid()) == -1)
{
(void) fprintf(stderr, ERR_CHOWN, cs->process, pathname);
perror("");
(void) fflush(stderr);
}
}
#endif
/*
* FUNCTION
*
@ -2470,7 +2422,7 @@ static unsigned long Clock()
return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000;
}
#elif defined(MSDOS) || defined(__WIN__)
#elif defined(__WIN__)
static ulong Clock()
{
@ -2519,37 +2471,6 @@ static unsigned long Clock()
#endif /* RUSAGE */
#endif /* THREADS */
#ifdef NO_VARARGS
/*
* Fake vfprintf for systems that don't support it. If this
* doesn't work, you are probably SOL...
*/
static int vfprintf(stream, format, ap)
FILE *stream;
char *format;
va_list ap;
{
int rtnval;
ARGS_DCL;
ARG0= va_arg(ap, ARGS_TYPE);
ARG1= va_arg(ap, ARGS_TYPE);
ARG2= va_arg(ap, ARGS_TYPE);
ARG3= va_arg(ap, ARGS_TYPE);
ARG4= va_arg(ap, ARGS_TYPE);
ARG5= va_arg(ap, ARGS_TYPE);
ARG6= va_arg(ap, ARGS_TYPE);
ARG7= va_arg(ap, ARGS_TYPE);
ARG8= va_arg(ap, ARGS_TYPE);
ARG9= va_arg(ap, ARGS_TYPE);
rtnval= fprintf(stream, format, ARGS_LIST);
return rtnval;
}
#endif /* NO_VARARGS */
#else
/*

View file

@ -561,9 +561,6 @@ FILE *outf;
#define usage() fprintf (DBUG_FILE,"Usage: %s [-v] [prof-file]\n",my_name)
#ifdef MSDOS
extern int getopt(int argc, char **argv, char *opts);
#endif
extern int optind;
extern char *optarg;
@ -609,118 +606,5 @@ int main (int argc, char **argv)
process (infile);
output (outfile);
DBUG_RETURN (EX_OK);
}
}
}
#ifdef MSDOS
/*
* From std-unix@ut-sally.UUCP (Moderator, John Quarterman) Sun Nov 3 14:34:15 1985
* Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site gatech.CSNET
* Posting-Version: version B 2.10.2 9/18/84; site ut-sally.UUCP
* Path: gatech!akgua!mhuxv!mhuxt!mhuxr!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!ut-sally!std-unix
* From: std-unix@ut-sally.UUCP (Moderator, John Quarterman)
* Newsgroups: mod.std.unix
* Subject: public domain AT&T getopt source
* Message-ID: <3352@ut-sally.UUCP>
* Date: 3 Nov 85 19:34:15 GMT
* Date-Received: 4 Nov 85 12:25:09 GMT
* Organization: IEEE/P1003 Portable Operating System Environment Committee
* Lines: 91
* Approved: jsq@ut-sally.UUCP
*
* Here's something you've all been waiting for: the AT&T public domain
* source for getopt(3). It is the code which was given out at the 1985
* UNIFORUM conference in Dallas. I obtained it by electronic mail
* directly from AT&T. The people there assure me that it is indeed
* in the public domain.
*
* There is no manual page. That is because the one they gave out at
* UNIFORUM was slightly different from the current System V Release 2
* manual page. The difference apparently involved a note about the
* famous rules 5 and 6, recommending using white space between an option
* and its first argument, and not grouping options that have arguments.
* Getopt itself is currently lenient about both of these things White
* space is allowed, but not mandatory, and the last option in a group can
* have an argument. That particular version of the man page evidently
* has no official existence, and my source at AT&T did not send a copy.
* The current SVR2 man page reflects the actual behavor of this getopt.
* However, I am not about to post a copy of anything licensed by AT&T.
*
* I will submit this source to Berkeley as a bug fix.
*
* I, personally, make no claims or guarantees of any kind about the
* following source. I did compile it to get some confidence that
* it arrived whole, but beyond that you're on your own.
*
*/
/*LINTLIBRARY*/
int opterr = 1;
int optind = 1;
int optopt;
char *optarg;
static void _ERR(s,c,argv)
char *s;
int c;
char *argv[];
{
char errbuf[3];
if (opterr) {
errbuf[0] = c;
errbuf[1] = '\n';
(void) fprintf(stderr, "%s", argv[0]);
(void) fprintf(stderr, "%s", s);
(void) fprintf(stderr, "%s", errbuf);
}
}
int getopt(argc, argv, opts)
int argc;
char **argv, *opts;
{
static int sp = 1;
register int c;
register char *cp;
if(sp == 1)
if(optind >= argc ||
argv[optind][0] != '-' || argv[optind][1] == '\0')
return(EOF);
else if(strcmp(argv[optind], "--") == 0) {
optind++;
return(EOF);
}
optopt = c = argv[optind][sp];
if(c == ':' || (cp=strchr(opts, c)) == NULL) {
_ERR(": illegal option -- ", c, argv);
if(argv[optind][++sp] == '\0') {
optind++;
sp = 1;
}
return('?');
}
if(*++cp == ':') {
if(argv[optind][sp+1] != '\0')
optarg = &argv[optind++][sp+1];
else if(++optind >= argc) {
_ERR(": option requires an argument -- ", c, argv);
sp = 1;
return('?');
} else
optarg = argv[optind++];
sp = 1;
} else {
if(argv[optind][++sp] == '\0') {
sp = 1;
optind++;
}
optarg = NULL;
}
return(c);
}
#endif /* !unix && !xenix */

0
extra/CMakeLists.txt Executable file → Normal file
View file

View file

@ -665,9 +665,9 @@ static struct message *find_message(struct errors *err, const char *lang,
static ha_checksum checksum_format_specifier(const char* msg)
{
ha_checksum chksum= 0;
const char* p= msg;
const char* start= 0;
int num_format_specifiers= 0;
const uchar* p= (const uchar*) msg;
const uchar* start= NULL;
uint32 num_format_specifiers= 0;
while (*p)
{

View file

@ -89,9 +89,6 @@ static struct my_option my_long_options[] =
};
#include <help_start.h>
static void usage(my_bool version)
{
printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
@ -107,8 +104,6 @@ static void usage(my_bool version)
printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
}
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),

View file

@ -15,8 +15,6 @@
/* Wait until a program dies */
#ifndef __NETWARE__
#include <my_global.h>
#include <m_string.h>
#include <my_sys.h>
@ -103,15 +101,3 @@ void usage(void)
my_print_help(my_long_options);
exit(-1);
}
#else
#include <stdio.h>
main()
{
fprintf(stderr,"This tool has not been ported to NetWare\n");
return 0;
}
#endif /* __NETWARE__ */

View file

@ -102,8 +102,6 @@ static HA_ERRORS ha_errlist[]=
};
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION,
@ -122,8 +120,6 @@ static void usage(void)
my_print_variables(my_long_options);
}
#include <help_end.h>
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
@ -281,7 +277,7 @@ int main(int argc,char *argv[])
#endif
{
/*
On some system, like NETWARE, strerror(unknown_error) returns a
On some system, like Linux, strerror(unknown_error) returns a
string 'Unknown Error'. To avoid printing it we try to find the
error string by asking for an impossible big error message.

View file

@ -648,7 +648,7 @@ static REPLACE *init_replace(char * *from, char * *to,uint count,
for (i=1 ; i <= found_sets ; i++)
{
pos=from[found_set[i-1].table_offset];
rep_str[i].found= (my_bool) (!bcmp(pos,"\\^",3) ? 2 : 1);
rep_str[i].found= (my_bool) (!memcmp(pos,"\\^",3) ? 2 : 1);
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@ -776,8 +776,8 @@ static void copy_bits(REP_SET *to,REP_SET *from)
static int cmp_bits(REP_SET *set1,REP_SET *set2)
{
return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
sizeof(uint) * set1->size_of_bits);
return memcmp(set1->bits, set2->bits,
sizeof(uint) * set1->size_of_bits);
}
@ -849,14 +849,14 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
static uint start_at_word(char * pos)
{
return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
return (((!memcmp(pos,"\\b",2) && pos[2]) || !memcmp(pos,"\\^",2)) ? 1 : 0);
}
static uint end_of_word(char * pos)
{
char * end=strend(pos);
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
return ((end > pos+2 && !memcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !memcmp(end-2,"\\$",2))) ?
1 : 0;
}

View file

@ -65,8 +65,6 @@ static struct my_option my_long_options[] =
static void verify_sort();
#include <help_start.h>
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION,
@ -90,8 +88,6 @@ The numeric-dump-file should contain a numeric stack trace from mysqld.\n\
If the numeric-dump-file is not given, the stack trace is read from stdin.\n");
}
#include <help_end.h>
static void die(const char* fmt, ...)
{

View file

@ -155,11 +155,8 @@ int main(int argc, char **argv)
else
{
printf ("Host name of %s is %s", ip,hpaddr->h_name);
#ifndef __NETWARE__
/* this information is not available on NetWare */
for (q = hpaddr->h_aliases; *q != 0; q++)
(void) printf(", %s", *q);
#endif /* __NETWARE__ */
puts("");
}
}

0
extra/yassl/CMakeLists.txt Executable file → Normal file
View file

View file

@ -34,9 +34,8 @@
#include "openssl/ssl.h" // ASN1_STRING and DH
// Check if _POSIX_THREADS should be forced
#if !defined(_POSIX_THREADS) && (defined(__NETWARE__) || defined(__hpux))
#if !defined(_POSIX_THREADS) && defined(__hpux)
// HPUX does not define _POSIX_THREADS as it's not _fully_ implemented
// Netware supports pthreads but does not announce it
#define _POSIX_THREADS
#endif

View file

@ -953,8 +953,9 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info)
info->set = true;
}
}
fgets(line,sizeof(line), file); // get blank line
begin = ftell(file);
// get blank line
if (fgets(line, sizeof(line), file))
begin = ftell(file);
}
}

View file

@ -37,7 +37,7 @@
#include <fcntl.h>
#endif // _WIN32
#if defined(__sun) || defined(__SCO_VERSION__) || defined(__NETWARE__)
#if defined(__sun) || defined(__SCO_VERSION__)
#include <sys/filio.h>
#endif

0
extra/yassl/taocrypt/CMakeLists.txt Executable file → Normal file
View file

View file

@ -51,7 +51,7 @@ public:
enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 };
Blowfish(CipherDir DIR, Mode MODE)
: Mode_BASE(BLOCK_SIZE, DIR, MODE) {}
: Mode_BASE(BLOCK_SIZE, DIR, MODE), sbox_(pbox_ + ROUNDS + 2) {}
#ifdef DO_BLOWFISH_ASM
void Process(byte*, const byte*, word32);
@ -62,8 +62,8 @@ private:
static const word32 p_init_[ROUNDS + 2];
static const word32 s_init_[4 * 256];
word32 pbox_[ROUNDS + 2];
word32 sbox_[4 * 256];
word32 pbox_[ROUNDS + 2 + 4 * 256];
word32* sbox_;
void crypt_block(const word32 in[2], word32 out[2]) const;
void AsmProcess(const byte* in, byte* out) const;

View file

@ -125,7 +125,7 @@ void CleanUp();
// no gas on these systems ?, disable for now
#if defined(__sun__) || defined (__QNX__) || defined (__APPLE__)
#if defined(__sun__) || defined (__APPLE__)
#define TAOCRYPT_DISABLE_X86ASM
#endif

View file

@ -35,10 +35,7 @@
// Handler for pure virtual functions
namespace __Crun {
static void pure_error(void)
{
assert("Pure virtual method called." == "Aborted");
}
void pure_error(void);
} // namespace __Crun
#endif // __sun
@ -54,16 +51,7 @@ extern "C" {
#else
#include "kernelc.hpp"
#endif
/* Disallow inline __cxa_pure_virtual() */
static int __cxa_pure_virtual() __attribute__((noinline, used));
static int __cxa_pure_virtual()
{
// oops, pure virtual called!
assert(!"Pure virtual method called. Aborted");
return 0;
}
int __cxa_pure_virtual () __attribute__ ((weak));
} // extern "C"
#endif // __GNUC__ > 2

View file

@ -51,7 +51,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
else if (mode_ == CBC)
else if (mode_ == CBC) {
if (dir_ == ENCRYPTION)
while (blocks--) {
r_[0] ^= *(word32*)in;
@ -78,6 +78,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
}
}
#endif // DO_AES_ASM

View file

@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x,
struct WindowSlider
{
WindowSlider(const Integer &exp, bool fastNegate,
WindowSlider(const Integer &expIn, bool fastNegateIn,
unsigned int windowSizeIn=0)
: exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn),
windowBegin(0), fastNegate(fastNegate), firstTime(true),
: exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn),
windowBegin(0), fastNegate(fastNegateIn), firstTime(true),
finished(false)
{
if (windowSize == 0)

View file

@ -53,7 +53,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
else if (mode_ == CBC)
else if (mode_ == CBC) {
if (dir_ == ENCRYPTION)
while (blocks--) {
r_[0] ^= *(word32*)in;
@ -78,6 +78,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
}
}
#endif // DO_BLOWFISH_ASM

View file

@ -283,21 +283,23 @@ DWord() {}
word GetHighHalfAsBorrow() const {return 0-halfs_.high;}
private:
struct dword_struct
{
#ifdef LITTLE_ENDIAN_ORDER
word low;
word high;
#else
word high;
word low;
#endif
};
union
{
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
dword whole_;
#endif
struct
{
#ifdef LITTLE_ENDIAN_ORDER
word low;
word high;
#else
word high;
word low;
#endif
} halfs_;
struct dword_struct halfs_;
};
};
@ -1214,20 +1216,24 @@ public:
#define AS1(x) #x ";"
#define AS2(x, y) #x ", " #y ";"
#define AddPrologue \
word res; \
__asm__ __volatile__ \
( \
"push %%ebx;" /* save this manually, in case of -fPIC */ \
"mov %2, %%ebx;" \
"mov %3, %%ebx;" \
".intel_syntax noprefix;" \
"push ebp;"
#define AddEpilogue \
"pop ebp;" \
".att_syntax prefix;" \
"pop %%ebx;" \
: \
"mov %%eax, %0;" \
: "=g" (res) \
: "c" (C), "d" (A), "m" (B), "S" (N) \
: "%edi", "memory", "cc" \
);
); \
return res;
#define MulPrologue \
__asm__ __volatile__ \
( \

View file

@ -84,12 +84,23 @@ namespace STL = STL_NAMESPACE;
}
#if defined(__ICC) || defined(__INTEL_COMPILER)
#ifdef __sun
// Handler for pure virtual functions
namespace __Crun {
void pure_error() {
assert(!"Aborted: pure virtual method called.");
}
}
#endif
#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2)
extern "C" {
int __cxa_pure_virtual() {
assert("Pure virtual method called." == "Aborted");
assert(!"Aborted: pure virtual method called.");
return 0;
}
@ -166,14 +177,6 @@ word Crop(word value, unsigned int size)
#ifdef TAOCRYPT_X86ASM_AVAILABLE
#ifndef _MSC_VER
static jmp_buf s_env;
static void SigIllHandler(int)
{
longjmp(s_env, 1);
}
#endif
bool HaveCpuId()
{

View file

@ -92,67 +92,6 @@ void OS_Seed::GenerateSeed(byte* output, word32 sz)
}
#elif defined(__NETWARE__)
/* The OS_Seed implementation for Netware */
#include <nks/thread.h>
#include <nks/plat.h>
// Loop on high resulution Read Time Stamp Counter
static void NetwareSeed(byte* output, word32 sz)
{
word32 tscResult;
for (word32 i = 0; i < sz; i += sizeof(tscResult)) {
#if defined(__GNUC__)
asm volatile("rdtsc" : "=A" (tscResult));
#else
#ifdef __MWERKS__
asm {
#else
__asm {
#endif
rdtsc
mov tscResult, eax
}
#endif
memcpy(output, &tscResult, sizeof(tscResult));
output += sizeof(tscResult);
NXThreadYield(); // induce more variance
}
}
OS_Seed::OS_Seed()
{
}
OS_Seed::~OS_Seed()
{
}
void OS_Seed::GenerateSeed(byte* output, word32 sz)
{
/*
Try to use NXSeedRandom as it will generate a strong
seed using the onboard 82802 chip
As it's not always supported, fallback to default
implementation if an error is returned
*/
if (NXSeedRandom(sz, output) != 0)
{
NetwareSeed(output, sz);
}
}
#else
/* The default OS_Seed implementation */

View file

@ -54,7 +54,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
else if (mode_ == CBC)
else if (mode_ == CBC) {
if (dir_ == ENCRYPTION)
while (blocks--) {
r_[0] ^= *(word32*)in;
@ -82,6 +82,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
}
}
#endif // DO_TWOFISH_ASM

View file

@ -32,8 +32,7 @@
#endif /* _WIN32 */
#if !defined(_SOCKLEN_T) && \
(defined(_WIN32) || defined(__NETWARE__) || defined(__APPLE__))
#if !defined(_SOCKLEN_T) && (defined(_WIN32) || defined(__APPLE__))
typedef int socklen_t;
#endif
@ -42,18 +41,14 @@
#if defined(__hpux)
// HPUX uses int* for third parameter to accept
typedef int* ACCEPT_THIRD_T;
#elif defined(__NETWARE__)
// NetWare uses size_t* for third parameter to accept
typedef size_t* ACCEPT_THIRD_T;
#else
typedef socklen_t* ACCEPT_THIRD_T;
#endif
// Check if _POSIX_THREADS should be forced
#if !defined(_POSIX_THREADS) && (defined(__NETWARE__) || defined(__hpux))
#if !defined(_POSIX_THREADS) && defined(__hpux)
// HPUX does not define _POSIX_THREADS as it's not _fully_ implemented
// Netware supports pthreads but does not announce it
#define _POSIX_THREADS
#endif
@ -160,6 +155,11 @@ inline void err_sys(const char* msg)
}
extern "C" {
static int PasswordCallBack(char*, int, int, void*);
}
static int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
{
strncpy(passwd, "12345678", sz);

View file

@ -1,4 +1,4 @@
# Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@ -15,6 +15,8 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
pkgpsiincludedir = $(pkgincludedir)/psi
BUILT_SOURCES = $(HEADERS_GEN_MAKE) link_sources probes_mysql_nodtrace.h
HEADERS_GEN_CONFIGURE = mysql_version.h
HEADERS_GEN_MAKE = my_config.h
@ -25,18 +27,16 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
my_xml.h mysql_embed.h mysql/services.h \
mysql/service_my_snprintf.h mysql/service_thd_alloc.h \
my_pthread.h my_no_pthread.h \
mysql/psi/psi.h mysql/psi/mysql_thread.h \
mysql/psi/mysql_file.h \
decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
$(HEADERS_GEN_MAKE) probes_mysql.h probes_mysql_nodtrace.h
noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
noinst_HEADERS = config-win.h lf.h my_bit.h \
heap.h my_bitmap.h my_uctype.h password.h \
myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h help_start.h help_end.h \
mysys_err.h my_base.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
@ -45,7 +45,10 @@ noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \
atomic/solaris.h mysql/innodb_priv.h
atomic/solaris.h mysql/innodb_priv.h my_compiler.h
pkgpsiinclude_HEADERS = mysql/psi/psi.h mysql/psi/mysql_thread.h \
mysql/psi/mysql_file.h
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp probes_mysql.d.base \
CMakeLists.txt \

View file

@ -1,161 +0,0 @@
/* Copyright (C) 2000 MySQL AB
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 Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Header for NetWare compatible with MySQL */
#ifndef _config_netware_h
#define _config_netware_h
#define __event_h__
#define _EVENT_H_
/*
These two #define(s) are needed as both libc of NetWare and MySQL have
files named event.h which causes compilation errors.
*/
/* required headers */
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <screen.h>
#include <limits.h>
#include <signal.h>
#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
#include <pthread.h>
#include <termios.h>
#undef _EVENT_H_
/*
This #undef exists here because both libc of NetWare and MySQL have
files named event.h which causes compilation errors.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* required adjustments */
#undef HAVE_READDIR_R
#undef HAVE_RWLOCK_INIT
#undef HAVE_SCHED_H
#undef HAVE_SYS_MMAN_H
#undef HAVE_SYNCH_H
#undef HAVE_MMAP
#undef HAVE_RINT
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define HAVE_BROKEN_REALPATH 1
/* changes made to make use of LibC-June-2004 for building purpose */
#undef HAVE_POSIX_SIGNALS
#undef HAVE_PTHREAD_ATTR_SETSCOPE
#undef HAVE_ALLOC_A
#undef HAVE_FINITE
#undef HAVE_GETPWNAM
#undef HAVE_GETPWUID
#undef HAVE_READLINK
#undef HAVE_STPCPY
/* changes end */
/* Changes made to make use of LibC-June-2005 for building purpose */
#undef HAVE_GETPASS
#undef HAVE_GETRLIMIT
#undef HAVE_GETRUSAGE
#undef HAVE_INITGROUPS
/* Changes end - LibC-June-2005 */
/* no libc crypt() function */
#ifdef HAVE_OPENSSL
#define HAVE_CRYPT 1
#else
#undef HAVE_CRYPT
#endif /* HAVE_OPENSSL */
/* Netware has an ancient zlib */
#undef HAVE_COMPRESS
#define HAVE_COMPRESS
#undef HAVE_ARCHIVE_DB
/* include the old function apis */
#define USE_OLD_FUNCTIONS 1
/* no case sensitivity */
#define FN_NO_CASE_SENSE 1
/* the thread alarm is not used */
#define DONT_USE_THR_ALARM 1
/* signals do not interrupt sockets */
#define SIGNALS_DONT_BREAK_READ 1
/* signal by closing the sockets */
#define SIGNAL_WITH_VIO_CLOSE 1
/* On NetWare, stack grows towards lower address */
#define STACK_DIRECTION -1
/* On NetWare, we need to set stack size for threads, otherwise default 16K is used */
#define NW_THD_STACKSIZE 65536
/* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1
#define FN_LIBCHAR '\\'
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
#define DEFAULT_BASEDIR "sys:/"
#define SHAREDIR "share/"
#define DEFAULT_CHARSET_HOME "sys:/mysql/"
#define MYSQL_DATADIR "data/"
/* 64-bit file system calls */
#define SIZEOF_OFF_T 8
#define off_t off64_t
#define chsize chsize64
#define ftruncate ftruncate64
#define lseek lseek64
#define pread pread64
#define pwrite pwrite64
#define tell tell64
/* do not use the extended time in LibC sys\stat.h */
#define _POSIX_SOURCE
/* Some macros for portability */
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time(NULL)+(SEC); (ABSTIME).tv_nsec=0; }
/* extra protection against CPU Hogs on NetWare */
#define NETWARE_YIELD pthread_yield()
/* Screen mode for help texts */
#define NETWARE_SET_SCREEN_MODE(A) setscreenmode(A)
#ifdef __cplusplus
}
#endif
#endif /* _config_netware_h */

View file

@ -185,7 +185,6 @@ typedef SSIZE_T ssize_t;
#define SOCKET_SIZE_TYPE int
#define my_socket_defined
#define byte_defined
#define HUGE_PTR
#define STDCALL __stdcall /* Used by libmysql.dll */
#define isnan(X) _isnan(X)
#define finite(X) _finite(X)

View file

@ -1,26 +0,0 @@
#ifndef HELP_END_INCLUDED
#define HELP_END_INCLUDED
/* Copyright (C) 2004-2005 MySQL AB
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 Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef __NETWARE__
#undef printf
#undef puts
#undef fputs
#undef fputc
#undef putchar
#endif
#endif /* HELP_END_INCLUDED */

View file

@ -1,28 +0,0 @@
#ifndef HELP_START_INCLUDED
#define HELP_START_INCLUDED
/* Copyright (C) 2004-2005 MySQL AB
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 Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Divert all help information on NetWare to logger screen. */
#ifdef __NETWARE__
#define printf consoleprintf
#define puts(s) consoleprintf("%s\n",s)
#define fputs(s,f) puts(s)
#define fputc(s,f) consoleprintf("%c", s)
#define putchar(s) consoleprintf("%c", s)
#endif
#endif /* HELP_START_INCLUDED */

View file

@ -36,10 +36,6 @@
/* need by my_vsnprintf */
#include <stdarg.h>
#ifdef _AIX
#undef HAVE_BCMP
#endif
/* This is needed for the definitions of bzero... on solaris */
#if defined(HAVE_STRINGS_H)
#include <strings.h>
@ -63,14 +59,10 @@
/* Unixware 7 */
#if !defined(HAVE_BFILL)
# define bfill(A,B,C) memset((A),(C),(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif
#if !defined(HAVE_BCMP)
# define bcopy(s, d, n) memcpy((d), (s), (n))
# define bcmp(A,B,C) memcmp((A),(B),(C))
# define bzero(A,B) memset((A),0,(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#if !defined(bzero) && !defined(HAVE_BZERO)
# define bzero(A,B) memset((A),0,(B))
#endif
#if defined(__cplusplus)
@ -92,8 +84,8 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
#endif
/* Declared in int2str() */
extern char NEAR _dig_vec_upper[];
extern char NEAR _dig_vec_lower[];
extern char _dig_vec_upper[];
extern char _dig_vec_lower[];
#ifndef strmov
#define strmov_overlapp(A,B) strmov(A,B)
@ -116,19 +108,6 @@ extern char NEAR _dig_vec_lower[];
extern void bfill(uchar *dst,size_t len,pchar fill);
#endif
#if !defined(bzero) && !defined(HAVE_BZERO)
extern void bzero(uchar * dst,size_t len);
#endif
#if !defined(bcmp) && !defined(HAVE_BCMP)
extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
#endif
#ifdef HAVE_purify
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
#endif /* HAVE_purify */
#ifndef bmove512
extern void bmove512(uchar *dst,const uchar *src,size_t len);
#endif
@ -156,15 +135,15 @@ extern char *strmov(char *dst,const char *src);
#else
extern char *strmov_overlapp(char *dst,const char *src);
#endif
extern char *strnmov(char *dst,const char *src,size_t n);
extern char *strsuff(const char *src,const char *suffix);
extern char *strcont(const char *src,const char *set);
extern char *strxcat _VARARGS((char *dst,const char *src, ...));
extern char *strxmov _VARARGS((char *dst,const char *src, ...));
extern char *strxcpy _VARARGS((char *dst,const char *src, ...));
extern char *strxncat _VARARGS((char *dst,size_t len, const char *src, ...));
extern char *strxnmov _VARARGS((char *dst,size_t len, const char *src, ...));
extern char *strxncpy _VARARGS((char *dst,size_t len, const char *src, ...));
extern char *strnmov(char *dst, const char *src, size_t n);
extern char *strsuff(const char *src, const char *suffix);
extern char *strcont(const char *src, const char *set);
extern char *strxcat(char *dst, const char *src, ...);
extern char *strxmov(char *dst, const char *src, ...);
extern char *strxcpy(char *dst, const char *src, ...);
extern char *strxncat(char *dst, size_t len, const char *src, ...);
extern char *strxnmov(char *dst, size_t len, const char *src, ...);
extern char *strxncpy(char *dst, size_t len, const char *src, ...);
/* Prototypes of normal stringfunctions (with may ours) */

View file

@ -36,14 +36,14 @@ extern ulong my_time_to_wait_for_lock;
#define ALARM_END (void) signal(SIGALRM,alarm_signal); \
(void) alarm(alarm_old);
#define ALARM_TEST my_have_got_alarm
#ifdef DONT_REMEMBER_SIGNAL
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
#define ALARM_REINIT (void) alarm(MY_HOW_OFTEN_TO_ALARM); \
(void) signal(SIGALRM,my_set_alarm_variable);\
my_have_got_alarm=0;
#else
#define ALARM_REINIT (void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \
my_have_got_alarm=0;
#endif /* DONT_REMEMBER_SIGNAL */
#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */
#else
#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
#define ALARM_INIT

View file

@ -159,22 +159,6 @@ static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
#define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
/**
check, set and clear a bit of interest of an integer.
If the bit is out of range @retval -1. Otherwise
bit_is_set @return 0 or 1 reflecting the bit is set or not;
bit_do_set @return 1 (bit is set 1)
bit_do_clear @return 0 (bit is cleared to 0)
*/
#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
(((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
((I) |= (ULL(1) << (B)), 1) : -1)
#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
((I) &= ~(ULL(1) << (B)), 0) : -1)
#ifdef __cplusplus
}
#endif

129
include/my_compiler.h Normal file
View file

@ -0,0 +1,129 @@
#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
/* Copyright (c) 2010, 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 Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
Header for compiler-dependent features.
Intended to contain a set of reusable wrappers for preprocessor
macros, attributes, pragmas, and any other features that are
specific to a target compiler.
*/
#include <my_global.h> /* stddef.h offsetof */
/**
Compiler-dependent internal convenience macros.
*/
/* GNU C/C++ */
#if defined __GNUC__
/* Any after 2.95... */
# define MY_ALIGN_EXT
/* Microsoft Visual C++ */
#elif defined _MSC_VER
# define MY_ALIGNOF(type) __alignof(type)
# define MY_ALIGNED(n) __declspec(align(n))
/* Oracle Solaris Studio */
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if __SUNPRO_C >= 0x590
# define MY_ALIGN_EXT
# endif
/* IBM XL C/C++ */
#elif defined __xlC__
# if __xlC__ >= 0x0600
# define MY_ALIGN_EXT
# endif
/* HP aCC */
#elif defined(__HP_aCC) || defined(__HP_cc)
# if (__HP_aCC >= 60000) || (__HP_cc >= 60000)
# define MY_ALIGN_EXT
# endif
#endif
#ifdef MY_ALIGN_EXT
/** Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type) __alignof__(type)
/** Determine the alignment requirement of a type. */
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
#endif
/**
Generic compiler-dependent features.
*/
#ifndef MY_ALIGNOF
# ifdef __cplusplus
template<typename type> struct my_alignof_helper { char m1; type m2; };
/* Invalid for non-POD types, but most compilers give the right answer. */
# define MY_ALIGNOF(type) offsetof(my_alignof_helper<type>, m2)
# else
# define MY_ALIGNOF(type) offsetof(struct { char m1; type m2; }, m2)
# endif
#endif
/**
C++ Type Traits
*/
#ifdef __cplusplus
/**
Opaque storage with a particular alignment.
*/
# if defined(MY_ALIGNED)
/* Partial specialization used due to MSVC++. */
template<size_t alignment> struct my_alignment_imp;
template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
/* ... expand as necessary. */
# else
template<size_t alignment>
struct my_alignment_imp { double m1; };
# endif
/**
A POD type with a given size and alignment.
@remark If the compiler does not support a alignment attribute
(MY_ALIGN macro), the default alignment of a double is
used instead.
@tparam size The minimum size.
@tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
*/
template <size_t size, size_t alignment>
struct my_aligned_storage
{
union
{
char data[size];
my_alignment_imp<alignment> align;
};
};
#endif /* __cplusplus */
#include <my_attribute.h>
#endif /* MY_COMPILER_INCLUDED */

View file

@ -45,7 +45,7 @@ extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
struct _db_stack_frame_ *_stack_frame_);
extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...))
extern void _db_doprnt_(const char *format,...)
ATTRIBUTE_FORMAT(printf, 1, 2);
extern void _db_dump_(uint _line_,const char *keyword,
const unsigned char *memory, size_t length);

View file

@ -46,15 +46,6 @@
#define HAVE_ERRNO_AS_DEFINE
#endif /* __CYGWIN__ */
#if defined(__QNXNTO__) && !defined(FD_SETSIZE)
#define FD_SETSIZE 1024 /* Max number of file descriptor bits in
fd_set, used when calling 'select'
Must be defined before including
"sys/select.h" and "sys/time.h"
*/
#endif
/* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */
#ifdef USE_PRAGMA_IMPLEMENTATION
#define USE_PRAGMA_INTERFACE
@ -82,20 +73,7 @@
#define CPP_UNNAMED_NS_END }
#endif
#if defined(_WIN32)
#include <my_config.h>
#elif defined(__NETWARE__)
#include <my_config.h>
#include <config-netware.h>
#if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */
#endif
#else
#include <my_config.h>
#if defined(__cplusplus) && defined(inline)
#undef inline /* fix configure problem */
#endif
#endif /* _WIN32... */
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
#define HAVE_PSI_INTERFACE
@ -108,12 +86,6 @@
#define IF_WIN(A,B) B
#endif
#ifdef __NETWARE__
#define IF_NETWARE(A,B) A
#else
#define IF_NETWARE(A,B) B
#endif
#ifndef DBUG_OFF
#define IF_DBUG(A,B) A
#else
@ -143,12 +115,6 @@
#define HAVE_EXTERNAL_CLIENT
#endif
/* Some defines to avoid ifdefs in the code */
#ifndef NETWARE_YIELD
#define NETWARE_YIELD
#define NETWARE_SET_SCREEN_MODE(A)
#endif
#if defined (_WIN32)
/*
off_t is 32 bit long. We do not use C runtime functions
@ -591,22 +557,6 @@ C_MODE_END
extern "C" int madvise(void *addr, size_t len, int behav);
#endif
#ifdef __QNXNTO__
/* This has to be after include limits.h */
#define HAVE_ERRNO_AS_DEFINE
#define HAVE_FCNTL_LOCK
#undef HAVE_FINITE
#undef LONGLONG_MIN /* These get wrongly defined in QNX 6.2 */
#undef LONGLONG_MAX /* standard system library 'limits.h' */
#ifdef __cplusplus
#ifndef HAVE_RINT
#define HAVE_RINT
#endif /* rint() and isnan() functions are not */
#define rint(a) std::rint(a) /* visible in C++ scope due to an error */
#define isnan(a) std::isnan(a) /* in the usr/include/math.h on QNX */
#endif
#endif
/* We can not live without the following defines */
#define USE_MYFUNC 1 /* Must use syscall indirection */
@ -627,26 +577,34 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#endif
/* Does the system remember a signal handler after a signal ? */
#ifndef HAVE_BSD_SIGNALS
#define DONT_REMEMBER_SIGNAL
#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
#define SIGNAL_HANDLER_RESET_ON_DELIVERY
#endif
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
#define LINT_INIT(var) var=0 /* No uninitialize-warning */
/*
Deprecated workaround for false-positive uninitialized variables
warnings. Those should be silenced using tool-specific heuristics.
Enabled by default for g++ due to the bug referenced below.
*/
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
(defined(__GNUC__) && defined(__cplusplus))
#define LINT_INIT(var) var= 0
#else
#define LINT_INIT(var)
#endif
/*
/*
Suppress uninitialized variable warning without generating code.
The _cplusplus is a temporary workaround for C++ code pending a fix
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
*/
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) || \
!defined(__GNUC__)
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
defined(__cplusplus) || !defined(__GNUC__)
#define UNINIT_VAR(x) x= 0
#else
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x
#endif
@ -670,7 +628,6 @@ typedef unsigned short ushort;
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
/* Define some general constants */
@ -691,7 +648,7 @@ typedef unsigned short ushort;
#define my_const_cast(A) (A)
#endif
#include <my_attribute.h>
#include <my_compiler.h>
/*
Wen using the embedded library, users might run into link problems,
@ -704,16 +661,6 @@ int __cxa_pure_virtual () __attribute__ ((weak));
C_MODE_END
#endif
/* From old s-system.h */
/*
Support macros for non ansi & other old compilers. Since such
things are no longer supported we do nothing. We keep then since
some of our code may still be needed to upgrade old customers.
*/
#define _VARARGS(X) X
#define _STATIC_VARARGS(X) X
/* The DBUG_ON flag always takes precedence over default DBUG_OFF */
#if defined(DBUG_ON) && defined(DBUG_OFF)
#undef DBUG_OFF
@ -729,7 +676,6 @@ C_MODE_END
#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
#define ASCII_BITS_USED 8 /* Bit char used */
#define NEAR_F /* No near function handling */
/* Some types that is different between systems */
@ -1073,20 +1019,6 @@ typedef long long my_ptrdiff_t;
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
#ifdef __cplusplus
template <size_t sz> struct Aligned_char_array
{
union {
void *v; // Ensures alignment.
char arr[sz]; // The actual buffer.
} u;
void* arr() { return &u.arr[0]; }
};
#endif /* __cplusplus */
/*
Custom version of standard offsetof() macro which can be used to get
offsets of members in class for non-POD types (according to the current
@ -1103,14 +1035,6 @@ template <size_t sz> struct Aligned_char_array
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
#define NullS (char *) 0
/* Nowdays we do not support MessyDos */
#ifndef NEAR
#define NEAR /* Who needs segments ? */
#define FAR /* On a good machine */
#ifndef HUGE_PTR
#define HUGE_PTR
#endif
#endif
#ifdef STDCALL
#undef STDCALL
@ -1622,17 +1546,6 @@ do { doubleget_union _tmp; \
#endif /* WORDS_BIGENDIAN */
/* sprintf does not always return the number of bytes :- */
#ifdef SPRINTF_RETURNS_INT
#define my_sprintf(buff,args) sprintf args
#else
#ifdef SPRINTF_RETURNS_PTR
#define my_sprintf(buff,args) ((int)(sprintf args - buff))
#else
#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff))
#endif
#endif
#ifndef THREAD
#define thread_safe_increment(V,L) (V)++
#define thread_safe_decrement(V,L) (V)--
@ -1677,25 +1590,12 @@ do { doubleget_union _tmp; \
#endif
#ifndef __NETWARE__
/*
* Include standard definitions of operator new and delete.
*/
#ifdef __cplusplus
#include <new>
#endif
#else
/*
* Define placement versions of operator new and operator delete since
* we don't have <new> when building for Netware.
*/
#ifdef __cplusplus
inline void *operator new(size_t, void *ptr) { return ptr; }
inline void *operator new[](size_t, void *ptr) { return ptr; }
inline void operator delete(void*, void*) { /* Do nothing */ }
inline void operator delete[](void*, void*) { /* Do nothing */ }
#endif
#endif
/* Length of decimal number represented by INT32. */
#define MY_INT32_NUM_DECIMAL_DIGITS 11

View file

@ -46,7 +46,7 @@ C_MODE_START
#include <sys/ioctl.h>
#endif
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__NETWARE__)
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>

View file

@ -195,11 +195,6 @@ int pthread_cancel(pthread_t thread);
#include <synch.h>
#endif
#ifdef __NETWARE__
void my_pthread_exit(void *status);
#define pthread_exit(A) my_pthread_exit(A)
#endif
#define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
@ -356,7 +351,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
#define HAVE_PTHREAD_KILL
#endif
@ -461,10 +456,6 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
/* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
#define SAFE_MUTEX_DETECT_DESTROY
#endif
typedef struct st_safe_mutex_t
{
pthread_mutex_t global,mutex;

View file

@ -32,9 +32,7 @@
#define HAVE_STACKTRACE 1
#endif
#if !defined(__NETWARE__)
#define HAVE_WRITE_CORE
#endif
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \

View file

@ -42,7 +42,7 @@ typedef struct my_aio_result {
#endif /* HAVE_VALGRIND */
#ifndef THREAD
extern int NEAR my_errno; /* Last error in mysys */
extern int my_errno; /* Last error in mysys */
#else
#include <my_pthread.h>
#endif
@ -214,7 +214,7 @@ extern int errno; /* declare errno */
#endif /* #ifndef errno */
extern char *home_dir; /* Home directory for user */
extern const char *my_progname; /* program-name (printed in errors) */
extern char NEAR curr_dir[]; /* Current directory for user */
extern char curr_dir[]; /* Current directory for user */
extern void (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags);
@ -247,17 +247,16 @@ extern void (*my_sigtstp_cleanup)(void),
(*my_sigtstp_restart)(void),
(*my_abort_hook)(int);
/* Executed when comming from shell */
extern MYSQL_PLUGIN_IMPORT int NEAR my_umask; /* Default creation mask */
extern int NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */
extern my_bool NEAR my_use_symdir;
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
extern int my_umask_dir,
my_recived_signals, /* Signals we have got */
my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
my_dont_interrupt; /* call remember_intr when set */
extern my_bool my_use_symdir;
extern ulong my_default_record_cache_size;
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks;
extern my_bool my_disable_locking, my_disable_async_io,
my_disable_flush_key_blocks, my_disable_symlinks;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
/* from default.c */
@ -650,10 +649,10 @@ extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_sync(File fd, myf my_flags);
extern int my_sync_dir(const char *dir_name, myf my_flags);
extern int my_sync_dir_by_file(const char *file_name, myf my_flags);
extern void my_error _VARARGS((int nr,myf MyFlags, ...));
extern void my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...))
ATTRIBUTE_FORMAT(printf, 2, 4);
extern void my_error(int nr,myf MyFlags, ...);
extern void my_printf_error(uint my_err, const char *format,
myf MyFlags, ...)
ATTRIBUTE_FORMAT(printf, 2, 4);
extern void my_printv_error(uint error, const char *format, myf MyFlags,
va_list ap);
extern int my_error_register(const char** (*get_errmsgs) (),
@ -913,10 +912,7 @@ extern int my_getncpus();
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
#ifndef __NETWARE__
#define HAVE_MMAP
#endif
void *my_mmap(void *, size_t, int, int, int, my_off_t);
int my_munmap(void *, size_t);
#endif
@ -981,10 +977,6 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
char* my_cgets(char *string, size_t clen, size_t* plen);
#endif
#ifdef __NETWARE__
void netware_reg_user(const char *ip, const char *user,
const char *application);
#endif
#include <mysql/psi/psi.h>

View file

@ -35,8 +35,6 @@ extern uchar days_in_month[];
Using the system built in time_t is not an option as
we rely on the above requirements in the time functions
For example QNX has an unsigned time_t type
*/
typedef long my_time_t;

View file

@ -55,8 +55,6 @@ extern "C" {
#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
#define MI_NAME_IEXT ".MYI"
#define MI_NAME_DEXT ".MYD"
/* Max extra space to use when sorting keys */
#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
/* Possible values for myisam_block_size (must be power of 2) */
#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */

View file

@ -79,10 +79,6 @@ extern char *mysql_unix_port;
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
#ifdef __NETWARE__
#pragma pack(push, 8) /* 8 byte alignment */
#endif
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
#define IS_BLOB(n) ((n) & BLOB_FLAG)
@ -746,10 +742,6 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
0, arg, length, 1, stmt)
#ifdef __NETWARE__
#pragma pack(pop) /* restore alignment */
#endif
#ifdef __cplusplus
}
#endif

View file

@ -506,9 +506,10 @@ inline_mysql_file_fgets(
char *result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_READ);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line);
@ -532,9 +533,10 @@ inline_mysql_file_fgetc(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_READ);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
@ -558,10 +560,11 @@ inline_mysql_file_fputs(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
size_t bytes= 0;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE);
if (likely(locker != NULL))
{
@ -588,9 +591,10 @@ inline_mysql_file_fputc(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line);
@ -614,9 +618,10 @@ inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...)
va_list args;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__);
@ -642,9 +647,10 @@ inline_mysql_file_vfprintf(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -668,9 +674,10 @@ inline_mysql_file_fflush(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_FLUSH);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -700,9 +707,10 @@ inline_mysql_file_fstat(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(filenr,
locker= PSI_server->get_thread_file_descriptor_locker(&state, filenr,
PSI_FILE_FSTAT);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -726,9 +734,11 @@ inline_mysql_file_stat(
MY_STAT *result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_STAT,
locker= PSI_server->get_thread_file_name_locker(&state,
key, PSI_FILE_STAT,
path, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -752,9 +762,10 @@ inline_mysql_file_chsize(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file,
locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_CHSIZE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) newlength, src_file,
@ -784,10 +795,11 @@ inline_mysql_file_fopen(
{
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker
(key, PSI_FILE_STREAM_OPEN, filename, that);
(&state, key, PSI_FILE_STREAM_OPEN, filename, that);
if (likely(locker != NULL))
that->m_psi= PSI_server->start_file_open_wait(locker, src_file,
src_line);
@ -820,10 +832,11 @@ inline_mysql_file_fclose(
{
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
DBUG_ASSERT(file != NULL);
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_STREAM_CLOSE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -849,9 +862,10 @@ inline_mysql_file_fread(
size_t result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_READ);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -882,9 +896,10 @@ inline_mysql_file_fwrite(
size_t result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_WRITE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -915,9 +930,10 @@ inline_mysql_file_fseek(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_SEEK);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -941,9 +957,10 @@ inline_mysql_file_ftell(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server && file->m_psi))
{
locker= PSI_server->get_thread_file_stream_locker(file->m_psi,
locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi,
PSI_FILE_TELL);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -967,9 +984,10 @@ inline_mysql_file_create(
File file;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_CREATE,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_CREATE,
filename, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -1014,9 +1032,10 @@ inline_mysql_file_open(
File file;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_OPEN,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_OPEN,
filename, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -1040,9 +1059,10 @@ inline_mysql_file_close(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file,
locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_CLOSE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1066,9 +1086,10 @@ inline_mysql_file_read(
size_t result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file,
locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_READ);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -1099,9 +1120,10 @@ inline_mysql_file_write(
size_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file,
locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_WRITE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -1132,9 +1154,10 @@ inline_mysql_file_pread(
size_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_READ);
locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_READ);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
}
@ -1164,9 +1187,10 @@ inline_mysql_file_pwrite(
size_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file,
locker= PSI_server->get_thread_file_descriptor_locker(&state, file,
PSI_FILE_WRITE);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, count, src_file, src_line);
@ -1197,9 +1221,10 @@ inline_mysql_file_seek(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_SEEK);
locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_SEEK);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
}
@ -1222,9 +1247,10 @@ inline_mysql_file_tell(
my_off_t result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(file, PSI_FILE_TELL);
locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_TELL);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
}
@ -1247,9 +1273,10 @@ inline_mysql_file_delete(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_DELETE,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE,
name, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1273,9 +1300,10 @@ inline_mysql_file_rename(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_RENAME,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_RENAME,
to, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1300,9 +1328,10 @@ inline_mysql_file_create_with_symlink(
File file;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_CREATE,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_CREATE,
filename, &locker);
if (likely(locker != NULL))
PSI_server->start_file_open_wait(locker, src_file, src_line);
@ -1327,9 +1356,10 @@ inline_mysql_file_delete_with_symlink(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_DELETE,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE,
name, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1353,9 +1383,10 @@ inline_mysql_file_rename_with_symlink(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_name_locker(key, PSI_FILE_RENAME,
locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_RENAME,
to, &locker);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
@ -1379,9 +1410,10 @@ inline_mysql_file_sync(
int result= 0;
#ifdef HAVE_PSI_INTERFACE
struct PSI_file_locker *locker= NULL;
PSI_file_locker_state state;
if (likely(PSI_server != NULL))
{
locker= PSI_server->get_thread_file_descriptor_locker(fd, PSI_FILE_SYNC);
locker= PSI_server->get_thread_file_descriptor_locker(&state, fd, PSI_FILE_SYNC);
if (likely(locker != NULL))
PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line);
}

View file

@ -625,9 +625,10 @@ static inline int inline_mysql_mutex_lock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_mutex_locker *locker= NULL;
PSI_mutex_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_mutex_locker(that->m_psi, PSI_MUTEX_LOCK);
locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_LOCK);
if (likely(locker != NULL))
PSI_server->start_mutex_wait(locker, src_file, src_line);
}
@ -654,9 +655,10 @@ static inline int inline_mysql_mutex_trylock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_mutex_locker *locker= NULL;
PSI_mutex_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_mutex_locker(that->m_psi, PSI_MUTEX_TRYLOCK);
locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_TRYLOCK);
if (likely(locker != NULL))
PSI_server->start_mutex_wait(locker, src_file, src_line);
}
@ -682,13 +684,8 @@ static inline int inline_mysql_mutex_unlock(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_mutex(thread, that->m_psi);
}
PSI_server->unlock_mutex(that->m_psi);
#endif
#ifdef SAFE_MUTEX
result= safe_mutex_unlock(&that->m_mutex, src_file, src_line);
@ -771,9 +768,10 @@ static inline int inline_mysql_rwlock_rdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_READLOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -798,9 +796,10 @@ static inline int inline_mysql_prlock_rdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_READLOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -825,9 +824,10 @@ static inline int inline_mysql_rwlock_wrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_WRITELOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -852,9 +852,10 @@ static inline int inline_mysql_prlock_wrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_WRITELOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -879,9 +880,10 @@ static inline int inline_mysql_rwlock_tryrdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_TRYREADLOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -906,9 +908,10 @@ static inline int inline_mysql_prlock_tryrdlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_TRYREADLOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_rdwait(locker, src_file, src_line);
@ -933,9 +936,10 @@ static inline int inline_mysql_rwlock_trywrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_TRYWRITELOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -960,9 +964,10 @@ static inline int inline_mysql_prlock_trywrlock(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_rwlock_locker *locker= NULL;
PSI_rwlock_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_rwlock_locker(that->m_psi,
locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi,
PSI_RWLOCK_TRYWRITELOCK);
if (likely(locker != NULL))
PSI_server->start_rwlock_wrwait(locker, src_file, src_line);
@ -982,13 +987,8 @@ static inline int inline_mysql_rwlock_unlock(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_rwlock(thread, that->m_psi);
}
PSI_server->unlock_rwlock(that->m_psi);
#endif
result= rw_unlock(&that->m_rwlock);
return result;
@ -1000,13 +1000,8 @@ static inline int inline_mysql_prlock_unlock(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->unlock_rwlock(thread, that->m_psi);
}
PSI_server->unlock_rwlock(that->m_psi);
#endif
result= rw_pr_unlock(&that->m_prlock);
return result;
@ -1053,9 +1048,10 @@ static inline int inline_mysql_cond_wait(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_cond_locker *locker= NULL;
PSI_cond_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_cond_locker(that->m_psi, mutex->m_psi,
locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi,
PSI_COND_WAIT);
if (likely(locker != NULL))
PSI_server->start_cond_wait(locker, src_file, src_line);
@ -1081,9 +1077,10 @@ static inline int inline_mysql_cond_timedwait(
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_cond_locker *locker= NULL;
PSI_cond_locker_state state;
if (likely(PSI_server && that->m_psi))
{
locker= PSI_server->get_thread_cond_locker(that->m_psi, mutex->m_psi,
locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi,
PSI_COND_TIMEDWAIT);
if (likely(locker != NULL))
PSI_server->start_cond_wait(locker, src_file, src_line);
@ -1102,13 +1099,8 @@ static inline int inline_mysql_cond_signal(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->signal_cond(thread, that->m_psi);
}
PSI_server->signal_cond(that->m_psi);
#endif
result= pthread_cond_signal(&that->m_cond);
return result;
@ -1119,13 +1111,8 @@ static inline int inline_mysql_cond_broadcast(
{
int result;
#ifdef HAVE_PSI_INTERFACE
struct PSI_thread *thread;
if (likely(PSI_server && that->m_psi))
{
thread= PSI_server->get_thread();
if (likely(thread != NULL))
PSI_server->broadcast_cond(thread, that->m_psi);
}
PSI_server->broadcast_cond(that->m_psi);
#endif
result= pthread_cond_broadcast(&that->m_cond);
return result;

View file

@ -422,6 +422,175 @@ struct PSI_file_info_v1
int m_flags;
};
/**
State data storage for @c get_thread_mutex_locker_v1_t.
This structure provide temporary storage to a mutex locker.
The content of this structure is considered opaque,
the fields are only hints of what an implementation
of the psi interface can use.
This memory is provided by the instrumented code for performance reasons.
@sa get_thread_mutex_locker_v1_t
*/
struct PSI_mutex_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current mutex. */
struct PSI_mutex *m_mutex;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
ulonglong (*m_timer)(void);
/** Current operation. */
enum PSI_mutex_operation m_operation;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
void *m_wait;
};
/**
State data storage for @c get_thread_rwlock_locker_v1_t.
This structure provide temporary storage to a rwlock locker.
The content of this structure is considered opaque,
the fields are only hints of what an implementation
of the psi interface can use.
This memory is provided by the instrumented code for performance reasons.
@sa get_thread_rwlock_locker_v1_t
*/
struct PSI_rwlock_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current rwlock. */
struct PSI_rwlock *m_rwlock;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
ulonglong (*m_timer)(void);
/** Current operation. */
enum PSI_rwlock_operation m_operation;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
void *m_wait;
};
/**
State data storage for @c get_thread_cond_locker_v1_t.
This structure provide temporary storage to a condition locker.
The content of this structure is considered opaque,
the fields are only hints of what an implementation
of the psi interface can use.
This memory is provided by the instrumented code for performance reasons.
@sa get_thread_cond_locker_v1_t
*/
struct PSI_cond_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current condition. */
struct PSI_cond *m_cond;
/** Current mutex. */
struct PSI_mutex *m_mutex;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
ulonglong (*m_timer)(void);
/** Current operation. */
enum PSI_cond_operation m_operation;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
void *m_wait;
};
/**
State data storage for @c get_thread_file_name_locker_v1_t.
This structure provide temporary storage to a file locker.
The content of this structure is considered opaque,
the fields are only hints of what an implementation
of the psi interface can use.
This memory is provided by the instrumented code for performance reasons.
@sa get_thread_file_name_locker_v1_t
@sa get_thread_file_stream_locker_v1_t
@sa get_thread_file_descriptor_locker_v1_t
*/
struct PSI_file_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current file. */
struct PSI_file *m_file;
/** Current thread. */
struct PSI_thread *m_thread;
/** Operation number of bytes. */
size_t m_number_of_bytes;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
ulonglong (*m_timer)(void);
/** Current operation. */
enum PSI_file_operation m_operation;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
void *m_wait;
};
/**
State data storage for @c get_thread_table_locker_v1_t.
This structure provide temporary storage to a table locker.
The content of this structure is considered opaque,
the fields are only hints of what an implementation
of the psi interface can use.
This memory is provided by the instrumented code for performance reasons.
@sa get_thread_table_locker_v1_t
*/
struct PSI_table_locker_state_v1
{
/** Internal state. */
uint m_flags;
/** Current table handle. */
struct PSI_table *m_table;
/** Current table share. */
struct PSI_table_share *m_table_share;
/** Instrumentation class. */
void *m_class;
/** Current thread. */
struct PSI_thread *m_thread;
/** Timer start. */
ulonglong m_timer_start;
/** Timer function. */
ulonglong (*m_timer)(void);
/* Current operation (waiting for WL#4895). */
/* enum PSI_table_operation m_operation; */
/** Current table io index. */
uint m_index;
/** Current table lock index. */
uint m_lock_index;
/** Source file. */
const char* m_src_file;
/** Source line number. */
int m_src_line;
/** Internal data. */
void *m_wait;
};
/* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */
/**
@ -619,40 +788,51 @@ typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
/**
Get a mutex instrumentation locker.
@param state data storage for the locker
@param mutex the instrumented mutex to lock
@return a mutex locker, or NULL
*/
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
(struct PSI_mutex *mutex, enum PSI_mutex_operation op);
(struct PSI_mutex_locker_state_v1 *state,
struct PSI_mutex *mutex,
enum PSI_mutex_operation op);
/**
Get a rwlock instrumentation locker.
@param state data storage for the locker
@param rwlock the instrumented rwlock to lock
@return a rwlock locker, or NULL
*/
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
(struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op);
(struct PSI_rwlock_locker_state_v1 *state,
struct PSI_rwlock *rwlock,
enum PSI_rwlock_operation op);
/**
Get a cond instrumentation locker.
@param state data storage for the locker
@param cond the instrumented condition to wait on
@param mutex the instrumented mutex associated with the condition
@return a condition locker, or NULL
*/
typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t)
(struct PSI_cond *cond, struct PSI_mutex *mutex,
(struct PSI_cond_locker_state_v1 *state,
struct PSI_cond *cond, struct PSI_mutex *mutex,
enum PSI_cond_operation op);
/**
Get a table instrumentation locker.
@param state data storage for the locker
@param table the instrumented table to lock
@return a table locker, or NULL
*/
typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t)
(struct PSI_table *table);
(struct PSI_table_locker_state_v1 *state,
struct PSI_table *table);
/**
Get a file instrumentation locker, for opening or creating a file.
@param state data storage for the locker
@param key the file instrumentation key
@param op the operation to perform
@param name the file name
@ -660,58 +840,59 @@ typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t)
@return a file locker, or NULL
*/
typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
(PSI_file_key key, enum PSI_file_operation op, const char *name,
(struct PSI_file_locker_state_v1 *state,
PSI_file_key key, enum PSI_file_operation op, const char *name,
const void *identity);
/**
Get a file stream instrumentation locker.
@param state data storage for the locker
@param file the file stream to access
@param op the operation to perform
@return a file locker, or NULL
*/
typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t)
(struct PSI_file *file, enum PSI_file_operation op);
(struct PSI_file_locker_state_v1 *state,
struct PSI_file *file, enum PSI_file_operation op);
/**
Get a file instrumentation locker.
@param state data storage for the locker
@param file the file descriptor to access
@param op the operation to perform
@return a file locker, or NULL
*/
typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t)
(File file, enum PSI_file_operation op);
(struct PSI_file_locker_state_v1 *state,
File file, enum PSI_file_operation op);
/**
Record a mutex instrumentation unlock event.
@param thread the running thread instrumentation
@param mutex the mutex instrumentation
*/
typedef void (*unlock_mutex_v1_t)
(struct PSI_thread *thread, struct PSI_mutex *mutex);
(struct PSI_mutex *mutex);
/**
Record a rwlock instrumentation unlock event.
@param thread the running thread instrumentation
@param rwlock the rwlock instrumentation
*/
typedef void (*unlock_rwlock_v1_t)
(struct PSI_thread *thread, struct PSI_rwlock *rwlock);
(struct PSI_rwlock *rwlock);
/**
Record a condition instrumentation signal event.
@param thread the running thread instrumentation
@param cond the cond instrumentation
*/
typedef void (*signal_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
/**
Record a condition instrumentation broadcast event.
@param thread the running thread instrumentation
@param cond the cond instrumentation
*/
typedef void (*broadcast_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
/**
Record a mutex instrumentation wait start event.
@ -1013,6 +1194,36 @@ struct PSI_file_info_v2
int placeholder;
};
struct PSI_mutex_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_rwlock_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_cond_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_file_locker_state_v2
{
/** Placeholder */
int placeholder;
};
struct PSI_table_locker_state_v2
{
/** Placeholder */
int placeholder;
};
/** @} (end of group Group_PSI_v2) */
#endif /* HAVE_PSI_2 */
@ -1056,6 +1267,11 @@ typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
typedef struct PSI_cond_info_v1 PSI_cond_info;
typedef struct PSI_thread_info_v1 PSI_thread_info;
typedef struct PSI_file_info_v1 PSI_file_info;
typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state;
typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state;
typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state;
typedef struct PSI_file_locker_state_v1 PSI_file_locker_state;
typedef struct PSI_table_locker_state_v1 PSI_table_locker_state;
#endif
#ifdef USE_PSI_2
@ -1065,6 +1281,11 @@ typedef struct PSI_rwlock_info_v2 PSI_rwlock_info;
typedef struct PSI_cond_info_v2 PSI_cond_info;
typedef struct PSI_thread_info_v2 PSI_thread_info;
typedef struct PSI_file_info_v2 PSI_file_info;
typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state;
typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state;
typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state;
typedef struct PSI_file_locker_state_v2 PSI_file_locker_state;
typedef struct PSI_table_locker_state_v2 PSI_table_locker_state;
#endif
#else /* HAVE_PSI_INTERFACE */

View file

@ -88,6 +88,71 @@ struct PSI_file_info_v1
const char *m_name;
int m_flags;
};
struct PSI_mutex_locker_state_v1
{
uint m_flags;
struct PSI_mutex *m_mutex;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_mutex_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_rwlock_locker_state_v1
{
uint m_flags;
struct PSI_rwlock *m_rwlock;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_rwlock_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_cond_locker_state_v1
{
uint m_flags;
struct PSI_cond *m_cond;
struct PSI_mutex *m_mutex;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_cond_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_file_locker_state_v1
{
uint m_flags;
struct PSI_file *m_file;
struct PSI_thread *m_thread;
size_t m_number_of_bytes;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
enum PSI_file_operation m_operation;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
struct PSI_table_locker_state_v1
{
uint m_flags;
struct PSI_table *m_table;
struct PSI_table_share *m_table_share;
void *m_class;
struct PSI_thread *m_thread;
ulonglong m_timer_start;
ulonglong (*m_timer)(void);
uint m_index;
uint m_lock_index;
const char* m_src_file;
int m_src_line;
void *m_wait;
};
typedef void (*register_mutex_v1_t)
(const char *category, struct PSI_mutex_info_v1 *info, int count);
typedef void (*register_rwlock_v1_t)
@ -129,29 +194,38 @@ typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
typedef void (*delete_current_thread_v1_t)(void);
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t)
(struct PSI_mutex *mutex, enum PSI_mutex_operation op);
(struct PSI_mutex_locker_state_v1 *state,
struct PSI_mutex *mutex,
enum PSI_mutex_operation op);
typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t)
(struct PSI_rwlock *rwlock, enum PSI_rwlock_operation op);
(struct PSI_rwlock_locker_state_v1 *state,
struct PSI_rwlock *rwlock,
enum PSI_rwlock_operation op);
typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t)
(struct PSI_cond *cond, struct PSI_mutex *mutex,
(struct PSI_cond_locker_state_v1 *state,
struct PSI_cond *cond, struct PSI_mutex *mutex,
enum PSI_cond_operation op);
typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t)
(struct PSI_table *table);
(struct PSI_table_locker_state_v1 *state,
struct PSI_table *table);
typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t)
(PSI_file_key key, enum PSI_file_operation op, const char *name,
(struct PSI_file_locker_state_v1 *state,
PSI_file_key key, enum PSI_file_operation op, const char *name,
const void *identity);
typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t)
(struct PSI_file *file, enum PSI_file_operation op);
(struct PSI_file_locker_state_v1 *state,
struct PSI_file *file, enum PSI_file_operation op);
typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t)
(File file, enum PSI_file_operation op);
(struct PSI_file_locker_state_v1 *state,
File file, enum PSI_file_operation op);
typedef void (*unlock_mutex_v1_t)
(struct PSI_thread *thread, struct PSI_mutex *mutex);
(struct PSI_mutex *mutex);
typedef void (*unlock_rwlock_v1_t)
(struct PSI_thread *thread, struct PSI_rwlock *rwlock);
(struct PSI_rwlock *rwlock);
typedef void (*signal_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
typedef void (*broadcast_cond_v1_t)
(struct PSI_thread *thread, struct PSI_cond *cond);
(struct PSI_cond *cond);
typedef void (*start_mutex_wait_v1_t)
(struct PSI_mutex_locker *locker, const char *src_file, uint src_line);
typedef void (*end_mutex_wait_v1_t)
@ -240,5 +314,10 @@ typedef struct PSI_rwlock_info_v1 PSI_rwlock_info;
typedef struct PSI_cond_info_v1 PSI_cond_info;
typedef struct PSI_thread_info_v1 PSI_thread_info;
typedef struct PSI_file_info_v1 PSI_file_info;
typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state;
typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state;
typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state;
typedef struct PSI_file_locker_state_v1 PSI_file_locker_state;
typedef struct PSI_table_locker_state_v1 PSI_table_locker_state;
extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
C_MODE_END

View file

@ -82,11 +82,36 @@ struct PSI_file_info_v2
{
int placeholder;
};
struct PSI_mutex_locker_state_v2
{
int placeholder;
};
struct PSI_rwlock_locker_state_v2
{
int placeholder;
};
struct PSI_cond_locker_state_v2
{
int placeholder;
};
struct PSI_file_locker_state_v2
{
int placeholder;
};
struct PSI_table_locker_state_v2
{
int placeholder;
};
typedef struct PSI_v2 PSI;
typedef struct PSI_mutex_info_v2 PSI_mutex_info;
typedef struct PSI_rwlock_info_v2 PSI_rwlock_info;
typedef struct PSI_cond_info_v2 PSI_cond_info;
typedef struct PSI_thread_info_v2 PSI_thread_info;
typedef struct PSI_file_info_v2 PSI_file_info;
typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state;
typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state;
typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state;
typedef struct PSI_file_locker_state_v2 PSI_file_locker_state;
typedef struct PSI_table_locker_state_v2 PSI_table_locker_state;
extern MYSQL_PLUGIN_IMPORT PSI *PSI_server;
C_MODE_END

View file

@ -15,17 +15,15 @@
#ifndef _mysys_err_h
#define _mysys_err_h
#ifdef __cplusplus
#include "my_global.h" /* NEAR */
extern "C" {
#endif
#define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */
#define EE(X) (globerrs[(X) - EE_ERROR_FIRST])
extern const char * NEAR globerrs[]; /* my_error_messages is here */
extern const char *globerrs[]; /* my_error_messages is here */
/* Error message numbers in global map */
/*

0
libmysql/CMakeLists.txt Executable file → Normal file
View file

View file

@ -38,7 +38,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmake.lo strend.lo \
strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \
strcend.lo bcmp.lo ctype-latin1.lo \
strcend.lo ctype-latin1.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \

View file

@ -48,7 +48,7 @@ void libmysql_init(void)
#ifdef __WIN__
static int inited=0,threads=0;
HINSTANCE NEAR s_hModule; /* Saved module handle */
HINSTANCE s_hModule; /* Saved module handle */
DWORD main_thread;
BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called,
@ -105,21 +105,3 @@ int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserve
return TRUE;
}
#elif defined(WINDOWS)
/****************************************************************************
** This routine is called by LIBSTART.ASM at module load time. All it
** does in this sample is remember the DLL module handle. The module
** handle is needed if you want to do things like load stuff from the
** resource file (for instance string resources).
****************************************************************************/
int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize,
UCHAR FAR *lszCmdLine)
{
s_hModule = hModule;
libmysql_init();
return TRUE;
}
#endif

View file

@ -36,7 +36,7 @@
#include <pwd.h>
#endif /* HAVE_PWD_H */
#else /* ! HAVE_GETPASS */
#if !defined(__WIN__) && !defined(__NETWARE__)
#if !defined(__WIN__)
#include <sys/ioctl.h>
#ifdef HAVE_TERMIOS_H /* For tty-password */
#include <termios.h>
@ -55,9 +55,7 @@
#include <asm/termiobits.h>
#endif
#else
#ifndef __NETWARE__
#include <conio.h>
#endif /* __NETWARE__ */
#endif /* __WIN__ */
#endif /* HAVE_GETPASS */
@ -65,16 +63,8 @@
#define getpass(A) getpassphrase(A)
#endif
#if defined( __WIN__) || defined(__NETWARE__)
#if defined(__WIN__)
/* were just going to fake it here and get input from the keyboard */
#ifdef __NETWARE__
#undef _getch
#undef _cputs
#define _getch getcharacter
#define _cputs(A) putstring(A)
#endif
char *get_tty_password(const char *opt_message)
{
char to[80];

View file

@ -34,7 +34,7 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__)
#if !defined(__WIN__)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@ -45,7 +45,7 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#endif /* !defined(MSDOS) && !defined(__WIN__) */
#endif /* !defined(__WIN__) */
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
@ -74,7 +74,7 @@ ulong max_allowed_packet= 1024L*1024L*1024L;
my_bool net_flush(NET *net);
#endif
#if defined(MSDOS) || defined(__WIN__)
#if defined(__WIN__)
/* socket_errno is defined in my_global.h for all platforms */
#define perror(A)
#else
@ -128,31 +128,29 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
init_client_errs();
if (!mysql_port)
{
mysql_port = MYSQL_PORT;
#ifndef MSDOS
{
struct servent *serv_ptr __attribute__((unused));
char *env;
char *env;
struct servent *serv_ptr __attribute__((unused));
/*
if builder specifically requested a default port, use that
(even if it coincides with our factory default).
only if they didn't do we check /etc/services (and, failing
on that, fall back to the factory default of 3306).
either default can be overridden by the environment variable
MYSQL_TCP_PORT, which in turn can be overridden with command
line options.
*/
mysql_port = MYSQL_PORT;
/*
if builder specifically requested a default port, use that
(even if it coincides with our factory default).
only if they didn't do we check /etc/services (and, failing
on that, fall back to the factory default of 3306).
either default can be overridden by the environment variable
MYSQL_TCP_PORT, which in turn can be overridden with command
line options.
*/
#if MYSQL_PORT_DEFAULT == 0
if ((serv_ptr = getservbyname("mysql", "tcp")))
mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
#endif
if ((env = getenv("MYSQL_TCP_PORT")))
mysql_port =(uint) atoi(env);
}
if ((serv_ptr= getservbyname("mysql", "tcp")))
mysql_port= (uint) ntohs((ushort) serv_ptr->s_port);
#endif
if ((env= getenv("MYSQL_TCP_PORT")))
mysql_port=(uint) atoi(env);
}
if (!mysql_unix_port)
{
char *env;
@ -165,7 +163,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_unix_port = env;
}
mysql_debug(NullS);
#if defined(SIGPIPE) && !defined(__WIN__) && !defined(__NETWARE__)
#if defined(SIGPIPE) && !defined(__WIN__)
(void) signal(SIGPIPE, SIG_IGN);
#endif
#ifdef EMBEDDED_LIBRARY
@ -318,7 +316,7 @@ sig_handler
my_pipe_sig_handler(int sig __attribute__((unused)))
{
DBUG_PRINT("info",("Hit by signal %d",sig));
#ifdef DONT_REMEMBER_SIGNAL
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
(void) signal(SIGPIPE, my_pipe_sig_handler);
#endif
}
@ -479,15 +477,7 @@ struct passwd *getpwuid(uid_t);
char* getlogin(void);
#endif
#if defined(__NETWARE__)
/* Default to value of USER on NetWare, if unset use "UNKNOWN_USER" */
void read_user_name(char *name)
{
char *str=getenv("USER");
strmake(name, str ? str : "UNKNOWN_USER", USERNAME_LENGTH);
}
#elif !defined(MSDOS) && ! defined(VMS) && !defined(__WIN__)
#if !defined(__WIN__)
void read_user_name(char *name)
{
@ -517,7 +507,7 @@ void read_user_name(char *name)
DBUG_VOID_RETURN;
}
#else /* If MSDOS || VMS */
#else /* If Windows */
void read_user_name(char *name)
{
@ -2127,7 +2117,12 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
stmt->insert_id= mysql->insert_id;
if (res)
{
set_stmt_errmsg(stmt, net);
/*
Don't set stmt error if stmt->mysql is NULL, as the error in this case
has already been set by mysql_prune_stmt_list().
*/
if (stmt->mysql)
set_stmt_errmsg(stmt, net);
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@ -2338,7 +2333,12 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
buff, sizeof(buff), (uchar*) 0, 0,
1, stmt))
{
set_stmt_errmsg(stmt, net);
/*
Don't set stmt error if stmt->mysql is NULL, as the error in this case
has already been set by mysql_prune_stmt_list().
*/
if (stmt->mysql)
set_stmt_errmsg(stmt, net);
return 1;
}
if ((*mysql->methods->read_rows_from_cursor)(stmt))
@ -3025,7 +3025,12 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
buff, sizeof(buff), (uchar*) data,
length, 1, stmt))
{
set_stmt_errmsg(stmt, &mysql->net);
/*
Don't set stmt error if stmt->mysql is NULL, as the error in this case
has already been set by mysql_prune_stmt_list().
*/
if (stmt->mysql)
set_stmt_errmsg(stmt, &mysql->net);
DBUG_RETURN(1);
}
}
@ -4027,6 +4032,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
case MYSQL_TYPE_TIME:
field->max_length= 15; /* 19:23:48.123456 */
param->skip_result= skip_result_with_length;
break;
case MYSQL_TYPE_DATE:
field->max_length= 10; /* 2003-11-11 */
param->skip_result= skip_result_with_length;
@ -4440,7 +4446,12 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
(uchar*) 0, 0, 1, stmt))
{
set_stmt_errmsg(stmt, net);
/*
Don't set stmt error if stmt->mysql is NULL, as the error in this case
has already been set by mysql_prune_stmt_list().
*/
if (stmt->mysql)
set_stmt_errmsg(stmt, net);
DBUG_RETURN(1);
}
}

View file

@ -157,27 +157,22 @@ if DARWIN_MWCC
mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects)
else
-rm -f libmysqld.a
if test "$(host_os)" = "netware" ; \
then \
$(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \
else \
current_dir=`pwd`; \
rm -rf tmp; mkdir tmp; \
(for arc in $(INC_LIB) ./libmysqld_int.a; do \
arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
mkdir $$artmp; cd $$artmp > /dev/null; \
$(AR) x ../../$$arc; \
cd $$current_dir > /dev/null; \
ls $$artmp/* | grep -v SYMDEF; \
continue 2; fi; done; \
done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a ; \
$(AR) r libmysqld.a $(storageobjects); \
$(RANLIB) libmysqld.a ; \
rm -rf tmp; \
fi
current_dir=`pwd`; \
rm -rf tmp; mkdir tmp; \
(for arc in $(INC_LIB) ./libmysqld_int.a; do \
arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \
artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \
for F in `$(AR) t $$arc | grep -v SYMDEF`; do \
if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \
mkdir $$artmp; cd $$artmp > /dev/null; \
$(AR) x ../../$$arc; \
cd $$current_dir > /dev/null; \
ls $$artmp/* | grep -v SYMDEF; \
continue 2; fi; done; \
done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a; \
$(AR) r libmysqld.a $(storageobjects); \
$(RANLIB) libmysqld.a ; \
rm -rf tmp
endif
## XXX: any time the client interface changes, we'll need to bump

View file

@ -42,7 +42,8 @@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
mysqltest_embedded_LINK = $(CXXLINK)
nodist_mysqltest_embedded_SOURCES = mysqltest.cc
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a \
@MYSQLD_EXTRA_LDFLAGS@
nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
my_readline.h sql_string.h completion_hash.h

View file

@ -522,10 +522,10 @@ int init_embedded_server(int argc, char **argv, char **groups)
mysql_data_home= mysql_real_data_home;
mysql_data_home_len= mysql_real_data_home_len;
/* Get default temporary directory */
opt_mysql_tmpdir=getenv("TMPDIR"); /* Use this if possible */
#if defined( __WIN__) || defined(OS2)
#if defined(__WIN__)
if (!opt_mysql_tmpdir)
opt_mysql_tmpdir=getenv("TEMP");
if (!opt_mysql_tmpdir)

View file

@ -32,7 +32,7 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__)
#if !defined(__WIN__)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@ -54,7 +54,7 @@
extern ulong net_buffer_length;
extern ulong max_allowed_packet;
#if defined(MSDOS) || defined(__WIN__)
#if defined(__WIN__)
#define ERRNO WSAGetLastError()
#define perror(A)
#else

View file

@ -243,14 +243,17 @@ reset master;
drop table if exists t3;
--enable_warnings
create table t3 (a int(11) NOT NULL AUTO_INCREMENT, b text, PRIMARY KEY (a) ) engine=innodb;
show master status;
--let $binlog_file1= query_get_value(SHOW MASTER STATUS, File, 1)
--echo File $binlog_file1
let $it=4;
while ($it)
{
insert into t3(b) values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
dec $it;
}
show master status /* must show new binlog index after rotating */;
--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1)
--echo *** show new binlog index after rotating ***
--echo File $binlog_file2
drop table t3;
--echo #

View file

@ -320,6 +320,16 @@ disconnect con3;
connection con4;
select get_lock("a",10); # wait for rollback to finish
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
--let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 7)
--let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 7)
if (`SELECT 'ROLLBACK' != '$binlog_query'`) {
--echo Wrong query from SHOW BINLOG EVENTS. Expected ROLLBACK, got '$binlog_query'
--source include/show_rpl_debug_info.inc
--die Wrong value for slave parameter
}
}
flush logs;
let $MYSQLD_DATADIR= `select @@datadir`;
@ -328,13 +338,12 @@ let $MYSQLD_DATADIR= `select @@datadir`;
# and does not make slave to stop)
if (`select @@binlog_format = 'ROW'`)
{
--echo This does not matter in ROW mode as the rolled back changes do not contain transactional changes as these
--echo were previously flushed upon committing/rolling back each statement.
--echo There is nothing to roll back; transactional changes are removed from the trans cache.
}
if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
{
--exec $MYSQL_BINLOG --start-position=556 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
--exec $MYSQL_BINLOG --start-position=$binlog_rollback $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select

View file

@ -92,7 +92,10 @@ if (`SELECT @@global.binlog_format != 'ROW' OR @@global.slave_exec_mode = 'STRIC
let $slave_sql_errno= 1062; # ER_DUP_ENTRY
source include/wait_for_slave_sql_error.inc;
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
--echo Last_SQL_Error = $err (expected "duplicate key" error)
--replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
--disable_query_log
--eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
--enable_query_log
SELECT * FROM t1;
--echo ---- Resolve the conflict on the slave and restart SQL thread ----

View file

@ -65,17 +65,13 @@ let $_diff_table=$diff_table_2;
let $_diff_i=2;
while ($_diff_i) {
# Parse out any leading "master:" or "slave:" from the table
# specification and connect the appropriate server.
let $_diff_conn_master=`SELECT SUBSTR('$_diff_table', 1, 7) = 'master:'`;
if ($_diff_conn_master) {
let $_diff_table=`SELECT SUBSTR('$_diff_table', 8)`;
connection master;
}
let $_diff_conn_slave=`SELECT SUBSTR('$_diff_table', 1, 6) = 'slave:'`;
if ($_diff_conn_slave) {
let $_diff_table=`SELECT SUBSTR('$_diff_table', 7)`;
connection slave;
# Parse out any leading "master:" or "slave:" from the table specification
# and connect the appropriate server.
let $_pos= `SELECT LOCATE(':', '$_diff_table')`;
let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`;
if (`SELECT 'XX$_diff_conn' <> 'XX'`) {
let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`;
connection $_diff_conn;
}
# Sanity-check the input.

0
mysql-test/include/parser_bug21114.inc Executable file → Normal file
View file

View file

@ -0,0 +1,35 @@
# #############################################################################
# Check whether the given table is consistent between different master and
# slaves
#
# Usage:
# --let $diff_table= test.t1
# --let $diff_server_list= master, slave, slave2
# --source include/rpl_diff_tables.inc
# #############################################################################
if (`SELECT "XX$diff_table" = "XX"`)
{
--die diff_table is null.
}
--let $_servers= master, slave
if (`SELECT "XX$diff_server_list" <> "XX"`)
{
--let $_servers= $diff_server_list
}
--let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))`
connection $_master;
while (`SELECT "XX$_servers" <> "XX"`)
{
--let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))`
--sync_slave_with_master $_slave
--let $diff_table_1= $_master:$diff_table
--let $diff_table_2= $_slave:$diff_table
--source include/diff_tables.inc
connection $_slave;
}

0
mysql-test/include/show_msg.inc Executable file → Normal file
View file

0
mysql-test/include/show_msg80.inc Executable file → Normal file
View file

0
mysql-test/lib/My/Handles.pm Executable file → Normal file
View file

0
mysql-test/lib/My/SafeProcess/safe_kill_win.cc Executable file → Normal file
View file

View file

@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, handle_signal);
signal(SIGABRT, handle_abort);
sprintf(safe_process_name, "safe_process[%d]", own_pid);
sprintf(safe_process_name, "safe_process[%ld]", (long) own_pid);
message("Started");

0
mysql-test/lib/My/SafeProcess/safe_process_win.cc Executable file → Normal file
View file

View file

@ -141,7 +141,6 @@ sub mtr_exe_maybe_exists (@) {
my @path= @_;
map {$_.= ".exe"} @path if $::glob_win32;
map {$_.= ".nlm"} @path if $::glob_netware;
foreach my $path ( @path )
{
if($::glob_win32)

Some files were not shown because too many files have changed in this diff Show more