Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:
bzr branch mysql-5.1-performance-version mysql-trunk # Summit cd mysql-trunk bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin bzr rm innobase # remove the builtin Next step: build, test fixes.
This commit is contained in:
commit
b57e4dbd88
@ -1,4 +1,4 @@
|
||||
[MYSQL]
|
||||
post_commit_to = "commits@lists.mysql.com"
|
||||
post_push_to = "commits@lists.mysql.com"
|
||||
tree_name = "mysql-5.4"
|
||||
post_commit_to = "guilhem@sun.com, alik@sun.com"
|
||||
#post_push_to = "commits@lists.mysql.com"
|
||||
tree_name = "mysql-trunk"
|
||||
|
@ -50,8 +50,13 @@ check_cpu () {
|
||||
model_name=`sysctl -n hw.model`
|
||||
;;
|
||||
Darwin)
|
||||
cpu_family=`uname -p`
|
||||
model_name=`machine`
|
||||
cpu_family=`sysctl -n machdep.cpu.vendor`
|
||||
model_name=`sysctl -n machdep.cpu.brand_string`
|
||||
if [ -z "$cpu_family" -o -z "$model_name" ]
|
||||
then
|
||||
cpu_family=`uname -p`
|
||||
model_name=`machine`
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
cpu_family=`uname -p`;
|
||||
|
158
CMakeLists.txt
158
CMakeLists.txt
@ -13,7 +13,7 @@
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
||||
|
||||
PROJECT(MySql)
|
||||
|
||||
@ -32,52 +32,6 @@ ADD_DEFINITIONS(-DHAVE_YASSL)
|
||||
# Set debug options
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
|
||||
|
||||
# Note that some engines are always compiled in, MyISAM, MyISAMMRG and HEAP,
|
||||
# these three plugin defintions are dummys for symmetry
|
||||
|
||||
SET(WITH_HEAP_STORAGE_ENGINE TRUE)
|
||||
ADD_DEFINITIONS(-DWITH_HEAP_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_heap_plugin")
|
||||
|
||||
SET(WITH_MYISAM_STORAGE_ENGINE TRUE)
|
||||
ADD_DEFINITIONS(-DWITH_MYISAM_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisam_plugin")
|
||||
|
||||
SET(WITH_MYISAMMRG_STORAGE_ENGINE TRUE)
|
||||
ADD_DEFINITIONS(-DWITH_MYISAMMRG_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_myisammrg_plugin")
|
||||
|
||||
IF(WITH_ARCHIVE_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_ARCHIVE_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_archive_plugin")
|
||||
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
|
||||
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_blackhole_plugin")
|
||||
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
IF(WITH_CSV_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_CSV_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_csv_plugin")
|
||||
ENDIF(WITH_CSV_STORAGE_ENGINE)
|
||||
IF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_EXAMPLE_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_example_plugin")
|
||||
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
IF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_innobase_plugin")
|
||||
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
IF(WITH_PARTITION_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_PARTITION_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
|
||||
ENDIF(WITH_PARTITION_STORAGE_ENGINE)
|
||||
IF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_FEDERATED_STORAGE_ENGINE)
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_federated_plugin")
|
||||
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
|
||||
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY)
|
||||
|
||||
SET(localstatedir "C:\\mysql\\data")
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
|
||||
@ -122,6 +76,16 @@ IF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /wd4996")
|
||||
ENDIF(MSVC AND NOT CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
|
||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
# VS2003 has a bug that prevents linking mysqld with module definition file
|
||||
# (/DEF option for linker). Linker would incorrectly complain about multiply
|
||||
# defined symbols. Workaround is to disable dynamic plugins, so /DEF is not
|
||||
# used.
|
||||
MESSAGE("Warning: Building MySQL with Visual Studio 2003.NET is no more supported.")
|
||||
MESSAGE("Please use a newer version of Visual Studio.")
|
||||
SET(WITHOUT_DYNAMIC_PLUGINS TRUE)
|
||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||
|
||||
# Settings for Visual Studio 7 and above.
|
||||
IF(MSVC)
|
||||
# replace /MDd with /MTd
|
||||
@ -165,12 +129,16 @@ IF(WIN32)
|
||||
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
|
||||
ENDIF(WIN32)
|
||||
|
||||
# default to x86 platform. We'll check for X64 in a bit
|
||||
SET (PLATFORM X86)
|
||||
|
||||
# This definition is necessary to work around a bug with Intellisense described
|
||||
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
|
||||
# debugger functionality.
|
||||
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||
MESSAGE(STATUS "Detected 64-bit platform.")
|
||||
ADD_DEFINITIONS("-D_WIN64")
|
||||
SET (PLATFORM X64)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
|
||||
|
||||
IF(EMBED_MANIFESTS)
|
||||
@ -223,6 +191,81 @@ IF(EMBED_MANIFESTS)
|
||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64")
|
||||
ENDIF(EMBED_MANIFESTS)
|
||||
|
||||
# Figure out what engines to build and how (statically or dynamically),
|
||||
# add preprocessor defines for storage engines.
|
||||
IF(WITHOUT_DYNAMIC_PLUGINS)
|
||||
MESSAGE("Dynamic plugins are disabled.")
|
||||
ENDIF(WITHOUT_DYNAMIC_PLUGINS)
|
||||
|
||||
FILE(GLOB STORAGE_SUBDIRS storage/*)
|
||||
FOREACH(SUBDIR ${STORAGE_SUBDIRS})
|
||||
FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/storage ${SUBDIR})
|
||||
STRING(TOUPPER ${DIRNAME} ENGINE)
|
||||
STRING(TOLOWER ${DIRNAME} ENGINE_LOWER)
|
||||
IF (EXISTS ${SUBDIR}/CMakeLists.txt)
|
||||
# Check MYSQL_STORAGE_ENGINE macro is present
|
||||
FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX MYSQL_STORAGE_ENGINE)
|
||||
IF(HAVE_STORAGE_ENGINE)
|
||||
SET(ENGINE_BUILD_TYPE "DYNAMIC")
|
||||
# Read plug.in to find out if a plugin is mandatory and whether it supports
|
||||
# build as shared library (dynamic).
|
||||
IF(EXISTS ${SUBDIR}/plug.in)
|
||||
FILE(READ ${SUBDIR}/plug.in PLUGIN_FILE_CONTENT)
|
||||
STRING (REGEX MATCH "MYSQL_PLUGIN_DYNAMIC" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT})
|
||||
STRING (REGEX MATCH "MYSQL_PLUGIN_MANDATORY" MYSQL_PLUGIN_MANDATORY ${PLUGIN_FILE_CONTENT})
|
||||
STRING (REGEX MATCH "MYSQL_PLUGIN_STATIC" MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT})
|
||||
|
||||
IF(MYSQL_PLUGIN_MANDATORY)
|
||||
SET(WITH_${ENGINE}_STORAGE_ENGINE TRUE)
|
||||
ENDIF(MYSQL_PLUGIN_MANDATORY)
|
||||
|
||||
IF (WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
|
||||
SET(ENGINE_BUILD_TYPE "STATIC")
|
||||
ELSEIF(NOT WITHOUT_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_DYNAMIC AND NOT WITHOUT_DYNAMIC_PLUGINS)
|
||||
SET(ENGINE_BUILD_TYPE "DYNAMIC")
|
||||
ELSE(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
|
||||
SET(ENGINE_BUILD_TYPE "NONE")
|
||||
ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
|
||||
IF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${ENGINE_LOWER}_plugin")
|
||||
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${ENGINE_LOWER})
|
||||
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
|
||||
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
|
||||
ENDIF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
|
||||
ENDIF(EXISTS ${SUBDIR}/plug.in)
|
||||
|
||||
IF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE")
|
||||
LIST(APPEND ${ENGINE_BUILD_TYPE}_ENGINE_DIRECTORIES ${SUBDIR})
|
||||
ENDIF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE")
|
||||
|
||||
ENDIF(HAVE_STORAGE_ENGINE)
|
||||
ENDIF(EXISTS ${SUBDIR}/CMakeLists.txt)
|
||||
ENDFOREACH(SUBDIR ${STORAGE_SUBDIRS})
|
||||
|
||||
# Special handling for partition(not really pluggable)
|
||||
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
|
||||
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_PARTITION_STORAGE_ENGINE")
|
||||
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
|
||||
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
|
||||
|
||||
ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS})
|
||||
|
||||
# Now write out our mysql_plugin_defs struct
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
|
||||
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc @ONLY)
|
||||
|
||||
# Add subdirectories for storage engines
|
||||
SET (ENGINE_BUILD_TYPE "STATIC")
|
||||
FOREACH(DIR ${STATIC_ENGINE_DIRECTORIES})
|
||||
ADD_SUBDIRECTORY(${DIR})
|
||||
ENDFOREACH(DIR ${STATIC_ENGINE_DIRECTORIES})
|
||||
|
||||
SET (ENGINE_BUILD_TYPE "DYNAMIC")
|
||||
FOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
|
||||
ADD_SUBDIRECTORY(${DIR})
|
||||
ENDFOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
|
||||
|
||||
|
||||
# FIXME "debug" only needed if build type is "Debug", but
|
||||
# CMAKE_BUILD_TYPE is not set during configure time.
|
||||
ADD_SUBDIRECTORY(vio)
|
||||
@ -235,28 +278,7 @@ ADD_SUBDIRECTORY(zlib)
|
||||
ADD_SUBDIRECTORY(extra/yassl)
|
||||
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
|
||||
ADD_SUBDIRECTORY(extra)
|
||||
ADD_SUBDIRECTORY(storage/heap)
|
||||
ADD_SUBDIRECTORY(storage/myisam)
|
||||
ADD_SUBDIRECTORY(storage/myisammrg)
|
||||
ADD_SUBDIRECTORY(client)
|
||||
IF(WITH_ARCHIVE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/archive)
|
||||
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
|
||||
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/blackhole)
|
||||
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
IF(WITH_CSV_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/csv)
|
||||
ENDIF(WITH_CSV_STORAGE_ENGINE)
|
||||
IF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/example)
|
||||
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
IF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/federated)
|
||||
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
IF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/innobase)
|
||||
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(sql)
|
||||
ADD_SUBDIRECTORY(libmysql)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
|
@ -71,7 +71,7 @@ mysqldump_SOURCES= mysqldump.c \
|
||||
$(top_srcdir)/mysys/mf_getdate.c
|
||||
|
||||
mysqlimport_SOURCES= mysqlimport.c
|
||||
|
||||
mysqlimport_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
|
||||
mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
||||
@CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(LIBMYSQLCLIENT_LA) \
|
||||
@ -80,14 +80,14 @@ mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
||||
mysqlshow_SOURCES= mysqlshow.c
|
||||
|
||||
mysqlslap_SOURCES= mysqlslap.c
|
||||
mysqlslap_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
|
||||
mysqlslap_CFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
|
||||
mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
||||
@CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(LIBMYSQLCLIENT_LA) \
|
||||
$(top_builddir)/mysys/libmysys.a
|
||||
|
||||
mysqltest_SOURCES= mysqltest.cc
|
||||
mysqltest_CXXFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
|
||||
mysqltest_CXXFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
|
||||
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
||||
@CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(LIBMYSQLCLIENT_LA) \
|
||||
@ -99,7 +99,7 @@ mysql_upgrade_SOURCES= mysql_upgrade.c \
|
||||
$(top_srcdir)/mysys/my_getpagesize.c
|
||||
|
||||
# Fix for mit-threads
|
||||
DEFS = -DUNDEF_THREADS_HACK \
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS \
|
||||
-DDEFAULT_MYSQL_HOME="\"$(prefix)\"" \
|
||||
-DDATADIR="\"$(localstatedir)\""
|
||||
|
||||
|
110
client/mysql.cc
110
client/mysql.cc
@ -115,7 +115,7 @@ extern "C" {
|
||||
#define PROMPT_CHAR '\\'
|
||||
#define DEFAULT_DELIMITER ";"
|
||||
|
||||
#define MAX_BATCH_BUFFER_SIZE (1024L * 1024L)
|
||||
#define MAX_BATCH_BUFFER_SIZE (1024L * 1024L * 1024L)
|
||||
|
||||
typedef struct st_status
|
||||
{
|
||||
@ -143,7 +143,8 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
|
||||
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
|
||||
default_charset_used= 0, opt_secure_auth= 0,
|
||||
default_pager_set= 0, opt_sigint_ignore= 0,
|
||||
show_warnings= 0, executing_query= 0, interrupted_query= 0;
|
||||
show_warnings= 0, executing_query= 0, interrupted_query= 0,
|
||||
ignore_spaces= 0;
|
||||
static my_bool debug_info_flag, debug_check_flag;
|
||||
static my_bool column_types_flag;
|
||||
static my_bool preserve_comments= 0;
|
||||
@ -1183,7 +1184,12 @@ int main(int argc,char *argv[])
|
||||
histfile= 0;
|
||||
}
|
||||
}
|
||||
if (histfile)
|
||||
|
||||
/* We used to suggest setting MYSQL_HISTFILE=/dev/null. */
|
||||
if (histfile && strncmp(histfile, "/dev/null", 10) == 0)
|
||||
histfile= NULL;
|
||||
|
||||
if (histfile && histfile[0])
|
||||
{
|
||||
if (verbose)
|
||||
tee_fprintf(stdout, "Reading history-file %s\n",histfile);
|
||||
@ -1218,7 +1224,8 @@ sig_handler mysql_end(int sig)
|
||||
{
|
||||
mysql_close(&mysql);
|
||||
#ifdef HAVE_READLINE
|
||||
if (!status.batch && !quick && !opt_html && !opt_xml && histfile)
|
||||
if (!status.batch && !quick && !opt_html && !opt_xml &&
|
||||
histfile && histfile[0])
|
||||
{
|
||||
/* write-history */
|
||||
if (verbose)
|
||||
@ -1345,7 +1352,7 @@ static struct my_option my_long_options[] =
|
||||
{"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
|
||||
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
|
||||
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) &debug_info_flag,
|
||||
@ -1372,8 +1379,9 @@ static struct my_option my_long_options[] =
|
||||
{"no-named-commands", 'g',
|
||||
"Named commands are disabled. Use \\* form only, or use named commands only in the beginning of a line ending with a semicolon (;) Since version 10.9 the client now starts with this option ENABLED by default! Disable with '-G'. Long format commands still work from the first line. WARNING: option deprecated; use --disable-named-commands instead.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore-spaces", 'i', "Ignore space after function names.", 0, 0, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore-spaces", 'i', "Ignore space after function names.",
|
||||
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"local-infile", OPT_LOCAL_INFILE, "Enable/disable LOAD DATA LOCAL INFILE.",
|
||||
(uchar**) &opt_local_infile,
|
||||
(uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -1794,6 +1802,10 @@ static int get_options(int argc, char **argv)
|
||||
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
|
||||
if (debug_check_flag)
|
||||
my_end_arg= MY_CHECK_ERROR;
|
||||
|
||||
if (ignore_spaces)
|
||||
connect_flag|= CLIENT_IGNORE_SPACE;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@ -1967,7 +1979,7 @@ static COMMANDS *find_command(char *name,char cmd_char)
|
||||
*/
|
||||
if (strstr(name, "\\g") || (strstr(name, delimiter) &&
|
||||
!(strlen(name) >= 9 &&
|
||||
!my_strnncoll(charset_info,
|
||||
!my_strnncoll(&my_charset_latin1,
|
||||
(uchar*) name, 9,
|
||||
(const uchar*) "delimiter",
|
||||
9))))
|
||||
@ -1988,11 +2000,11 @@ static COMMANDS *find_command(char *name,char cmd_char)
|
||||
{
|
||||
if (commands[i].func &&
|
||||
((name &&
|
||||
!my_strnncoll(charset_info,(uchar*)name,len,
|
||||
!my_strnncoll(&my_charset_latin1, (uchar*)name, len,
|
||||
(uchar*)commands[i].name,len) &&
|
||||
!commands[i].name[len] &&
|
||||
(!end || (end && commands[i].takes_params))) ||
|
||||
!name && commands[i].cmd_char == cmd_char))
|
||||
(!name && commands[i].cmd_char == cmd_char)))
|
||||
{
|
||||
DBUG_PRINT("exit",("found command: %s", commands[i].name));
|
||||
DBUG_RETURN(&commands[i]);
|
||||
@ -2151,7 +2163,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
||||
buffer.length(0);
|
||||
}
|
||||
else if (!*ml_comment && (!*in_string && (inchar == '#' ||
|
||||
inchar == '-' && pos[1] == '-' &&
|
||||
(inchar == '-' && pos[1] == '-' &&
|
||||
/*
|
||||
The third byte is either whitespace or is the
|
||||
end of the line -- which would occur only
|
||||
@ -2159,7 +2171,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
||||
itself whitespace and should also match.
|
||||
*/
|
||||
(my_isspace(charset_info,pos[2]) ||
|
||||
!pos[2]))))
|
||||
!pos[2])))))
|
||||
{
|
||||
// Flush previously accepted characters
|
||||
if (out != line)
|
||||
@ -2720,7 +2732,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
|
||||
{
|
||||
MYSQL_ROW cur;
|
||||
const char *server_cmd= buffer->ptr();
|
||||
char cmd_buf[100];
|
||||
char cmd_buf[100 + 1];
|
||||
MYSQL_RES *result;
|
||||
int error;
|
||||
|
||||
@ -3381,9 +3393,12 @@ print_table_data_html(MYSQL_RES *result)
|
||||
{
|
||||
while((field = mysql_fetch_field(result)))
|
||||
{
|
||||
tee_fprintf(PAGER, "<TH>%s</TH>", (field->name ?
|
||||
(field->name[0] ? field->name :
|
||||
" ") : "NULL"));
|
||||
tee_fputs("<TH>", PAGER);
|
||||
if (field->name && field->name[0])
|
||||
xmlencode_print(field->name, field->name_length);
|
||||
else
|
||||
tee_fputs(field->name ? " " : "NULL", PAGER);
|
||||
tee_fputs("</TH>", PAGER);
|
||||
}
|
||||
(void) tee_fputs("</TR>", PAGER);
|
||||
}
|
||||
@ -3396,7 +3411,7 @@ print_table_data_html(MYSQL_RES *result)
|
||||
for (uint i=0; i < mysql_num_fields(result); i++)
|
||||
{
|
||||
(void) tee_fputs("<TD>", PAGER);
|
||||
safe_put_field(cur[i],lengths[i]);
|
||||
xmlencode_print(cur[i], lengths[i]);
|
||||
(void) tee_fputs("</TD>", PAGER);
|
||||
}
|
||||
(void) tee_fputs("</TR>", PAGER);
|
||||
@ -4249,41 +4264,36 @@ com_status(String *buffer __attribute__((unused)),
|
||||
MYSQL_RES *result;
|
||||
LINT_INIT(result);
|
||||
|
||||
if (mysql_real_query_for_lazy(
|
||||
C_STRING_WITH_LEN("select DATABASE(), USER() limit 1")))
|
||||
return 0;
|
||||
|
||||
tee_puts("--------------", stdout);
|
||||
usage(1); /* Print version */
|
||||
if (connected)
|
||||
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
||||
/*
|
||||
Don't remove "limit 1",
|
||||
it is protection againts SQL_SELECT_LIMIT=0
|
||||
*/
|
||||
if (mysql_store_result_for_lazy(&result))
|
||||
{
|
||||
tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",mysql_thread_id(&mysql));
|
||||
/*
|
||||
Don't remove "limit 1",
|
||||
it is protection againts SQL_SELECT_LIMIT=0
|
||||
*/
|
||||
if (!mysql_query(&mysql,"select DATABASE(), USER() limit 1") &&
|
||||
(result=mysql_use_result(&mysql)))
|
||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
{
|
||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
{
|
||||
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
|
||||
tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
|
||||
tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
|
||||
}
|
||||
mysql_free_result(result);
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
if ((status_str= mysql_get_ssl_cipher(&mysql)))
|
||||
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
||||
status_str);
|
||||
else
|
||||
#endif /* HAVE_OPENSSL */
|
||||
tee_puts("SSL:\t\t\tNot in use", stdout);
|
||||
}
|
||||
if ((status_str= mysql_get_ssl_cipher(&mysql)))
|
||||
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
|
||||
status_str);
|
||||
else
|
||||
{
|
||||
vidattr(A_BOLD);
|
||||
tee_fprintf(stdout, "\nNo connection\n");
|
||||
vidattr(A_NORMAL);
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_OPENSSL */
|
||||
tee_puts("SSL:\t\t\tNot in use", stdout);
|
||||
|
||||
if (skip_updates)
|
||||
{
|
||||
vidattr(A_BOLD);
|
||||
@ -4302,8 +4312,14 @@ com_status(String *buffer __attribute__((unused)),
|
||||
tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff));
|
||||
|
||||
/* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
|
||||
if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database limit 1") &&
|
||||
(result=mysql_use_result(&mysql)))
|
||||
if (mysql_real_query_for_lazy(C_STRING_WITH_LEN(
|
||||
"select @@character_set_client, @@character_set_connection, "
|
||||
"@@character_set_server, @@character_set_database limit 1")))
|
||||
{
|
||||
if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
|
||||
return 0;
|
||||
}
|
||||
if (mysql_store_result_for_lazy(&result))
|
||||
{
|
||||
MYSQL_ROW cur=mysql_fetch_row(result);
|
||||
if (cur)
|
||||
|
@ -39,6 +39,7 @@ static uint my_end_arg= 0;
|
||||
static char *opt_user= (char*)"root";
|
||||
|
||||
static DYNAMIC_STRING ds_args;
|
||||
static DYNAMIC_STRING conn_args;
|
||||
|
||||
static char *opt_password= 0;
|
||||
static my_bool tty_password= 0;
|
||||
@ -115,11 +116,11 @@ static struct my_option my_long_options[]=
|
||||
#endif
|
||||
{"socket", 'S', "Socket file to use for connection.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
{"tmpdir", 't', "Directory for temporary files",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) &opt_user,
|
||||
(uchar**) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
{"verbose", 'v', "Display more output about the process",
|
||||
(uchar**) &opt_verbose, (uchar**) &opt_verbose, 0,
|
||||
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
@ -135,6 +136,7 @@ static void free_used_memory(void)
|
||||
free_defaults(defaults_argv);
|
||||
|
||||
dynstr_free(&ds_args);
|
||||
dynstr_free(&conn_args);
|
||||
}
|
||||
|
||||
|
||||
@ -204,7 +206,7 @@ static void add_one_option(DYNAMIC_STRING* ds,
|
||||
}
|
||||
}
|
||||
dynstr_append_os_quoted(ds, "--", opt->name, eq, arg, NullS);
|
||||
dynstr_append(&ds_args, " ");
|
||||
dynstr_append(ds, " ");
|
||||
}
|
||||
|
||||
|
||||
@ -231,6 +233,8 @@ get_one_option(int optid, const struct my_option *opt,
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; /* Don't require password */
|
||||
tty_password= 1;
|
||||
add_option= FALSE;
|
||||
if (argument)
|
||||
@ -254,6 +258,15 @@ get_one_option(int optid, const struct my_option *opt,
|
||||
case 'f': /* --force */
|
||||
add_option= FALSE;
|
||||
break;
|
||||
|
||||
case 'h': /* --host */
|
||||
case 'W': /* --pipe */
|
||||
case 'P': /* --port */
|
||||
case 'S': /* --socket */
|
||||
case OPT_MYSQL_PROTOCOL: /* --protocol */
|
||||
case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
|
||||
add_one_option(&conn_args, opt, argument);
|
||||
break;
|
||||
}
|
||||
|
||||
if (add_option)
|
||||
@ -601,6 +614,20 @@ static void create_mysql_upgrade_info_file(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Print connection-related arguments.
|
||||
*/
|
||||
|
||||
static void print_conn_args(const char *tool_name)
|
||||
{
|
||||
if (conn_args.str[0])
|
||||
verbose("Running '%s' with connection arguments: %s", tool_name,
|
||||
conn_args.str);
|
||||
else
|
||||
verbose("Running '%s with default connection arguments", tool_name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Check and upgrade(if neccessary) all tables
|
||||
in the server using "mysqlcheck --check-upgrade .."
|
||||
@ -608,7 +635,7 @@ static void create_mysql_upgrade_info_file(void)
|
||||
|
||||
static int run_mysqlcheck_upgrade(void)
|
||||
{
|
||||
verbose("Running 'mysqlcheck'...");
|
||||
print_conn_args("mysqlcheck");
|
||||
return run_tool(mysqlcheck_path,
|
||||
NULL, /* Send output from mysqlcheck directly to screen */
|
||||
"--no-defaults",
|
||||
@ -622,7 +649,7 @@ static int run_mysqlcheck_upgrade(void)
|
||||
|
||||
static int run_mysqlcheck_fixnames(void)
|
||||
{
|
||||
verbose("Running 'mysqlcheck'...");
|
||||
print_conn_args("mysqlcheck");
|
||||
return run_tool(mysqlcheck_path,
|
||||
NULL, /* Send output from mysqlcheck directly to screen */
|
||||
"--no-defaults",
|
||||
@ -751,7 +778,8 @@ int main(int argc, char **argv)
|
||||
strncpy(self_name, argv[0], FN_REFLEN);
|
||||
}
|
||||
|
||||
if (init_dynamic_string(&ds_args, "", 512, 256))
|
||||
if (init_dynamic_string(&ds_args, "", 512, 256) ||
|
||||
init_dynamic_string(&conn_args, "", 512, 256))
|
||||
die("Out of memory");
|
||||
|
||||
load_defaults("my", load_default_groups, &argc, &argv);
|
||||
|
@ -232,6 +232,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
opt_count_iterations= 1;
|
||||
break;
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; // Don't require password
|
||||
if (argument)
|
||||
{
|
||||
char *start=argument;
|
||||
@ -677,10 +679,16 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
|
||||
pos=argv[1];
|
||||
for (;;)
|
||||
{
|
||||
if (mysql_kill(mysql,(ulong) atol(pos)))
|
||||
/* We don't use mysql_kill(), since it only handles 32-bit IDs. */
|
||||
char buff[26], *out; /* "KILL " + max 20 digs + NUL */
|
||||
out= strxmov(buff, "KILL ", NullS);
|
||||
ullstr(strtoull(pos, NULL, 0), out);
|
||||
|
||||
if (mysql_query(mysql, buff))
|
||||
{
|
||||
my_printf_error(0, "kill failed on %ld; error: '%s'", error_flags,
|
||||
atol(pos), mysql_error(mysql));
|
||||
/* out still points to just the number */
|
||||
my_printf_error(0, "kill failed on %s; error: '%s'", error_flags,
|
||||
out, mysql_error(mysql));
|
||||
error=1;
|
||||
}
|
||||
if (!(pos=strchr(pos,',')))
|
||||
|
@ -17,10 +17,8 @@
|
||||
|
||||
TODO: print the catalog (some USE catalog.db ????).
|
||||
|
||||
Standalone program to read a MySQL binary log (or relay log);
|
||||
can read files produced by 3.23, 4.x, 5.0 servers.
|
||||
Standalone program to read a MySQL binary log (or relay log).
|
||||
|
||||
Can read binlogs from 3.23/4.x/5.0 and relay logs from 4.x/5.0.
|
||||
Should be able to read any file of these categories, even with
|
||||
--start-position.
|
||||
An important fact: the Format_desc event of the log is at most the 3rd event
|
||||
@ -681,6 +679,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
{
|
||||
char ll_buff[21];
|
||||
Log_event_type ev_type= ev->get_type_code();
|
||||
my_bool destroy_evt= TRUE;
|
||||
DBUG_ENTER("process_event");
|
||||
print_event_info->short_form= short_form;
|
||||
Exit_status retval= OK_CONTINUE;
|
||||
@ -689,8 +688,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
Format events are not concerned by --offset and such, we always need to
|
||||
read them to be able to process the wanted events.
|
||||
*/
|
||||
if ((rec_count >= offset) &&
|
||||
((my_time_t)(ev->when) >= start_datetime) ||
|
||||
if (((rec_count >= offset) &&
|
||||
((my_time_t)(ev->when) >= start_datetime)) ||
|
||||
(ev_type == FORMAT_DESCRIPTION_EVENT))
|
||||
{
|
||||
if (ev_type != FORMAT_DESCRIPTION_EVENT)
|
||||
@ -871,12 +870,63 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
break;
|
||||
}
|
||||
case TABLE_MAP_EVENT:
|
||||
{
|
||||
Table_map_log_event *map= ((Table_map_log_event *)ev);
|
||||
if (shall_skip_database(map->get_db_name()))
|
||||
{
|
||||
print_event_info->m_table_map_ignored.set_table(map->get_table_id(), map);
|
||||
destroy_evt= FALSE;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
case WRITE_ROWS_EVENT:
|
||||
case DELETE_ROWS_EVENT:
|
||||
case UPDATE_ROWS_EVENT:
|
||||
case PRE_GA_WRITE_ROWS_EVENT:
|
||||
case PRE_GA_DELETE_ROWS_EVENT:
|
||||
case PRE_GA_UPDATE_ROWS_EVENT:
|
||||
{
|
||||
if (ev_type != TABLE_MAP_EVENT)
|
||||
{
|
||||
Rows_log_event *e= (Rows_log_event*) ev;
|
||||
Table_map_log_event *ignored_map=
|
||||
print_event_info->m_table_map_ignored.get_table(e->get_table_id());
|
||||
bool skip_event= (ignored_map != NULL);
|
||||
|
||||
/*
|
||||
end of statement check:
|
||||
i) destroy/free ignored maps
|
||||
ii) if skip event, flush cache now
|
||||
*/
|
||||
if (e->get_flags(Rows_log_event::STMT_END_F))
|
||||
{
|
||||
/*
|
||||
Now is safe to clear ignored map (clear_tables will also
|
||||
delete original table map events stored in the map).
|
||||
*/
|
||||
if (print_event_info->m_table_map_ignored.count() > 0)
|
||||
print_event_info->m_table_map_ignored.clear_tables();
|
||||
|
||||
/*
|
||||
One needs to take into account an event that gets
|
||||
filtered but was last event in the statement. If this is
|
||||
the case, previous rows events that were written into
|
||||
IO_CACHEs still need to be copied from cache to
|
||||
result_file (as it would happen in ev->print(...) if
|
||||
event was not skipped).
|
||||
*/
|
||||
if (skip_event)
|
||||
{
|
||||
if ((copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, result_file) ||
|
||||
copy_event_cache_to_file_and_reinit(&print_event_info->body_cache, result_file)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
/* skip the event check */
|
||||
if (skip_event)
|
||||
goto end;
|
||||
}
|
||||
/*
|
||||
These events must be printed in base64 format, if printed.
|
||||
base64 format requires a FD event to be safe, so if no FD
|
||||
@ -900,6 +950,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
||||
goto err;
|
||||
}
|
||||
/* FALL THROUGH */
|
||||
}
|
||||
default:
|
||||
ev->print(result_file, print_event_info);
|
||||
}
|
||||
@ -919,7 +970,8 @@ end:
|
||||
{
|
||||
if (remote_opt)
|
||||
ev->temp_buf= 0;
|
||||
delete ev;
|
||||
if (destroy_evt) /* destroy it later if not set (ignored table map) */
|
||||
delete ev;
|
||||
}
|
||||
DBUG_RETURN(retval);
|
||||
}
|
||||
@ -934,10 +986,13 @@ static struct my_option my_long_options[] =
|
||||
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 "
|
||||
"statements: 'never' disables it and works only for binlogs without "
|
||||
"row-based events; 'auto' is the default and prints base64 only when "
|
||||
"necessary (i.e., for row-based events and format description events); "
|
||||
"'decode-rows' suppresses BINLOG statements for row events, but does "
|
||||
"not exit as an error if a row event is found, unlike 'never'; "
|
||||
"'always' prints base64 whenever possible. 'always' is for debugging "
|
||||
"only and should not be used in a production system. The default is "
|
||||
"'auto'. --base64-output is a short form for --base64-output=always."
|
||||
@ -1226,6 +1281,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
one_database = 1;
|
||||
break;
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; // Don't require password
|
||||
if (argument)
|
||||
{
|
||||
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
|
||||
@ -1529,8 +1586,7 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
If reading from a remote host, ensure the temp_buf for the
|
||||
Log_event class is pointing to the incoming stream.
|
||||
*/
|
||||
if (remote_opt)
|
||||
ev->register_temp_buf((char*) net->read_pos + 1);
|
||||
ev->register_temp_buf((char *) net->read_pos + 1);
|
||||
|
||||
Log_event_type type= ev->get_type_code();
|
||||
if (glob_description_event->binlog_version >= 3 ||
|
||||
|
@ -286,6 +286,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
what_to_do= DO_UPGRADE;
|
||||
break;
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; /* Don't require password */
|
||||
if (argument)
|
||||
{
|
||||
char *start = argument;
|
||||
|
@ -221,7 +221,7 @@ static struct my_option my_long_options[] =
|
||||
(uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compact", OPT_COMPACT,
|
||||
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks",
|
||||
"Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --skip-add-locks --skip-comments --skip-disable-keys --skip-set-charset",
|
||||
(uchar**) &opt_compact, (uchar**) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"complete-insert", 'c', "Use complete insert statements.",
|
||||
@ -702,6 +702,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; /* Don't require password */
|
||||
if (argument)
|
||||
{
|
||||
char *start=argument;
|
||||
@ -1395,18 +1397,19 @@ static char *cover_definer_clause_in_sp(const char *def_str,
|
||||
SYNOPSIS
|
||||
open_sql_file_for_table
|
||||
name name of the table or view
|
||||
flags flags (as per "man 2 open")
|
||||
|
||||
RETURN VALUES
|
||||
0 Failed to open file
|
||||
> 0 Handle of the open file
|
||||
*/
|
||||
static FILE* open_sql_file_for_table(const char* table)
|
||||
static FILE* open_sql_file_for_table(const char* table, int flags)
|
||||
{
|
||||
FILE* res;
|
||||
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
|
||||
convert_dirname(tmp_path,path,NullS);
|
||||
res= my_fopen(fn_format(filename, table, tmp_path, ".sql", 4),
|
||||
O_WRONLY, MYF(MY_WME));
|
||||
flags, MYF(MY_WME));
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -2288,7 +2291,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
||||
|
||||
if (path)
|
||||
{
|
||||
if (!(sql_file= open_sql_file_for_table(table)))
|
||||
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
|
||||
DBUG_RETURN(0);
|
||||
|
||||
write_header(sql_file, db);
|
||||
@ -2499,7 +2502,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
||||
{
|
||||
if (path)
|
||||
{
|
||||
if (!(sql_file= open_sql_file_for_table(table)))
|
||||
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
|
||||
DBUG_RETURN(0);
|
||||
write_header(sql_file, db);
|
||||
}
|
||||
@ -2723,12 +2726,10 @@ continue_xml:
|
||||
DBUG_RETURN((uint) num_fields);
|
||||
} /* get_table_structure */
|
||||
|
||||
static void dump_trigger_old(MYSQL_RES *show_triggers_rs,
|
||||
static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs,
|
||||
MYSQL_ROW *show_trigger_row,
|
||||
const char *table_name)
|
||||
{
|
||||
FILE *sql_file= md_result_file;
|
||||
|
||||
char quoted_table_name_buf[NAME_LEN * 2 + 3];
|
||||
char *quoted_table_name= quote_name(table_name, quoted_table_name_buf, 1);
|
||||
|
||||
@ -2794,11 +2795,10 @@ static void dump_trigger_old(MYSQL_RES *show_triggers_rs,
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
static int dump_trigger(MYSQL_RES *show_create_trigger_rs,
|
||||
static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs,
|
||||
const char *db_name,
|
||||
const char *db_cl_name)
|
||||
{
|
||||
FILE *sql_file= md_result_file;
|
||||
MYSQL_ROW row;
|
||||
int db_cl_altered= FALSE;
|
||||
|
||||
@ -2862,22 +2862,28 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
|
||||
uint old_opt_compatible_mode= opt_compatible_mode;
|
||||
MYSQL_RES *show_triggers_rs;
|
||||
MYSQL_ROW row;
|
||||
FILE *sql_file= md_result_file;
|
||||
|
||||
char db_cl_name[MY_CS_NAME_SIZE];
|
||||
int ret= TRUE;
|
||||
|
||||
DBUG_ENTER("dump_triggers_for_table");
|
||||
DBUG_PRINT("enter", ("db: %s, table_name: %s", db_name, table_name));
|
||||
|
||||
if (path && !(sql_file= open_sql_file_for_table(table_name,
|
||||
O_WRONLY | O_APPEND)))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
/* Do not use ANSI_QUOTES on triggers in dump */
|
||||
opt_compatible_mode&= ~MASK_ANSI_QUOTES;
|
||||
|
||||
/* Get database collation. */
|
||||
|
||||
if (switch_character_set_results(mysql, "binary"))
|
||||
DBUG_RETURN(TRUE);
|
||||
goto done;
|
||||
|
||||
if (fetch_db_collation(db_name, db_cl_name, sizeof (db_cl_name)))
|
||||
DBUG_RETURN(TRUE);
|
||||
goto done;
|
||||
|
||||
/* Get list of triggers. */
|
||||
|
||||
@ -2886,7 +2892,7 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
|
||||
quote_for_like(table_name, name_buff));
|
||||
|
||||
if (mysql_query_with_error_report(mysql, &show_triggers_rs, query_buff))
|
||||
DBUG_RETURN(TRUE);
|
||||
goto done;
|
||||
|
||||
/* Dump triggers. */
|
||||
|
||||
@ -2907,17 +2913,15 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
|
||||
provide all the necessary information to restore trigger properly.
|
||||
*/
|
||||
|
||||
dump_trigger_old(show_triggers_rs, &row, table_name);
|
||||
dump_trigger_old(sql_file, show_triggers_rs, &row, table_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
MYSQL_RES *show_create_trigger_rs= mysql_store_result(mysql);
|
||||
|
||||
if (!show_create_trigger_rs ||
|
||||
dump_trigger(show_create_trigger_rs, db_name, db_cl_name))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
dump_trigger(sql_file, show_create_trigger_rs, db_name, db_cl_name))
|
||||
goto done;
|
||||
|
||||
mysql_free_result(show_create_trigger_rs);
|
||||
}
|
||||
@ -2927,7 +2931,7 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
|
||||
mysql_free_result(show_triggers_rs);
|
||||
|
||||
if (switch_character_set_results(mysql, default_charset))
|
||||
DBUG_RETURN(TRUE);
|
||||
goto done;
|
||||
|
||||
/*
|
||||
make sure to set back opt_compatible mode to
|
||||
@ -2935,7 +2939,13 @@ static int dump_triggers_for_table(char *table_name, char *db_name)
|
||||
*/
|
||||
opt_compatible_mode=old_opt_compatible_mode;
|
||||
|
||||
DBUG_RETURN(FALSE);
|
||||
ret= FALSE;
|
||||
|
||||
done:
|
||||
if (path)
|
||||
my_fclose(sql_file, MYF(0));
|
||||
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
|
||||
static void add_load_option(DYNAMIC_STRING *str, const char *option,
|
||||
@ -3811,6 +3821,10 @@ static int dump_all_databases()
|
||||
return 1;
|
||||
while ((row= mysql_fetch_row(tableres)))
|
||||
{
|
||||
if (mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], "information_schema"))
|
||||
continue;
|
||||
|
||||
if (dump_all_tables_in_db(row[0]))
|
||||
result=1;
|
||||
}
|
||||
@ -3825,6 +3839,10 @@ static int dump_all_databases()
|
||||
}
|
||||
while ((row= mysql_fetch_row(tableres)))
|
||||
{
|
||||
if (mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, row[0], "information_schema"))
|
||||
continue;
|
||||
|
||||
if (dump_all_views_in_db(row[0]))
|
||||
result=1;
|
||||
}
|
||||
@ -3931,10 +3949,6 @@ int init_dumping_tables(char *qdatabase)
|
||||
|
||||
static int init_dumping(char *database, int init_func(char*))
|
||||
{
|
||||
if (mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, database, "information_schema"))
|
||||
return 1;
|
||||
|
||||
if (mysql_select_db(mysql, database))
|
||||
{
|
||||
DB_error(mysql, "when selecting the database");
|
||||
@ -3993,6 +4007,7 @@ static int dump_all_tables_in_db(char *database)
|
||||
DBUG_RETURN(1);
|
||||
if (opt_xml)
|
||||
print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS);
|
||||
|
||||
if (lock_tables)
|
||||
{
|
||||
DYNAMIC_STRING query;
|
||||
@ -4226,7 +4241,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
||||
}
|
||||
end= pos;
|
||||
|
||||
if (lock_tables)
|
||||
/* Can't LOCK TABLES in INFORMATION_SCHEMA, so don't try. */
|
||||
if (lock_tables &&
|
||||
!(mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, db, "information_schema")))
|
||||
{
|
||||
if (mysql_real_query(mysql, lock_tables_query.str,
|
||||
lock_tables_query.length-1))
|
||||
@ -4780,7 +4798,7 @@ static my_bool get_view_structure(char *table, char* db)
|
||||
/* If requested, open separate .sql file for this view */
|
||||
if (path)
|
||||
{
|
||||
if (!(sql_file= open_sql_file_for_table(table)))
|
||||
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
write_header(sql_file, db);
|
||||
|
@ -221,6 +221,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; /* Don't require password */
|
||||
if (argument)
|
||||
{
|
||||
char *start=argument;
|
||||
|
@ -281,6 +281,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
opt_verbose++;
|
||||
break;
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; /* Don't require password */
|
||||
if (argument)
|
||||
{
|
||||
char *start=argument;
|
||||
|
@ -712,6 +712,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
verbose++;
|
||||
break;
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; /* Don't require password */
|
||||
if (argument)
|
||||
{
|
||||
char *start= argument;
|
||||
|
@ -280,6 +280,7 @@ enum enum_commands {
|
||||
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
|
||||
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
|
||||
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
|
||||
Q_MOVE_FILE,
|
||||
|
||||
Q_UNKNOWN, /* Unknown command. */
|
||||
Q_COMMENT, /* Comments, ignored. */
|
||||
@ -376,6 +377,7 @@ const char *command_names[]=
|
||||
"list_files_append_file",
|
||||
"send_shutdown",
|
||||
"shutdown_server",
|
||||
"move_file",
|
||||
|
||||
0
|
||||
};
|
||||
@ -966,6 +968,7 @@ void check_command_args(struct st_command *command,
|
||||
for (i= 0; i < num_args; i++)
|
||||
{
|
||||
const struct command_arg *arg= &args[i];
|
||||
char delimiter;
|
||||
|
||||
switch (arg->type) {
|
||||
/* A string */
|
||||
@ -974,8 +977,15 @@ void check_command_args(struct st_command *command,
|
||||
while (*ptr && *ptr == ' ')
|
||||
ptr++;
|
||||
start= ptr;
|
||||
/* Find end of arg, terminated by "delimiter_arg" */
|
||||
while (*ptr && *ptr != delimiter_arg)
|
||||
delimiter = delimiter_arg;
|
||||
/* If start of arg is ' ` or " search to matching quote end instead */
|
||||
if (*ptr && strchr ("'`\"", *ptr))
|
||||
{
|
||||
delimiter= *ptr;
|
||||
start= ++ptr;
|
||||
}
|
||||
/* Find end of arg, terminated by "delimiter" */
|
||||
while (*ptr && *ptr != delimiter)
|
||||
ptr++;
|
||||
if (ptr > start)
|
||||
{
|
||||
@ -987,6 +997,11 @@ void check_command_args(struct st_command *command,
|
||||
/* Empty string */
|
||||
init_dynamic_string(arg->ds, "", 0, 0);
|
||||
}
|
||||
/* Find real end of arg, terminated by "delimiter_arg" */
|
||||
/* This will do nothing if arg was not closed by quotes */
|
||||
while (*ptr && *ptr != delimiter_arg)
|
||||
ptr++;
|
||||
|
||||
command->last_argument= (char*)ptr;
|
||||
|
||||
/* Step past the delimiter */
|
||||
@ -1445,7 +1460,6 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
||||
Test if diff is present. This is needed on Windows systems
|
||||
as the OS returns 1 whether diff is successful or if it is
|
||||
not present.
|
||||
Takes name of diff program as argument
|
||||
|
||||
We run diff -v and look for output in stdout.
|
||||
We don't redirect stderr to stdout to make for a simplified check
|
||||
@ -1453,26 +1467,31 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...)
|
||||
not present.
|
||||
*/
|
||||
|
||||
int diff_check (const char *diff_name)
|
||||
#ifdef __WIN__
|
||||
|
||||
static int diff_check(const char *diff_name)
|
||||
{
|
||||
char buf[512]= {0};
|
||||
FILE *res_file;
|
||||
char cmd[128];
|
||||
my_snprintf (cmd, sizeof(cmd), "%s -v", diff_name);
|
||||
int have_diff = 0;
|
||||
FILE *res_file;
|
||||
char buf[128];
|
||||
int have_diff= 0;
|
||||
|
||||
if (!(res_file= popen(cmd, "r")))
|
||||
die("popen(\"%s\", \"r\") failed", cmd);
|
||||
my_snprintf(buf, sizeof(buf), "%s -v", diff_name);
|
||||
|
||||
/* if diff is not present, nothing will be in stdout to increment have_diff */
|
||||
if (fgets(buf, sizeof(buf), res_file))
|
||||
{
|
||||
have_diff += 1;
|
||||
}
|
||||
pclose(res_file);
|
||||
return have_diff;
|
||||
if (!(res_file= popen(buf, "r")))
|
||||
die("popen(\"%s\", \"r\") failed", buf);
|
||||
|
||||
/* if diff is not present, nothing will be in stdout to increment have_diff */
|
||||
if (fgets(buf, sizeof(buf), res_file))
|
||||
have_diff= 1;
|
||||
|
||||
pclose(res_file);
|
||||
|
||||
return have_diff;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Show the diff of two files using the systems builtin diff
|
||||
command. If no such diff command exist, just dump the content
|
||||
@ -1794,7 +1813,7 @@ void check_result()
|
||||
log_file.file_name(), reject_file, errno);
|
||||
|
||||
show_diff(NULL, result_file_name, reject_file);
|
||||
die(mess);
|
||||
die("%s", mess);
|
||||
break;
|
||||
}
|
||||
default: /* impossible */
|
||||
@ -2889,6 +2908,42 @@ void do_copy_file(struct st_command *command)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
SYNOPSIS
|
||||
do_move_file
|
||||
command command handle
|
||||
|
||||
DESCRIPTION
|
||||
move_file <from_file> <to_file>
|
||||
Move <from_file> to <to_file>
|
||||
*/
|
||||
|
||||
void do_move_file(struct st_command *command)
|
||||
{
|
||||
int error;
|
||||
static DYNAMIC_STRING ds_from_file;
|
||||
static DYNAMIC_STRING ds_to_file;
|
||||
const struct command_arg move_file_args[] = {
|
||||
{ "from_file", ARG_STRING, TRUE, &ds_from_file, "Filename to move from" },
|
||||
{ "to_file", ARG_STRING, TRUE, &ds_to_file, "Filename to move to" }
|
||||
};
|
||||
DBUG_ENTER("do_move_file");
|
||||
|
||||
check_command_args(command, command->first_argument,
|
||||
move_file_args,
|
||||
sizeof(move_file_args)/sizeof(struct command_arg),
|
||||
' ');
|
||||
|
||||
DBUG_PRINT("info", ("Move %s to %s", ds_from_file.str, ds_to_file.str));
|
||||
error= (my_rename(ds_from_file.str, ds_to_file.str,
|
||||
MYF(0)) != 0);
|
||||
handle_command_error(command, error);
|
||||
dynstr_free(&ds_from_file);
|
||||
dynstr_free(&ds_to_file);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
SYNOPSIS
|
||||
do_chmod_file
|
||||
@ -4546,7 +4601,7 @@ void select_connection(struct st_command *command)
|
||||
};
|
||||
check_command_args(command, command->first_argument, connection_args,
|
||||
sizeof(connection_args)/sizeof(struct command_arg),
|
||||
',');
|
||||
' ');
|
||||
|
||||
DBUG_PRINT("info", ("changing connection: %s", ds_connection.str));
|
||||
select_connection_name(ds_connection.str);
|
||||
@ -5665,11 +5720,11 @@ static struct my_option my_long_options[] =
|
||||
{"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select",
|
||||
(uchar**) &sp_protocol, (uchar**) &sp_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include "sslopt-longopts.h"
|
||||
{"tail-lines", OPT_TAIL_LINES,
|
||||
"Number of lines of the resul to include in a failure report",
|
||||
(uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0,
|
||||
GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
|
||||
#include "sslopt-longopts.h"
|
||||
{"test-file", 'x', "Read test from/in this file (default stdin).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"timer-file", 'm', "File where the timing in micro seconds is stored.",
|
||||
@ -5803,6 +5858,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
break;
|
||||
}
|
||||
case 'p':
|
||||
if (argument == disabled_my_option)
|
||||
argument= (char*) ""; // Don't require password
|
||||
if (argument)
|
||||
{
|
||||
my_free(opt_pass, MYF(MY_ALLOW_ZERO_PTR));
|
||||
@ -7678,6 +7735,7 @@ int main(int argc, char **argv)
|
||||
case Q_CHANGE_USER: do_change_user(command); break;
|
||||
case Q_CAT_FILE: do_cat_file(command); break;
|
||||
case Q_COPY_FILE: do_copy_file(command); break;
|
||||
case Q_MOVE_FILE: do_move_file(command); break;
|
||||
case Q_CHMOD_FILE: do_chmod_file(command); break;
|
||||
case Q_PERL: do_perl(command); break;
|
||||
case Q_DELIMITER:
|
||||
|
@ -31,7 +31,7 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
|
||||
|
||||
EXTRA_DIST= emacs_keymap.c vi_keymap.c
|
||||
|
||||
DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -79,7 +79,7 @@ static int _rl_read_init_file PARAMS((const char *, int));
|
||||
static int glean_key_from_name PARAMS((char *));
|
||||
static int find_boolean_var PARAMS((const char *));
|
||||
|
||||
static char *_rl_get_string_variable_value PARAMS((const char *));
|
||||
static const char *_rl_get_string_variable_value PARAMS((const char *));
|
||||
static int substring_member_of_array PARAMS((char *, const char **));
|
||||
|
||||
static int currently_reading_init_file;
|
||||
@ -442,7 +442,7 @@ rl_translate_keyseq (seq, array, len)
|
||||
{
|
||||
register int i, c, l, temp;
|
||||
|
||||
for (i = l = 0; c = seq[i]; i++)
|
||||
for (i = l = 0; (c = seq[i]); i++)
|
||||
{
|
||||
if (c == '\\')
|
||||
{
|
||||
@ -701,7 +701,7 @@ rl_function_of_keyseq (keyseq, map, type)
|
||||
{
|
||||
unsigned char ic = keyseq[i];
|
||||
|
||||
if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
|
||||
if (META_CHAR_FOR_UCHAR (ic) && _rl_convert_meta_chars_to_ascii)
|
||||
{
|
||||
if (map[ESC].type == ISKMAP)
|
||||
{
|
||||
@ -776,7 +776,8 @@ _rl_read_file (filename, sizep)
|
||||
file_size = (size_t)finfo.st_size;
|
||||
|
||||
/* check for overflow on very large files */
|
||||
if (file_size != finfo.st_size || file_size + 1 < file_size)
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
file_size + 1 < file_size)
|
||||
{
|
||||
if (file >= 0)
|
||||
close (file);
|
||||
@ -807,7 +808,7 @@ _rl_read_file (filename, sizep)
|
||||
/* Re-read the current keybindings file. */
|
||||
int
|
||||
rl_re_read_init_file (count, ignore)
|
||||
int count, ignore;
|
||||
int count __attribute__((unused)), ignore __attribute__((unused));
|
||||
{
|
||||
int r;
|
||||
r = rl_read_init_file ((const char *)NULL);
|
||||
@ -1031,7 +1032,7 @@ parser_if (args)
|
||||
/* Invert the current parser state if there is anything on the stack. */
|
||||
static int
|
||||
parser_else (args)
|
||||
char *args;
|
||||
char *args __attribute__((unused));
|
||||
{
|
||||
register int i;
|
||||
|
||||
@ -1062,7 +1063,7 @@ parser_else (args)
|
||||
_rl_parsing_conditionalized_out from the stack. */
|
||||
static int
|
||||
parser_endif (args)
|
||||
char *args;
|
||||
char *args __attribute__((unused));
|
||||
{
|
||||
if (if_stack_depth)
|
||||
_rl_parsing_conditionalized_out = if_stack[--if_stack_depth];
|
||||
@ -1185,7 +1186,7 @@ rl_parse_and_bind (string)
|
||||
{
|
||||
int passc = 0;
|
||||
|
||||
for (i = 1; c = string[i]; i++)
|
||||
for (i = 1; (c = string[i]); i++)
|
||||
{
|
||||
if (passc)
|
||||
{
|
||||
@ -1276,7 +1277,7 @@ rl_parse_and_bind (string)
|
||||
int delimiter, passc;
|
||||
|
||||
delimiter = string[i++];
|
||||
for (passc = 0; c = string[i]; i++)
|
||||
for (passc = 0; (c = string[i]); i++)
|
||||
{
|
||||
if (passc)
|
||||
{
|
||||
@ -1436,7 +1437,7 @@ static struct {
|
||||
#if defined (VISIBLE_STATS)
|
||||
{ "visible-stats", &rl_visible_stats, 0 },
|
||||
#endif /* VISIBLE_STATS */
|
||||
{ (char *)NULL, (int *)NULL }
|
||||
{ (char *)NULL, (int *)NULL, 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
@ -1505,7 +1506,7 @@ static struct {
|
||||
{ "editing-mode", V_STRING, sv_editmode },
|
||||
{ "isearch-terminators", V_STRING, sv_isrchterm },
|
||||
{ "keymap", V_STRING, sv_keymap },
|
||||
{ (char *)NULL, 0 }
|
||||
{ (char *)NULL, 0, (_rl_sv_func_t*)NULL }
|
||||
};
|
||||
|
||||
static int
|
||||
@ -1532,7 +1533,7 @@ bool_to_int (value)
|
||||
(value[0] == '1' && value[1] == '\0'));
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
rl_variable_value (name)
|
||||
const char *name;
|
||||
{
|
||||
@ -1799,7 +1800,7 @@ rl_set_keymap_from_edit_mode ()
|
||||
#endif /* VI_MODE */
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
rl_get_keymap_name_from_edit_mode ()
|
||||
{
|
||||
if (rl_editing_mode == emacs_mode)
|
||||
@ -2048,7 +2049,7 @@ rl_function_dumper (print_readably)
|
||||
|
||||
fprintf (rl_outstream, "\n");
|
||||
|
||||
for (i = 0; name = names[i]; i++)
|
||||
for (i = 0; (name = names[i]); i++)
|
||||
{
|
||||
rl_command_func_t *function;
|
||||
char **invokers;
|
||||
@ -2108,7 +2109,7 @@ rl_function_dumper (print_readably)
|
||||
the output in such a way that it can be read back in. */
|
||||
int
|
||||
rl_dump_functions (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
if (rl_dispatching)
|
||||
fprintf (rl_outstream, "\r\n");
|
||||
@ -2188,7 +2189,7 @@ rl_macro_dumper (print_readably)
|
||||
|
||||
int
|
||||
rl_dump_macros (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
if (rl_dispatching)
|
||||
fprintf (rl_outstream, "\r\n");
|
||||
@ -2197,12 +2198,13 @@ rl_dump_macros (count, key)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
_rl_get_string_variable_value (name)
|
||||
const char *name;
|
||||
{
|
||||
static char numbuf[32];
|
||||
char *ret;
|
||||
const char *ret;
|
||||
char *tmp;
|
||||
|
||||
if (_rl_stricmp (name, "bell-style") == 0)
|
||||
{
|
||||
@ -2230,11 +2232,11 @@ _rl_get_string_variable_value (name)
|
||||
{
|
||||
if (_rl_isearch_terminators == 0)
|
||||
return 0;
|
||||
ret = _rl_untranslate_macro_value (_rl_isearch_terminators);
|
||||
if (ret)
|
||||
tmp = _rl_untranslate_macro_value (_rl_isearch_terminators);
|
||||
if (tmp)
|
||||
{
|
||||
strncpy (numbuf, ret, sizeof (numbuf) - 1);
|
||||
free (ret);
|
||||
strncpy (numbuf, tmp, sizeof (numbuf) - 1);
|
||||
free (tmp);
|
||||
numbuf[sizeof(numbuf) - 1] = '\0';
|
||||
}
|
||||
else
|
||||
@ -2257,7 +2259,7 @@ rl_variable_dumper (print_readably)
|
||||
int print_readably;
|
||||
{
|
||||
int i;
|
||||
char *v;
|
||||
const char *v;
|
||||
|
||||
for (i = 0; boolean_varlist[i].name; i++)
|
||||
{
|
||||
@ -2286,7 +2288,7 @@ rl_variable_dumper (print_readably)
|
||||
the output in such a way that it can be read back in. */
|
||||
int
|
||||
rl_dump_variables (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
if (rl_dispatching)
|
||||
fprintf (rl_outstream, "\r\n");
|
||||
|
@ -59,7 +59,8 @@
|
||||
#define largest_char 255 /* Largest character value. */
|
||||
|
||||
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
|
||||
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
|
||||
#define META_CHAR_FOR_UCHAR(c) ((c) > meta_character_threshold)
|
||||
#define META_CHAR(c) (META_CHAR_FOR_UCHAR(c) && (c) <= largest_char)
|
||||
|
||||
#define CTRL(c) ((c) & control_character_mask)
|
||||
#define META(c) ((c) | meta_character_bit)
|
||||
|
@ -359,14 +359,14 @@ rl_complete (ignore, invoking_key)
|
||||
/* List the possible completions. See description of rl_complete (). */
|
||||
int
|
||||
rl_possible_completions (ignore, invoking_key)
|
||||
int ignore, invoking_key;
|
||||
int ignore __attribute__((unused)), invoking_key __attribute__((unused));
|
||||
{
|
||||
return (rl_complete_internal ('?'));
|
||||
}
|
||||
|
||||
int
|
||||
rl_insert_completions (ignore, invoking_key)
|
||||
int ignore, invoking_key;
|
||||
int ignore __attribute__((unused)), invoking_key __attribute__((unused));
|
||||
{
|
||||
return (rl_complete_internal ('*'));
|
||||
}
|
||||
@ -696,7 +696,8 @@ print_filename (to_print, full_pathname)
|
||||
char *to_print, *full_pathname;
|
||||
{
|
||||
int printed_len, extension_char, slen, tlen;
|
||||
char *s, c, *new_full_pathname, *dn;
|
||||
char *s, c, *new_full_pathname;
|
||||
const char *dn;
|
||||
|
||||
extension_char = 0;
|
||||
printed_len = fnprint (to_print);
|
||||
@ -783,7 +784,7 @@ print_filename (to_print, full_pathname)
|
||||
static char *
|
||||
rl_quote_filename (s, rtype, qcp)
|
||||
char *s;
|
||||
int rtype;
|
||||
int rtype __attribute__((unused));
|
||||
char *qcp;
|
||||
{
|
||||
char *r;
|
||||
@ -884,7 +885,7 @@ _rl_find_completion_word (fp, dp)
|
||||
/* We didn't find an unclosed quoted substring upon which to do
|
||||
completion, so use the word break characters to find the
|
||||
substring on which to complete. */
|
||||
while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
|
||||
while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)))
|
||||
{
|
||||
scan = rl_line_buffer[rl_point];
|
||||
|
||||
@ -1803,7 +1804,7 @@ rl_completion_matches (text, entry_function)
|
||||
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
|
||||
match_list[1] = (char *)NULL;
|
||||
|
||||
while (string = (*entry_function) (text, matches))
|
||||
while ((string = (*entry_function) (text, matches)))
|
||||
{
|
||||
if (matches + 1 == match_list_size)
|
||||
match_list = (char **)xrealloc
|
||||
@ -2111,7 +2112,7 @@ rl_filename_completion_function (text, state)
|
||||
ring the bell, and reset the counter to zero. */
|
||||
int
|
||||
rl_menu_complete (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
rl_compentry_func_t *our_func;
|
||||
int matching_filenames, found_quote;
|
||||
|
@ -127,7 +127,7 @@ int _rl_want_redisplay = 0;
|
||||
|
||||
/* The stuff that gets printed out before the actual text of the line.
|
||||
This is usually pointing to rl_prompt. */
|
||||
char *rl_display_prompt = (char *)NULL;
|
||||
const char *rl_display_prompt = (const char *)NULL;
|
||||
|
||||
/* Pseudo-global variables declared here. */
|
||||
|
||||
@ -229,7 +229,10 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
|
||||
int *lp, *lip, *niflp, *vlp;
|
||||
{
|
||||
char *r, *ret, *p, *igstart;
|
||||
int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars;
|
||||
int l, rl, last, ignoring, ninvis, invfl, invflset, physchars;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
int ind, pind;
|
||||
#endif
|
||||
|
||||
/* Short-circuit if we can. */
|
||||
if ((MB_CUR_MAX <= 1 || rl_byte_oriented) && strchr (pmt, RL_PROMPT_START_IGNORE) == 0)
|
||||
@ -242,7 +245,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
|
||||
if (niflp)
|
||||
*niflp = 0;
|
||||
if (vlp)
|
||||
*vlp = lp ? *lp : strlen (r);
|
||||
*vlp = lp ? *lp : (int)strlen (r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -459,9 +462,10 @@ rl_redisplay ()
|
||||
register int in, out, c, linenum, cursor_linenum;
|
||||
register char *line;
|
||||
int inv_botlin, lb_botlin, lb_linenum, o_cpos;
|
||||
int newlines, lpos, temp, modmark, n0, num;
|
||||
char *prompt_this_line;
|
||||
int newlines, lpos, temp, modmark;
|
||||
const char *prompt_this_line;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
int num, n0;
|
||||
wchar_t wc;
|
||||
size_t wc_bytes;
|
||||
int wc_width;
|
||||
@ -626,7 +630,6 @@ rl_redisplay ()
|
||||
contents of the command line? */
|
||||
while (lpos >= _rl_screenwidth)
|
||||
{
|
||||
int z;
|
||||
/* fix from Darin Johnson <darin@acuson.com> for prompt string with
|
||||
invisible characters that is longer than the screen width. The
|
||||
prompt_invis_chars_first_line variable could be made into an array
|
||||
@ -635,6 +638,7 @@ rl_redisplay ()
|
||||
prompts that exceed two physical lines?
|
||||
Additional logic fix from Edward Catmur <ed@catmur.co.uk> */
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
int z;
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
{
|
||||
n0 = num;
|
||||
@ -878,6 +882,7 @@ rl_redisplay ()
|
||||
if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up)
|
||||
{
|
||||
int nleft, pos, changed_screen_line, tx;
|
||||
char empty_str[1] = { 0 };
|
||||
|
||||
if (!rl_display_fixed || forced_display)
|
||||
{
|
||||
@ -902,7 +907,7 @@ rl_redisplay ()
|
||||
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
|
||||
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
|
||||
#define VIS_CHARS(line) (visible_line + vis_lbreaks[line])
|
||||
#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line)
|
||||
#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? empty_str : VIS_CHARS(line)
|
||||
#define INV_LINE(line) (invisible_line + inv_lbreaks[line])
|
||||
|
||||
/* For each line in the buffer, do the updating display. */
|
||||
@ -969,7 +974,7 @@ rl_redisplay ()
|
||||
_rl_move_vert (linenum);
|
||||
_rl_move_cursor_relative (0, tt);
|
||||
_rl_clear_to_eol
|
||||
((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth);
|
||||
((linenum == _rl_vis_botlin) ? (int)strlen (tt) : _rl_screenwidth);
|
||||
}
|
||||
}
|
||||
_rl_vis_botlin = inv_botlin;
|
||||
@ -1888,7 +1893,7 @@ rl_character_len (c, pos)
|
||||
|
||||
uc = (unsigned char)c;
|
||||
|
||||
if (META_CHAR (uc))
|
||||
if (META_CHAR_FOR_UCHAR (uc))
|
||||
return ((_rl_output_meta_chars == 0) ? 4 : 1);
|
||||
|
||||
if (uc == '\t')
|
||||
@ -2261,7 +2266,7 @@ static void
|
||||
redraw_prompt (t)
|
||||
char *t;
|
||||
{
|
||||
char *oldp;
|
||||
const char *oldp;
|
||||
|
||||
oldp = rl_display_prompt;
|
||||
rl_save_prompt ();
|
||||
|
@ -87,14 +87,14 @@ char history_comment_char = '\0';
|
||||
|
||||
/* The list of characters which inhibit the expansion of text if found
|
||||
immediately following history_expansion_char. */
|
||||
char *history_no_expand_chars = " \t\n\r=";
|
||||
const char *history_no_expand_chars = " \t\n\r=";
|
||||
|
||||
/* If set to a non-zero value, single quotes inhibit history expansion.
|
||||
The default is 0. */
|
||||
int history_quotes_inhibit_expansion = 0;
|
||||
|
||||
/* Used to split words by history_tokenize_internal. */
|
||||
char *history_word_delimiters = HISTORY_WORD_DELIMITERS;
|
||||
const char *history_word_delimiters = HISTORY_WORD_DELIMITERS;
|
||||
|
||||
/* If set, this points to a function that is called to verify that a
|
||||
particular history expansion should be performed. */
|
||||
@ -203,7 +203,7 @@ get_history_event (string, caller_index, delimiting_quote)
|
||||
}
|
||||
|
||||
/* Only a closing `?' or a newline delimit a substring search string. */
|
||||
for (local_index = i; c = string[i]; i++)
|
||||
for (local_index = i; (c = string[i]); i++)
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
|
@ -186,7 +186,8 @@ read_history_range (filename, from, to)
|
||||
file_size = (size_t)finfo.st_size;
|
||||
|
||||
/* check for overflow on very large files */
|
||||
if (file_size != finfo.st_size || file_size + 1 < file_size)
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
file_size + 1 < file_size)
|
||||
{
|
||||
errno = overflow_errno;
|
||||
goto error_and_exit;
|
||||
@ -339,7 +340,8 @@ history_truncate_file (fname, lines)
|
||||
file_size = (size_t)finfo.st_size;
|
||||
|
||||
/* check for overflow on very large files */
|
||||
if (file_size != finfo.st_size || file_size + 1 < file_size)
|
||||
if ((sizeof(off_t) > sizeof(size_t) && finfo.st_size > (off_t)(size_t)~0) ||
|
||||
file_size + 1 < file_size)
|
||||
{
|
||||
close (file);
|
||||
#if defined (EFBIG)
|
||||
|
@ -243,9 +243,9 @@ extern int history_length;
|
||||
extern int history_max_entries;
|
||||
extern char history_expansion_char;
|
||||
extern char history_subst_char;
|
||||
extern char *history_word_delimiters;
|
||||
extern const char *history_word_delimiters;
|
||||
extern char history_comment_char;
|
||||
extern char *history_no_expand_chars;
|
||||
extern const char *history_no_expand_chars;
|
||||
extern char *history_search_delimiter_chars;
|
||||
extern int history_quotes_inhibit_expansion;
|
||||
|
||||
|
@ -420,7 +420,7 @@ rl_read_key ()
|
||||
else
|
||||
{
|
||||
/* If input is coming from a macro, then use that. */
|
||||
if (c = _rl_next_macro_key ())
|
||||
if ((c = _rl_next_macro_key ()))
|
||||
return (c);
|
||||
|
||||
/* If the user has an event function, then call it periodically. */
|
||||
|
@ -75,7 +75,7 @@ static int _rl_isearch_cleanup PARAMS((_rl_search_cxt *, int));
|
||||
static char *last_isearch_string;
|
||||
static int last_isearch_string_len;
|
||||
|
||||
static char *default_isearch_terminators = "\033\012";
|
||||
static const char *default_isearch_terminators = "\033\012";
|
||||
|
||||
_rl_search_cxt *
|
||||
_rl_scxt_alloc (type, flags)
|
||||
@ -119,7 +119,7 @@ _rl_scxt_alloc (type, flags)
|
||||
void
|
||||
_rl_scxt_dispose (cxt, flags)
|
||||
_rl_search_cxt *cxt;
|
||||
int flags;
|
||||
int flags __attribute__((unused));
|
||||
{
|
||||
FREE (cxt->search_string);
|
||||
FREE (cxt->allocated_line);
|
||||
@ -154,7 +154,7 @@ rl_forward_search_history (sign, key)
|
||||
static void
|
||||
rl_display_search (search_string, reverse_p, where)
|
||||
char *search_string;
|
||||
int reverse_p, where;
|
||||
int reverse_p, where __attribute__((unused));
|
||||
{
|
||||
char *message;
|
||||
int msglen, searchlen;
|
||||
@ -614,7 +614,7 @@ _rl_isearch_cleanup (cxt, r)
|
||||
backwards. */
|
||||
static int
|
||||
rl_search_history (direction, invoking_key)
|
||||
int direction, invoking_key;
|
||||
int direction, invoking_key __attribute__((unused));
|
||||
{
|
||||
_rl_search_cxt *cxt; /* local for now, but saved globally */
|
||||
int c, r;
|
||||
|
@ -79,7 +79,7 @@ static int rl_yank_nth_arg_internal PARAMS((int, int, int));
|
||||
of kill material. */
|
||||
int
|
||||
rl_set_retained_kills (num)
|
||||
int num;
|
||||
int num __attribute__((unused));
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -296,7 +296,7 @@ rl_backward_kill_line (direction, ignore)
|
||||
/* Kill the whole line, no matter where point is. */
|
||||
int
|
||||
rl_kill_full_line (count, ignore)
|
||||
int count, ignore;
|
||||
int count __attribute__((unused)), ignore __attribute__((unused));
|
||||
{
|
||||
rl_begin_undo_group ();
|
||||
rl_point = 0;
|
||||
@ -314,7 +314,7 @@ rl_kill_full_line (count, ignore)
|
||||
using behaviour that they expect. */
|
||||
int
|
||||
rl_unix_word_rubout (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
int orig_point;
|
||||
|
||||
@ -347,7 +347,7 @@ rl_unix_word_rubout (count, key)
|
||||
deletes backward to directory separator (`/') or whitespace. */
|
||||
int
|
||||
rl_unix_filename_rubout (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
int orig_point, c;
|
||||
|
||||
@ -391,7 +391,7 @@ rl_unix_filename_rubout (count, key)
|
||||
doing. */
|
||||
int
|
||||
rl_unix_line_discard (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
if (rl_point == 0)
|
||||
rl_ding ();
|
||||
@ -428,7 +428,7 @@ region_kill_internal (delete)
|
||||
/* Copy the text in the region to the kill ring. */
|
||||
int
|
||||
rl_copy_region_to_kill (count, ignore)
|
||||
int count, ignore;
|
||||
int count __attribute__((unused)), ignore __attribute__((unused));
|
||||
{
|
||||
return (region_kill_internal (0));
|
||||
}
|
||||
@ -436,7 +436,7 @@ rl_copy_region_to_kill (count, ignore)
|
||||
/* Kill the text between the point and mark. */
|
||||
int
|
||||
rl_kill_region (count, ignore)
|
||||
int count, ignore;
|
||||
int count __attribute__((unused)), ignore __attribute__((unused));
|
||||
{
|
||||
int r, npoint;
|
||||
|
||||
@ -501,7 +501,7 @@ rl_copy_backward_word (count, key)
|
||||
/* Yank back the last killed text. This ignores arguments. */
|
||||
int
|
||||
rl_yank (count, ignore)
|
||||
int count, ignore;
|
||||
int count __attribute__((unused)), ignore __attribute__((unused));
|
||||
{
|
||||
if (rl_kill_ring == 0)
|
||||
{
|
||||
@ -520,7 +520,7 @@ rl_yank (count, ignore)
|
||||
yank back some other text. */
|
||||
int
|
||||
rl_yank_pop (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
int l, n;
|
||||
|
||||
|
@ -201,7 +201,7 @@ _rl_kill_kbd_macro ()
|
||||
re-executing the existing macro. */
|
||||
int
|
||||
rl_start_kbd_macro (ignore1, ignore2)
|
||||
int ignore1, ignore2;
|
||||
int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
|
||||
{
|
||||
if (RL_ISSTATE (RL_STATE_MACRODEF))
|
||||
{
|
||||
@ -226,7 +226,7 @@ rl_start_kbd_macro (ignore1, ignore2)
|
||||
that many times, counting the definition as the first time. */
|
||||
int
|
||||
rl_end_kbd_macro (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
if (RL_ISSTATE (RL_STATE_MACRODEF) == 0)
|
||||
{
|
||||
@ -246,7 +246,7 @@ rl_end_kbd_macro (count, ignore)
|
||||
COUNT says how many times to execute it. */
|
||||
int
|
||||
rl_call_last_kbd_macro (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
if (current_macro == 0)
|
||||
_rl_abort_internal ();
|
||||
|
@ -346,8 +346,8 @@ _rl_char_value (buf, ind)
|
||||
#undef _rl_find_next_mbchar
|
||||
int
|
||||
_rl_find_next_mbchar (string, seed, count, flags)
|
||||
char *string;
|
||||
int seed, count, flags;
|
||||
char *string __attribute__((unused));
|
||||
int seed, count, flags __attribute__((unused));
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
return _rl_find_next_mbchar_internal (string, seed, count, flags);
|
||||
@ -362,8 +362,8 @@ _rl_find_next_mbchar (string, seed, count, flags)
|
||||
#undef _rl_find_prev_mbchar
|
||||
int
|
||||
_rl_find_prev_mbchar (string, seed, flags)
|
||||
char *string;
|
||||
int seed, flags;
|
||||
char *string __attribute__((unused));
|
||||
int seed, flags __attribute__((unused));
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
return _rl_find_prev_mbchar_internal (string, seed, flags);
|
||||
|
@ -228,7 +228,7 @@ _rl_reset_argument ()
|
||||
/* Start a numeric argument with initial value KEY */
|
||||
int
|
||||
rl_digit_argument (ignore, key)
|
||||
int ignore, key;
|
||||
int ignore __attribute__((unused)), key;
|
||||
{
|
||||
_rl_arg_init ();
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
||||
@ -249,7 +249,7 @@ rl_digit_argument (ignore, key)
|
||||
dispatch on it. If the key is the abort character then abort. */
|
||||
int
|
||||
rl_universal_argument (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
_rl_arg_init ();
|
||||
rl_numeric_arg *= 4;
|
||||
@ -413,7 +413,7 @@ _rl_history_set_point ()
|
||||
void
|
||||
rl_replace_from_history (entry, flags)
|
||||
HIST_ENTRY *entry;
|
||||
int flags; /* currently unused */
|
||||
int flags __attribute__((unused)); /* currently unused */
|
||||
{
|
||||
/* Can't call with `1' because rl_undo_list might point to an undo list
|
||||
from a history entry, just like we're setting up here. */
|
||||
@ -440,7 +440,7 @@ rl_replace_from_history (entry, flags)
|
||||
/* Meta-< goes to the start of the history. */
|
||||
int
|
||||
rl_beginning_of_history (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
return (rl_get_previous_history (1 + where_history (), key));
|
||||
}
|
||||
@ -448,7 +448,7 @@ rl_beginning_of_history (count, key)
|
||||
/* Meta-> goes to the end of the history. (The current line). */
|
||||
int
|
||||
rl_end_of_history (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
rl_maybe_replace_line ();
|
||||
using_history ();
|
||||
@ -553,7 +553,7 @@ rl_get_previous_history (count, key)
|
||||
/* How to toggle back and forth between editing modes. */
|
||||
int
|
||||
rl_vi_editing_mode (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
#if defined (VI_MODE)
|
||||
_rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */
|
||||
@ -566,7 +566,7 @@ rl_vi_editing_mode (count, key)
|
||||
|
||||
int
|
||||
rl_emacs_editing_mode (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
rl_editing_mode = emacs_mode;
|
||||
_rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */
|
||||
@ -577,7 +577,7 @@ rl_emacs_editing_mode (count, key)
|
||||
/* Function for the rest of the library to use to set insert/overwrite mode. */
|
||||
void
|
||||
_rl_set_insert_mode (im, force)
|
||||
int im, force;
|
||||
int im, force __attribute__((unused));
|
||||
{
|
||||
#ifdef CURSOR_MODE
|
||||
_rl_set_cursor (im, force);
|
||||
@ -590,7 +590,7 @@ _rl_set_insert_mode (im, force)
|
||||
mode. A negative or zero explicit argument selects insert mode. */
|
||||
int
|
||||
rl_overwrite_mode (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
if (rl_explicit_arg == 0)
|
||||
_rl_set_insert_mode (rl_insert_mode ^ 1, 0);
|
||||
|
@ -101,7 +101,8 @@ _rl_init_eightbit ()
|
||||
/* If we have setlocale(3), just check the current LC_CTYPE category
|
||||
value, and go into eight-bit mode if it's not C or POSIX. */
|
||||
#if defined (HAVE_SETLOCALE)
|
||||
char *lspec, *t;
|
||||
const char *lspec;
|
||||
char *t;
|
||||
|
||||
/* Set the LC_CTYPE locale category from environment variables. */
|
||||
lspec = _rl_get_locale_var ("LC_CTYPE");
|
||||
@ -127,7 +128,8 @@ _rl_init_eightbit ()
|
||||
return (0);
|
||||
|
||||
#else /* !HAVE_SETLOCALE */
|
||||
char *lspec, *t;
|
||||
const char *lspec;
|
||||
char *t;
|
||||
int i;
|
||||
|
||||
/* We don't have setlocale. Finesse it. Check the environment for the
|
||||
|
@ -90,7 +90,7 @@ static void bind_arrow_keys_internal PARAMS((Keymap));
|
||||
static void bind_arrow_keys PARAMS((void));
|
||||
|
||||
static void readline_default_bindings PARAMS((void));
|
||||
static void reset_default_bindings PARAMS((void));
|
||||
static void reset_default_bindings PARAMS((void)) __attribute__((unused));
|
||||
|
||||
static int _rl_subseq_result PARAMS((int, Keymap, int, int));
|
||||
static int _rl_subseq_getchar PARAMS((int));
|
||||
|
@ -304,7 +304,7 @@ extern int rl_bind_keyseq_if_unbound PARAMS((const char *, rl_command_func_t *))
|
||||
extern int rl_bind_keyseq_if_unbound_in_map PARAMS((const char *, rl_command_func_t *, Keymap));
|
||||
extern int rl_generic_bind PARAMS((int, const char *, char *, Keymap));
|
||||
|
||||
extern char *rl_variable_value PARAMS((const char *));
|
||||
extern const char *rl_variable_value PARAMS((const char *));
|
||||
extern int rl_variable_bind PARAMS((const char *, const char *));
|
||||
|
||||
/* Backwards compatibility, use rl_bind_keyseq_in_map instead. */
|
||||
@ -343,7 +343,7 @@ extern void rl_set_keymap PARAMS((Keymap));
|
||||
extern Keymap rl_get_keymap PARAMS((void));
|
||||
/* Undocumented; used internally only. */
|
||||
extern void rl_set_keymap_from_edit_mode PARAMS((void));
|
||||
extern char *rl_get_keymap_name_from_edit_mode PARAMS((void));
|
||||
extern const char *rl_get_keymap_name_from_edit_mode PARAMS((void));
|
||||
|
||||
/* Functions for manipulating the funmap, which maps command names to functions. */
|
||||
extern int rl_add_funmap_entry PARAMS((const char *, rl_command_func_t *));
|
||||
@ -406,7 +406,7 @@ extern void rl_set_screen_size PARAMS((int, int));
|
||||
extern void rl_get_screen_size PARAMS((int *, int *));
|
||||
extern void rl_reset_screen_size PARAMS((void));
|
||||
|
||||
extern char *rl_get_termcap PARAMS((const char *));
|
||||
extern const char *rl_get_termcap PARAMS((const char *));
|
||||
|
||||
/* Functions for character input. */
|
||||
extern int rl_stuff_char PARAMS((int));
|
||||
|
@ -77,7 +77,7 @@ typedef struct __rl_search_context
|
||||
int sline_len;
|
||||
int sline_index;
|
||||
|
||||
char *search_terminators;
|
||||
const char *search_terminators;
|
||||
} _rl_search_cxt;
|
||||
|
||||
/* Callback data for reading numeric arguments */
|
||||
@ -164,7 +164,7 @@ extern int rl_set_retained_kills PARAMS((int));
|
||||
extern void _rl_set_screen_size PARAMS((int, int));
|
||||
|
||||
/* undo.c */
|
||||
extern int _rl_fix_last_undo_of_type PARAMS((int, int, int));
|
||||
extern int _rl_fix_last_undo_of_type PARAMS((enum undo_code, int, int));
|
||||
|
||||
/* util.c */
|
||||
extern char *_rl_savestring PARAMS((const char *));
|
||||
@ -359,7 +359,7 @@ extern int _rl_vis_botlin;
|
||||
extern int _rl_last_c_pos;
|
||||
extern int _rl_suppress_redisplay;
|
||||
extern int _rl_want_redisplay;
|
||||
extern char *rl_display_prompt;
|
||||
extern const char *rl_display_prompt;
|
||||
|
||||
/* isearch.c */
|
||||
extern char *_rl_isearch_terminators;
|
||||
@ -398,17 +398,17 @@ extern _rl_search_cxt *_rl_nscxt;
|
||||
/* terminal.c */
|
||||
extern int _rl_enable_keypad;
|
||||
extern int _rl_enable_meta;
|
||||
extern char *_rl_term_clreol;
|
||||
extern char *_rl_term_clrpag;
|
||||
extern char *_rl_term_im;
|
||||
extern char *_rl_term_ic;
|
||||
extern char *_rl_term_ei;
|
||||
extern char *_rl_term_DC;
|
||||
extern char *_rl_term_up;
|
||||
extern char *_rl_term_dc;
|
||||
extern char *_rl_term_cr;
|
||||
extern char *_rl_term_IC;
|
||||
extern char *_rl_term_forward_char;
|
||||
extern const char *_rl_term_clreol;
|
||||
extern const char *_rl_term_clrpag;
|
||||
extern const char *_rl_term_im;
|
||||
extern const char *_rl_term_ic;
|
||||
extern const char *_rl_term_ei;
|
||||
extern const char *_rl_term_DC;
|
||||
extern const char *_rl_term_up;
|
||||
extern const char *_rl_term_dc;
|
||||
extern const char *_rl_term_cr;
|
||||
extern const char *_rl_term_IC;
|
||||
extern const char *_rl_term_forward_char;
|
||||
extern int _rl_screenheight;
|
||||
extern int _rl_screenwidth;
|
||||
extern int _rl_screenchars;
|
||||
|
@ -764,7 +764,7 @@ rl_deprep_terminal ()
|
||||
|
||||
int
|
||||
rl_restart_output (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
#if defined (__MINGW32__)
|
||||
return 0;
|
||||
@ -802,7 +802,7 @@ rl_restart_output (count, key)
|
||||
|
||||
int
|
||||
rl_stop_output (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
#if defined (__MINGW32__)
|
||||
return 0;
|
||||
|
@ -211,7 +211,7 @@ _rl_nsearch_init (dir, pchar)
|
||||
rl_end = rl_point = 0;
|
||||
|
||||
p = _rl_make_prompt_for_search (pchar ? pchar : ':');
|
||||
rl_message ("%s", p, 0);
|
||||
rl_message ("%s", p);
|
||||
free (p);
|
||||
|
||||
RL_SETSTATE(RL_STATE_NSEARCH);
|
||||
@ -383,7 +383,7 @@ noninc_search (dir, pchar)
|
||||
code calls this, KEY will be `?'. */
|
||||
int
|
||||
rl_noninc_forward_search (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
return noninc_search (1, (key == '?') ? '?' : 0);
|
||||
}
|
||||
@ -392,7 +392,7 @@ rl_noninc_forward_search (count, key)
|
||||
calls this, KEY will be `/'. */
|
||||
int
|
||||
rl_noninc_reverse_search (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
return noninc_search (-1, (key == '/') ? '/' : 0);
|
||||
}
|
||||
@ -401,7 +401,7 @@ rl_noninc_reverse_search (count, key)
|
||||
for. If there is no saved search string, abort. */
|
||||
int
|
||||
rl_noninc_forward_search_again (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
int r;
|
||||
|
||||
@ -418,7 +418,7 @@ rl_noninc_forward_search_again (count, key)
|
||||
for. If there is no saved search string, abort. */
|
||||
int
|
||||
rl_noninc_reverse_search_again (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
int r;
|
||||
|
||||
|
@ -104,34 +104,36 @@ char PC, *BC, *UP;
|
||||
#endif /* __linux__ */
|
||||
|
||||
/* Some strings to control terminal actions. These are output by tputs (). */
|
||||
char *_rl_term_clreol;
|
||||
char *_rl_term_clrpag;
|
||||
char *_rl_term_cr;
|
||||
char *_rl_term_backspace;
|
||||
char *_rl_term_goto;
|
||||
char *_rl_term_pc;
|
||||
const char *_rl_term_clreol;
|
||||
const char *_rl_term_clrpag;
|
||||
const char *_rl_term_cr;
|
||||
const char *_rl_term_backspace;
|
||||
char _rl_term_backspace_default[2] = { '\b', 0 };
|
||||
const char *_rl_term_goto;
|
||||
const char *_rl_term_pc;
|
||||
|
||||
/* Non-zero if we determine that the terminal can do character insertion. */
|
||||
int _rl_terminal_can_insert = 0;
|
||||
|
||||
/* How to insert characters. */
|
||||
char *_rl_term_im;
|
||||
char *_rl_term_ei;
|
||||
char *_rl_term_ic;
|
||||
char *_rl_term_ip;
|
||||
char *_rl_term_IC;
|
||||
const char *_rl_term_im;
|
||||
const char *_rl_term_ei;
|
||||
const char *_rl_term_ic;
|
||||
const char *_rl_term_ip;
|
||||
const char *_rl_term_IC;
|
||||
|
||||
/* How to delete characters. */
|
||||
char *_rl_term_dc;
|
||||
char *_rl_term_DC;
|
||||
const char *_rl_term_dc;
|
||||
const char *_rl_term_DC;
|
||||
|
||||
char *_rl_term_forward_char;
|
||||
const char *_rl_term_forward_char;
|
||||
|
||||
/* How to go up a line. */
|
||||
char *_rl_term_up;
|
||||
const char *_rl_term_up;
|
||||
char _rl_term_up_default[2] = { 0, 0 };
|
||||
|
||||
/* A visible bell; char if the terminal can be made to flash the screen. */
|
||||
static char *_rl_visible_bell;
|
||||
static const char *_rl_visible_bell;
|
||||
|
||||
/* Non-zero means the terminal can auto-wrap lines. */
|
||||
int _rl_term_autowrap = -1;
|
||||
@ -141,33 +143,33 @@ static int term_has_meta;
|
||||
|
||||
/* The sequences to write to turn on and off the meta key, if this
|
||||
terminal has one. */
|
||||
static char *_rl_term_mm;
|
||||
static char *_rl_term_mo;
|
||||
static const char *_rl_term_mm;
|
||||
static const char *_rl_term_mo;
|
||||
|
||||
/* The key sequences output by the arrow keys, if this terminal has any. */
|
||||
static char *_rl_term_ku;
|
||||
static char *_rl_term_kd;
|
||||
static char *_rl_term_kr;
|
||||
static char *_rl_term_kl;
|
||||
static const char *_rl_term_ku;
|
||||
static const char *_rl_term_kd;
|
||||
static const char *_rl_term_kr;
|
||||
static const char *_rl_term_kl;
|
||||
|
||||
/* How to initialize and reset the arrow keys, if this terminal has any. */
|
||||
static char *_rl_term_ks;
|
||||
static char *_rl_term_ke;
|
||||
static const char *_rl_term_ks;
|
||||
static const char *_rl_term_ke;
|
||||
|
||||
/* The key sequences sent by the Home and End keys, if any. */
|
||||
static char *_rl_term_kh;
|
||||
static char *_rl_term_kH;
|
||||
static char *_rl_term_at7; /* @7 */
|
||||
static const char *_rl_term_kh;
|
||||
static const char *_rl_term_kH;
|
||||
static const char *_rl_term_at7; /* @7 */
|
||||
|
||||
/* Delete key */
|
||||
static char *_rl_term_kD;
|
||||
static const char *_rl_term_kD;
|
||||
|
||||
/* Insert key */
|
||||
static char *_rl_term_kI;
|
||||
static const char *_rl_term_kI;
|
||||
|
||||
/* Cursor control */
|
||||
static char *_rl_term_vs; /* very visible */
|
||||
static char *_rl_term_ve; /* normal */
|
||||
static const char *_rl_term_vs; /* very visible */
|
||||
static const char *_rl_term_ve; /* normal */
|
||||
|
||||
static void bind_termcap_arrow_keys PARAMS((Keymap));
|
||||
|
||||
@ -362,7 +364,7 @@ rl_resize_terminal ()
|
||||
|
||||
struct _tc_string {
|
||||
const char *tc_var;
|
||||
char **tc_value;
|
||||
const char **tc_value;
|
||||
};
|
||||
|
||||
/* This should be kept sorted, just in case we decide to change the
|
||||
@ -409,7 +411,7 @@ get_term_capabilities (bp)
|
||||
char **bp;
|
||||
{
|
||||
#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
|
||||
register int i;
|
||||
register unsigned int i;
|
||||
|
||||
for (i = 0; i < NUM_TC_STRINGS; i++)
|
||||
*(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
|
||||
@ -496,8 +498,9 @@ _rl_init_terminal_io (terminal_name)
|
||||
tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we
|
||||
change that later... */
|
||||
PC = '\0';
|
||||
BC = _rl_term_backspace = "\b";
|
||||
UP = _rl_term_up;
|
||||
_rl_term_backspace = _rl_term_backspace_default;
|
||||
BC = (char*)_rl_term_backspace;
|
||||
UP = (char*)_rl_term_up;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -507,8 +510,8 @@ _rl_init_terminal_io (terminal_name)
|
||||
/* Set up the variables that the termcap library expects the application
|
||||
to provide. */
|
||||
PC = _rl_term_pc ? *_rl_term_pc : 0;
|
||||
BC = _rl_term_backspace;
|
||||
UP = _rl_term_up;
|
||||
BC = (char*)_rl_term_backspace;
|
||||
UP = (char*)_rl_term_up;
|
||||
|
||||
if (!_rl_term_cr)
|
||||
_rl_term_cr = "\r";
|
||||
@ -568,11 +571,11 @@ bind_termcap_arrow_keys (map)
|
||||
_rl_keymap = xkeymap;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
rl_get_termcap (cap)
|
||||
const char *cap;
|
||||
{
|
||||
register int i;
|
||||
register unsigned int i;
|
||||
|
||||
if (tcap_initialized == 0)
|
||||
return ((char *)NULL);
|
||||
|
@ -410,7 +410,7 @@ rl_backward (count, key)
|
||||
/* Move to the beginning of the line. */
|
||||
int
|
||||
rl_beg_of_line (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
rl_point = 0;
|
||||
return 0;
|
||||
@ -419,7 +419,7 @@ rl_beg_of_line (count, key)
|
||||
/* Move to the end of the line. */
|
||||
int
|
||||
rl_end_of_line (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
rl_point = rl_end;
|
||||
return 0;
|
||||
@ -527,7 +527,7 @@ rl_backward_word (count, key)
|
||||
/* Clear the current line. Numeric argument to C-l does this. */
|
||||
int
|
||||
rl_refresh_line (ignore1, ignore2)
|
||||
int ignore1, ignore2;
|
||||
int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
|
||||
{
|
||||
int curr_line;
|
||||
|
||||
@ -566,7 +566,7 @@ rl_clear_screen (count, key)
|
||||
|
||||
int
|
||||
rl_arrow_keys (count, c)
|
||||
int count, c;
|
||||
int count, c __attribute__((unused));
|
||||
{
|
||||
int ch;
|
||||
|
||||
@ -884,7 +884,7 @@ _rl_insert_next_callback (data)
|
||||
|
||||
int
|
||||
rl_quoted_insert (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
/* Let's see...should the callback interface futz with signal handling? */
|
||||
#if defined (HANDLE_SIGNALS)
|
||||
@ -907,7 +907,7 @@ rl_quoted_insert (count, key)
|
||||
/* Insert a tab character. */
|
||||
int
|
||||
rl_tab_insert (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
return (_rl_insert_char (count, '\t'));
|
||||
}
|
||||
@ -917,7 +917,7 @@ rl_tab_insert (count, key)
|
||||
meaning in the future. */
|
||||
int
|
||||
rl_newline (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
rl_done = 1;
|
||||
|
||||
@ -951,7 +951,7 @@ rl_newline (count, key)
|
||||
is special cased. */
|
||||
int
|
||||
rl_do_lowercase_version (ignore1, ignore2)
|
||||
int ignore1, ignore2;
|
||||
int ignore1 __attribute__((unused)), ignore2 __attribute__((unused));
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -1118,7 +1118,7 @@ rl_rubout_or_delete (count, key)
|
||||
/* Delete all spaces and tabs around point. */
|
||||
int
|
||||
rl_delete_horizontal_space (count, ignore)
|
||||
int count, ignore;
|
||||
int count __attribute__((unused)), ignore __attribute__((unused));
|
||||
{
|
||||
int start = rl_point;
|
||||
|
||||
@ -1163,9 +1163,9 @@ rl_delete_or_show_completions (count, key)
|
||||
A K*rn shell style function. */
|
||||
int
|
||||
rl_insert_comment (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
char *rl_comment_text;
|
||||
const char *rl_comment_text;
|
||||
int rl_comment_len;
|
||||
|
||||
rl_beg_of_line (1, key);
|
||||
@ -1202,7 +1202,7 @@ rl_insert_comment (count, key)
|
||||
/* Uppercase the word at point. */
|
||||
int
|
||||
rl_upcase_word (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
return (rl_change_case (count, UpCase));
|
||||
}
|
||||
@ -1210,7 +1210,7 @@ rl_upcase_word (count, key)
|
||||
/* Lowercase the word at point. */
|
||||
int
|
||||
rl_downcase_word (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
return (rl_change_case (count, DownCase));
|
||||
}
|
||||
@ -1218,7 +1218,7 @@ rl_downcase_word (count, key)
|
||||
/* Upcase the first letter, downcase the rest. */
|
||||
int
|
||||
rl_capitalize_word (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
return (rl_change_case (count, CapCase));
|
||||
}
|
||||
@ -1381,7 +1381,7 @@ rl_transpose_words (count, key)
|
||||
then transpose the characters before point. */
|
||||
int
|
||||
rl_transpose_chars (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
char *dummy;
|
||||
@ -1557,7 +1557,7 @@ _rl_char_search_callback (data)
|
||||
|
||||
int
|
||||
rl_char_search (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
#if defined (READLINE_CALLBACKS)
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
||||
@ -1575,7 +1575,7 @@ rl_char_search (count, key)
|
||||
|
||||
int
|
||||
rl_backward_char_search (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
#if defined (READLINE_CALLBACKS)
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
||||
@ -1612,7 +1612,7 @@ _rl_set_mark_at_pos (position)
|
||||
/* A bindable command to set the mark. */
|
||||
int
|
||||
rl_set_mark (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point));
|
||||
}
|
||||
@ -1620,7 +1620,7 @@ rl_set_mark (count, key)
|
||||
/* Exchange the position of mark and point. */
|
||||
int
|
||||
rl_exchange_point_and_mark (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
if (rl_mark > rl_end)
|
||||
rl_mark = -1;
|
||||
|
@ -196,7 +196,7 @@ tilde_expand (string)
|
||||
int result_size, result_index;
|
||||
|
||||
result_index = result_size = 0;
|
||||
if (result = strchr (string, '~'))
|
||||
if ((result = strchr (string, '~')))
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 16));
|
||||
else
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 1));
|
||||
|
@ -231,7 +231,8 @@ rl_do_undo ()
|
||||
|
||||
int
|
||||
_rl_fix_last_undo_of_type (type, start, end)
|
||||
int type, start, end;
|
||||
enum undo_code type;
|
||||
int start, end;
|
||||
{
|
||||
UNDO_LIST *rl;
|
||||
|
||||
@ -289,7 +290,7 @@ rl_modifying (start, end)
|
||||
/* Revert the current line to its previous state. */
|
||||
int
|
||||
rl_revert_line (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
if (!rl_undo_list)
|
||||
rl_ding ();
|
||||
@ -309,7 +310,7 @@ rl_revert_line (count, key)
|
||||
/* Do some undoing of things that were done. */
|
||||
int
|
||||
rl_undo_command (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
if (count < 0)
|
||||
return 0; /* Nothing to do. */
|
||||
|
@ -115,14 +115,14 @@ _rl_abort_internal ()
|
||||
|
||||
int
|
||||
rl_abort (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
return (_rl_abort_internal ());
|
||||
}
|
||||
|
||||
int
|
||||
rl_tty_status (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
#if defined (TIOCSTAT)
|
||||
ioctl (1, TIOCSTAT, (char *)0);
|
||||
@ -172,7 +172,7 @@ rl_extend_line_buffer (len)
|
||||
/* A function for simple tilde expansion. */
|
||||
int
|
||||
rl_tilde_expand (ignore, key)
|
||||
int ignore, key;
|
||||
int ignore __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
register int start, end;
|
||||
char *homedir, *temp;
|
||||
|
@ -131,7 +131,7 @@ static int _rl_vi_callback_char_search PARAMS((_rl_callback_generic_arg *));
|
||||
void
|
||||
_rl_vi_initialize_line ()
|
||||
{
|
||||
register int i;
|
||||
register size_t i;
|
||||
|
||||
for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++)
|
||||
vi_mark_chars[i] = -1;
|
||||
@ -190,7 +190,7 @@ _rl_vi_stuff_insert (count)
|
||||
puts you back into insert mode. */
|
||||
int
|
||||
rl_vi_redo (count, c)
|
||||
int count, c;
|
||||
int count, c __attribute__((unused));
|
||||
{
|
||||
int r;
|
||||
|
||||
@ -238,7 +238,7 @@ rl_vi_undo (count, key)
|
||||
/* Yank the nth arg from the previous line into this line at point. */
|
||||
int
|
||||
rl_vi_yank_arg (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
/* Readline thinks that the first word on a line is the 0th, while vi
|
||||
thinks the first word on a line is the 1st. Compensate. */
|
||||
@ -321,7 +321,7 @@ rl_vi_search (count, key)
|
||||
/* Completion, from vi's point of view. */
|
||||
int
|
||||
rl_vi_complete (ignore, key)
|
||||
int ignore, key;
|
||||
int ignore __attribute__((unused)), key;
|
||||
{
|
||||
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
|
||||
{
|
||||
@ -348,7 +348,7 @@ rl_vi_complete (ignore, key)
|
||||
/* Tilde expansion for vi mode. */
|
||||
int
|
||||
rl_vi_tilde_expand (ignore, key)
|
||||
int ignore, key;
|
||||
int ignore __attribute__((unused)), key;
|
||||
{
|
||||
rl_tilde_expand (0, key);
|
||||
rl_vi_start_inserting (key, 1, rl_arg_sign);
|
||||
@ -419,7 +419,7 @@ rl_vi_end_word (count, key)
|
||||
/* Move forward a word the way that 'W' does. */
|
||||
int
|
||||
rl_vi_fWord (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
while (count-- && rl_point < (rl_end - 1))
|
||||
{
|
||||
@ -436,7 +436,7 @@ rl_vi_fWord (count, ignore)
|
||||
|
||||
int
|
||||
rl_vi_bWord (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
while (count-- && rl_point > 0)
|
||||
{
|
||||
@ -460,7 +460,7 @@ rl_vi_bWord (count, ignore)
|
||||
|
||||
int
|
||||
rl_vi_eWord (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
while (count-- && rl_point < (rl_end - 1))
|
||||
{
|
||||
@ -491,7 +491,7 @@ rl_vi_eWord (count, ignore)
|
||||
|
||||
int
|
||||
rl_vi_fword (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
while (count-- && rl_point < (rl_end - 1))
|
||||
{
|
||||
@ -517,7 +517,7 @@ rl_vi_fword (count, ignore)
|
||||
|
||||
int
|
||||
rl_vi_bword (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
while (count-- && rl_point > 0)
|
||||
{
|
||||
@ -556,7 +556,7 @@ rl_vi_bword (count, ignore)
|
||||
|
||||
int
|
||||
rl_vi_eword (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
while (count-- && rl_point < rl_end - 1)
|
||||
{
|
||||
@ -581,7 +581,7 @@ rl_vi_eword (count, ignore)
|
||||
|
||||
int
|
||||
rl_vi_insert_beg (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
rl_beg_of_line (1, key);
|
||||
rl_vi_insertion_mode (1, key);
|
||||
@ -610,7 +610,7 @@ _rl_vi_append_forward (key)
|
||||
|
||||
int
|
||||
rl_vi_append_mode (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
_rl_vi_append_forward (key);
|
||||
rl_vi_start_inserting (key, 1, rl_arg_sign);
|
||||
@ -619,7 +619,7 @@ rl_vi_append_mode (count, key)
|
||||
|
||||
int
|
||||
rl_vi_append_eol (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
rl_end_of_line (1, key);
|
||||
rl_vi_append_mode (1, key);
|
||||
@ -629,7 +629,7 @@ rl_vi_append_eol (count, key)
|
||||
/* What to do in the case of C-d. */
|
||||
int
|
||||
rl_vi_eof_maybe (count, c)
|
||||
int count, c;
|
||||
int count __attribute__((unused)), c __attribute__((unused));
|
||||
{
|
||||
return (rl_newline (1, '\n'));
|
||||
}
|
||||
@ -640,7 +640,7 @@ rl_vi_eof_maybe (count, c)
|
||||
switching keymaps. */
|
||||
int
|
||||
rl_vi_insertion_mode (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
_rl_keymap = vi_insertion_keymap;
|
||||
_rl_vi_last_key_before_insert = key;
|
||||
@ -703,7 +703,7 @@ _rl_vi_done_inserting ()
|
||||
|
||||
int
|
||||
rl_vi_movement_mode (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
if (rl_point > 0)
|
||||
rl_backward_char (1, key);
|
||||
@ -783,7 +783,7 @@ _rl_vi_change_mbchar_case (count)
|
||||
|
||||
int
|
||||
rl_vi_change_case (count, ignore)
|
||||
int count, ignore;
|
||||
int count, ignore __attribute__((unused));
|
||||
{
|
||||
int c, p;
|
||||
|
||||
@ -1031,7 +1031,7 @@ rl_digit_loop1 ()
|
||||
|
||||
int
|
||||
rl_vi_delete_to (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -1057,7 +1057,7 @@ rl_vi_delete_to (count, key)
|
||||
|
||||
int
|
||||
rl_vi_change_to (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
int c, start_pos;
|
||||
|
||||
@ -1110,7 +1110,7 @@ rl_vi_change_to (count, key)
|
||||
|
||||
int
|
||||
rl_vi_yank_to (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
int c, save;
|
||||
|
||||
@ -1202,7 +1202,7 @@ rl_vi_delete (count, key)
|
||||
|
||||
int
|
||||
rl_vi_back_to_indent (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
rl_beg_of_line (1, key);
|
||||
while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point]))
|
||||
@ -1212,7 +1212,7 @@ rl_vi_back_to_indent (count, key)
|
||||
|
||||
int
|
||||
rl_vi_first_print (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key;
|
||||
{
|
||||
return (rl_vi_back_to_indent (1, key));
|
||||
}
|
||||
@ -1319,7 +1319,7 @@ rl_vi_char_search (count, key)
|
||||
/* Match brackets */
|
||||
int
|
||||
rl_vi_match (ignore, key)
|
||||
int ignore, key;
|
||||
int ignore __attribute__((unused)), key;
|
||||
{
|
||||
int count = 1, brack, pos, tmp, pre;
|
||||
|
||||
@ -1426,7 +1426,7 @@ rl_vi_bracktype (c)
|
||||
static int
|
||||
_rl_vi_change_char (count, c, mb)
|
||||
int count, c;
|
||||
char *mb;
|
||||
char *mb __attribute__((unused));
|
||||
{
|
||||
int p;
|
||||
|
||||
@ -1458,8 +1458,8 @@ _rl_vi_change_char (count, c, mb)
|
||||
|
||||
static int
|
||||
_rl_vi_callback_getchar (mb, mlen)
|
||||
char *mb;
|
||||
int mlen;
|
||||
char *mb __attribute__((unused));
|
||||
int mlen __attribute__((unused));
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -1494,7 +1494,7 @@ _rl_vi_callback_change_char (data)
|
||||
|
||||
int
|
||||
rl_vi_change_char (count, key)
|
||||
int count, key;
|
||||
int count, key __attribute__((unused));
|
||||
{
|
||||
int c;
|
||||
char mb[MB_LEN_MAX];
|
||||
@ -1582,7 +1582,7 @@ rl_vi_overstrike_delete (count, key)
|
||||
|
||||
int
|
||||
rl_vi_replace (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1663,7 +1663,7 @@ _rl_vi_set_mark ()
|
||||
#if defined (READLINE_CALLBACKS)
|
||||
static int
|
||||
_rl_vi_callback_set_mark (data)
|
||||
_rl_callback_generic_arg *data;
|
||||
_rl_callback_generic_arg *data __attribute__((unused));
|
||||
{
|
||||
_rl_callback_func = 0;
|
||||
_rl_want_redisplay = 1;
|
||||
@ -1674,7 +1674,7 @@ _rl_vi_callback_set_mark (data)
|
||||
|
||||
int
|
||||
rl_vi_set_mark (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
#if defined (READLINE_CALLBACKS)
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
||||
@ -1721,7 +1721,7 @@ _rl_vi_goto_mark ()
|
||||
#if defined (READLINE_CALLBACKS)
|
||||
static int
|
||||
_rl_vi_callback_goto_mark (data)
|
||||
_rl_callback_generic_arg *data;
|
||||
_rl_callback_generic_arg *data __attribute__((unused));
|
||||
{
|
||||
_rl_callback_func = 0;
|
||||
_rl_want_redisplay = 1;
|
||||
@ -1732,7 +1732,7 @@ _rl_vi_callback_goto_mark (data)
|
||||
|
||||
int
|
||||
rl_vi_goto_mark (count, key)
|
||||
int count, key;
|
||||
int count __attribute__((unused)), key __attribute__((unused));
|
||||
{
|
||||
#if defined (READLINE_CALLBACKS)
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK))
|
||||
|
44
configure.in
44
configure.in
@ -604,10 +604,11 @@ AC_SUBST(NOINST_LDFLAGS)
|
||||
# Check if we are using Linux and a glibc compiled with static nss
|
||||
# (this is true on the MySQL build machines to avoid NSS problems)
|
||||
#
|
||||
AC_CHECK_TOOL([NM], [nm])
|
||||
|
||||
if test "$TARGET_LINUX" = "true" -a "$static_nss" = ""
|
||||
then
|
||||
tmp=`nm /usr/lib*/libc.a | grep _nss_files_getaliasent_r`
|
||||
tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a | grep _nss_files_getaliasent_r1`
|
||||
if test -n "$tmp"
|
||||
then
|
||||
STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv"
|
||||
@ -1641,7 +1642,7 @@ esac
|
||||
|
||||
# Build optimized or debug version ?
|
||||
# First check for gcc and g++
|
||||
if test "$ac_cv_prog_gcc" = "yes"
|
||||
if test "$GCC" = "yes"
|
||||
then
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CC="-O"
|
||||
@ -1649,9 +1650,16 @@ then
|
||||
else
|
||||
DEBUG_CFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CC=""
|
||||
OPTIMIZE_CFLAGS="-O"
|
||||
case $SYSTEM_TYPE in
|
||||
*solaris*)
|
||||
OPTIMIZE_CFLAGS="-O1"
|
||||
;;
|
||||
*)
|
||||
OPTIMIZE_CFLAGS="-O"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if test "$ac_cv_prog_cxx_g" = "yes"
|
||||
if test "$GXX" = "yes"
|
||||
then
|
||||
DEBUG_CXXFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CXX="-O"
|
||||
@ -1659,7 +1667,14 @@ then
|
||||
else
|
||||
DEBUG_CXXFLAGS="-g"
|
||||
DEBUG_OPTIMIZE_CXX=""
|
||||
OPTIMIZE_CXXFLAGS="-O"
|
||||
case $SYSTEM_TYPE in
|
||||
*solaris*)
|
||||
OPTIMIZE_CXXFLAGS="-O1"
|
||||
;;
|
||||
*)
|
||||
OPTIMIZE_CXXFLAGS="-O"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $SYSTEM_TYPE in
|
||||
@ -2119,6 +2134,25 @@ case "$mysql_cv_sys_os" in
|
||||
# unsupported priority values are passed to pthread_setschedprio.
|
||||
# Since the only supported value is 1, treat it as inexistent.
|
||||
;;
|
||||
SunOS) # Bug#42599 error: `pthread_setschedprio' was not declared in this scope
|
||||
# In some installations, the pthread.h header used by GCC does not
|
||||
# declare the pthread_setscheprio prototype, but the function is
|
||||
# implemented. Since the function is used in C++ code, ensure that
|
||||
# the function prototype is present.
|
||||
AC_MSG_CHECKING([whether pthread_setschedprio is declared])
|
||||
AC_LANG_PUSH([C++])
|
||||
AC_COMPILE_IFELSE([
|
||||
AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[(void)(pthread_setschedprio);])],
|
||||
[ac_cv_func_pthread_setschedprio=yes],
|
||||
[ac_cv_func_pthread_setschedprio=no])
|
||||
AC_LANG_POP([C++])
|
||||
AC_MSG_RESULT([$ac_cv_func_pthread_setschedprio])
|
||||
if test "$ac_cv_func_pthread_setschedprio" = yes; then
|
||||
AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1,
|
||||
[Define to 1 if you have the `pthread_setschedprio' function.])
|
||||
fi
|
||||
;;
|
||||
*) AC_CHECK_FUNCS(pthread_setschedprio)
|
||||
;;
|
||||
esac
|
||||
|
@ -32,6 +32,7 @@
|
||||
.\" === Set line length
|
||||
.\".ll 6.5i
|
||||
.TL
|
||||
.warn 0
|
||||
D B U G
|
||||
.P 0
|
||||
C Program Debugging Package
|
||||
|
@ -224,7 +224,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else if (verbose)
|
||||
{
|
||||
printf("file %s= %llu bytes (%lu pages)...\n", argv[1], size, pages);
|
||||
printf("file %s = %llu bytes (%lu pages)...\n", argv[optind], size, pages);
|
||||
printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1));
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
|
||||
printf("Print a description for a system error code or an error code from\na MyISAM/ISAM/BDB table handler.\n");
|
||||
printf("Print a description for a system error code or a MySQL error code.\n");
|
||||
printf("If you want to get the error for a negative error code, you should use\n-- before the first error code to tell perror that there was no more options.\n\n");
|
||||
printf("Usage: %s [OPTIONS] [ERRORCODE [ERRORCODE...]]\n",my_progname);
|
||||
my_print_help(my_long_options);
|
||||
|
@ -790,15 +790,17 @@ void processReply(SSL& ssl)
|
||||
if (ssl.GetError()) return;
|
||||
|
||||
if (DoProcessReply(ssl))
|
||||
{
|
||||
// didn't complete process
|
||||
if (!ssl.getSocket().IsNonBlocking()) {
|
||||
// keep trying now, blocking ok
|
||||
while (!ssl.GetError())
|
||||
if (DoProcessReply(ssl) == 0) break;
|
||||
}
|
||||
}
|
||||
else
|
||||
// user will have try again later, non blocking
|
||||
ssl.SetError(YasslError(SSL_ERROR_WANT_READ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -873,10 +875,12 @@ void sendServerKeyExchange(SSL& ssl, BufferOutput buffer)
|
||||
void sendChangeCipher(SSL& ssl, BufferOutput buffer)
|
||||
{
|
||||
if (ssl.getSecurity().get_parms().entity_ == server_end)
|
||||
{
|
||||
if (ssl.getSecurity().get_resuming())
|
||||
ssl.verifyState(clientKeyExchangeComplete);
|
||||
else
|
||||
ssl.verifyState(clientFinishedComplete);
|
||||
}
|
||||
if (ssl.GetError()) return;
|
||||
|
||||
ChangeCipherSpec ccs;
|
||||
|
@ -1305,6 +1305,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl)
|
||||
ssl.useSecurity().use_connection().sessionID_Set_ = false;
|
||||
|
||||
if (ssl.getSecurity().get_resuming())
|
||||
{
|
||||
if (memcmp(session_id_, ssl.getSecurity().get_resume().GetID(),
|
||||
ID_LEN) == 0) {
|
||||
ssl.set_masterSecret(ssl.getSecurity().get_resume().GetSecret());
|
||||
@ -1319,6 +1320,7 @@ void ServerHello::Process(input_buffer&, SSL& ssl)
|
||||
ssl.useSecurity().set_resuming(false);
|
||||
ssl.useLog().Trace("server denied resumption");
|
||||
}
|
||||
}
|
||||
|
||||
if (ssl.CompressionOn() && !compression_method_)
|
||||
ssl.UnSetCompression(); // server isn't supporting yaSSL zlib request
|
||||
|
@ -96,10 +96,12 @@ inline void Mode_BASE::Process(byte* out, const byte* in, word32 sz)
|
||||
if (mode_ == ECB)
|
||||
ECB_Process(out, in, sz);
|
||||
else if (mode_ == CBC)
|
||||
{
|
||||
if (dir_ == ENCRYPTION)
|
||||
CBC_Encrypt(out, in, sz);
|
||||
else
|
||||
CBC_Decrypt(out, in, sz);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -781,10 +781,12 @@ void CertDecoder::GetDate(DateType dt)
|
||||
source_.advance(length);
|
||||
|
||||
if (!ValidateDate(date, b, dt) && verify_)
|
||||
{
|
||||
if (dt == BEFORE)
|
||||
source_.SetError(BEFORE_DATE_E);
|
||||
else
|
||||
source_.SetError(AFTER_DATE_E);
|
||||
}
|
||||
|
||||
// save for later use
|
||||
if (dt == BEFORE) {
|
||||
@ -1062,6 +1064,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
|
||||
}
|
||||
word32 rLen = GetLength(source);
|
||||
if (rLen != 20)
|
||||
{
|
||||
if (rLen == 21) { // zero at front, eat
|
||||
source.next();
|
||||
--rLen;
|
||||
@ -1074,6 +1077,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
|
||||
source.SetError(DSA_SZ_E);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
|
||||
source.advance(rLen);
|
||||
|
||||
@ -1084,6 +1088,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
|
||||
}
|
||||
word32 sLen = GetLength(source);
|
||||
if (sLen != 20)
|
||||
{
|
||||
if (sLen == 21) {
|
||||
source.next(); // zero at front, eat
|
||||
--sLen;
|
||||
@ -1096,6 +1101,7 @@ word32 DecodeDSA_Signature(byte* decoded, const byte* encoded, word32 sz)
|
||||
source.SetError(DSA_SZ_E);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
|
||||
source.advance(sLen);
|
||||
|
||||
|
@ -106,7 +106,7 @@ void my_hash_replace(HASH *hash, HASH_SEARCH_STATE *state, uchar *new_row);
|
||||
my_bool my_hash_check(HASH *hash); /* Only in debug library */
|
||||
|
||||
#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
|
||||
#define my_hash_inited(H) ((H)->array.buffer != 0)
|
||||
#define my_hash_inited(H) ((H)->blength != 0)
|
||||
#define my_hash_init_opt(A,B,C,D,E,F,G,H) \
|
||||
(!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
|
||||
|
||||
|
@ -285,7 +285,7 @@ typedef struct charset_info_st
|
||||
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
|
||||
|
||||
|
||||
extern CHARSET_INFO my_charset_bin;
|
||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
|
||||
extern CHARSET_INFO my_charset_big5_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_big5_bin;
|
||||
extern CHARSET_INFO my_charset_cp932_japanese_ci;
|
||||
@ -298,7 +298,7 @@ extern CHARSET_INFO my_charset_gb2312_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_gb2312_bin;
|
||||
extern CHARSET_INFO my_charset_gbk_chinese_ci;
|
||||
extern CHARSET_INFO my_charset_gbk_bin;
|
||||
extern CHARSET_INFO my_charset_latin1;
|
||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
|
||||
extern CHARSET_INFO my_charset_latin1_german2_ci;
|
||||
extern CHARSET_INFO my_charset_latin1_bin;
|
||||
extern CHARSET_INFO my_charset_latin2_czech_ci;
|
||||
@ -315,7 +315,7 @@ extern CHARSET_INFO my_charset_utf8_general_ci;
|
||||
extern CHARSET_INFO my_charset_utf8_unicode_ci;
|
||||
extern CHARSET_INFO my_charset_utf8_bin;
|
||||
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
||||
extern CHARSET_INFO my_charset_filename;
|
||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
|
||||
|
||||
/* declarations for simple charsets */
|
||||
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
|
||||
|
@ -276,7 +276,7 @@
|
||||
#endif
|
||||
|
||||
/* The client defines this to avoid all thread code */
|
||||
#if defined(UNDEF_THREADS_HACK)
|
||||
#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK)
|
||||
#undef THREAD
|
||||
#undef HAVE_LINUXTHREADS
|
||||
#undef HAVE_NPTL
|
||||
@ -1573,4 +1573,17 @@ static inline double rint(double x)
|
||||
}
|
||||
#endif /* HAVE_RINT */
|
||||
|
||||
/*
|
||||
MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
|
||||
(i.e variables) for usage in storage engine loadable plugins.
|
||||
Outside of Windows, it is dummy.
|
||||
*/
|
||||
#ifndef MYSQL_PLUGIN_IMPORT
|
||||
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
|
||||
#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
|
||||
#else
|
||||
#define MYSQL_PLUGIN_IMPORT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* my_global_h */
|
||||
|
@ -221,8 +221,8 @@ extern uint my_large_page_size;
|
||||
#endif
|
||||
|
||||
/* charsets */
|
||||
extern CHARSET_INFO *default_charset_info;
|
||||
extern CHARSET_INFO *all_charsets[256];
|
||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
|
||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[256];
|
||||
extern CHARSET_INFO compiled_charsets[];
|
||||
|
||||
/* statistics */
|
||||
@ -237,8 +237,8 @@ extern void (*my_sigtstp_cleanup)(void),
|
||||
(*my_sigtstp_restart)(void),
|
||||
(*my_abort_hook)(int);
|
||||
/* Executed when comming from shell */
|
||||
extern int NEAR my_umask, /* Default creation mask */
|
||||
NEAR my_umask_dir,
|
||||
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 */
|
||||
@ -511,7 +511,7 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
|
||||
((info)->write_pos + (Count) <=(info)->write_end ?\
|
||||
(memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
|
||||
((info)->write_pos+=(Count)),0) : \
|
||||
(*(info)->write_function)((info),(Buffer),(Count)))
|
||||
(*(info)->write_function)((info),(uchar *)(Buffer),(Count)))
|
||||
|
||||
#define my_b_get(info) \
|
||||
((info)->read_pos != (info)->read_end ?\
|
||||
|
@ -404,7 +404,8 @@ typedef struct st_mi_check_param
|
||||
my_off_t keydata,totaldata,key_blocks,start_check_pos;
|
||||
ha_rows total_records,total_deleted;
|
||||
ha_checksum record_checksum,glob_crc;
|
||||
ulong use_buffers,read_buffer_length,write_buffer_length,
|
||||
ulonglong use_buffers;
|
||||
ulong read_buffer_length,write_buffer_length,
|
||||
sort_buffer_length,sort_key_blocks;
|
||||
uint out_flag,warning_printed,error_printed,verbose;
|
||||
uint opt_sort_key,total_files,max_level;
|
||||
|
@ -88,7 +88,8 @@ extern MYRG_INFO *myrg_parent_open(const char *parent_name,
|
||||
void *callback_param);
|
||||
extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
|
||||
MI_INFO *(*callback)(void*),
|
||||
void *callback_param);
|
||||
void *callback_param,
|
||||
my_bool *need_compat_check);
|
||||
extern int myrg_detach_children(MYRG_INFO *m_info);
|
||||
extern int myrg_panic(enum ha_panic_function function);
|
||||
extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx);
|
||||
|
@ -16,6 +16,16 @@
|
||||
#ifndef _my_plugin_h
|
||||
#define _my_plugin_h
|
||||
|
||||
|
||||
/*
|
||||
On Windows, exports from DLL need to be declared
|
||||
*/
|
||||
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
|
||||
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define MYSQL_PLUGIN_EXPORT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
class THD;
|
||||
class Item;
|
||||
@ -90,9 +100,9 @@ int PSIZE= sizeof(struct st_mysql_plugin); \
|
||||
struct st_mysql_plugin DECLS[]= {
|
||||
#else
|
||||
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
||||
int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||
int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
|
||||
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
|
||||
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
||||
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
|
||||
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
|
||||
#endif
|
||||
|
||||
#define mysql_declare_plugin(NAME) \
|
||||
|
@ -21,7 +21,7 @@
|
||||
# This file is public domain and comes with NO WARRANTY of any kind
|
||||
|
||||
target = libmysqlclient.la
|
||||
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
|
||||
target_defs = -DMYSQL_CLIENT_NO_THREADS -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@
|
||||
LIBS = @CLIENT_LIBS@
|
||||
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||
$(openssl_includes) @ZLIB_INCLUDES@
|
||||
@ -104,7 +104,7 @@ do-lib-dist:
|
||||
echo "# A very minimal Makefile to compile" > $$dir/Makefile; \
|
||||
echo "# the minimized libmysql library" >> $$dir/Makefile; \
|
||||
echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \
|
||||
echo 'CFLAGS= -I. -DUNDEF_THREADS_HACK' >>$$dir/Makefile; \
|
||||
echo 'CFLAGS= -I. -DMYSQL_CLIENT_NO_THREADS' >>$$dir/Makefile; \
|
||||
echo "obj=$$objs" >>$$dir/Makefile; \
|
||||
echo 'all: libmysql.a' >>$$dir/Makefile; \
|
||||
echo 'libmysql.a: $$(obj)' >>$$dir/Makefile; \
|
||||
|
@ -87,63 +87,16 @@ FOREACH(rpath ${VIO_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
|
||||
# Engines
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/heap/CMakeLists.txt)
|
||||
FOREACH(rpath ${HEAP_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/heap/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisam/CMakeLists.txt)
|
||||
FOREACH(rpath ${MYISAM_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisam/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisammrg/CMakeLists.txt)
|
||||
FOREACH(rpath ${MYISAMMRG_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisammrg/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
|
||||
IF(WITH_ARCHIVE_STORAGE_ENGINE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/archive/CMakeLists.txt)
|
||||
FOREACH(rpath ${ARCHIVE_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/archive/${rpath})
|
||||
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/${ENGINE_LIB}/CMakeLists.txt)
|
||||
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
|
||||
FOREACH(rpath ${${ENGINE_LIB_UPPER}_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ${CMAKE_SOURCE_DIR}/storage/${ENGINE_LIB}/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
|
||||
ENDFOREACH(ENGINE_LIB)
|
||||
|
||||
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/blackhole/CMakeLists.txt)
|
||||
FOREACH(rpath ${BLACKHOLE_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/blackhole/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
|
||||
|
||||
IF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/example/CMakeLists.txt)
|
||||
FOREACH(rpath ${EXAMPLE_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/example/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
|
||||
IF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/federated/CMakeLists.txt)
|
||||
FOREACH(rpath ${FEDERATED_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/federated/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
|
||||
IF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/innobase/CMakeLists.txt)
|
||||
FOREACH(rpath ${INNOBASE_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/innobase/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
|
||||
IF(WITH_CSV_STORAGE_ENGINE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/storage/csv/CMakeLists.txt)
|
||||
FOREACH(rpath ${CSV_SOURCES})
|
||||
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/csv/${rpath})
|
||||
ENDFOREACH(rpath)
|
||||
ENDIF(WITH_CSV_STORAGE_ENGINE)
|
||||
|
||||
SET(SOURCE_SUBLIBS FALSE)
|
||||
|
||||
|
@ -25,6 +25,7 @@ test_SCRIPTS = mtr \
|
||||
mysql-stress-test.pl
|
||||
|
||||
nobase_test_DATA = \
|
||||
valgrind.supp \
|
||||
lib/v1/mysql-test-run.pl \
|
||||
lib/v1/mtr_cases.pl \
|
||||
lib/v1/mtr_io.pl \
|
||||
@ -41,7 +42,6 @@ nobase_test_DATA = \
|
||||
lib/v1/mtr_im.pl \
|
||||
lib/v1/mtr_process.pl \
|
||||
lib/v1/mtr_unique.pl \
|
||||
\
|
||||
lib/mtr_cases.pm \
|
||||
lib/mtr_gcov.pl \
|
||||
lib/mtr_gprof.pl \
|
||||
@ -69,7 +69,6 @@ nobase_test_DATA = \
|
||||
SUBDIRS = lib/My/SafeProcess
|
||||
|
||||
EXTRA_DIST = README \
|
||||
valgrind.supp \
|
||||
$(test_SCRIPTS) \
|
||||
$(nobase_test_DATA)
|
||||
|
||||
@ -93,12 +92,13 @@ TEST_DIRS = t r include std_data std_data/parts collections \
|
||||
suite/jp suite/jp/t suite/jp/r suite/jp/std_data suite/jp/include \
|
||||
suite/manual/t suite/manual/r \
|
||||
suite/ndb_team suite/ndb_team/t suite/ndb_team/r \
|
||||
suite/rpl suite/rpl/data suite/rpl/include suite/rpl/r \
|
||||
suite/rpl suite/rpl/include suite/rpl/r \
|
||||
suite/rpl/t \
|
||||
suite/stress/include suite/stress/t suite/stress/r \
|
||||
suite/ndb suite/ndb/t suite/ndb/r \
|
||||
suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \
|
||||
suite/parts suite/parts/t suite/parts/r suite/parts/inc
|
||||
suite/parts suite/parts/t suite/parts/r suite/parts/inc \
|
||||
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include
|
||||
|
||||
# Used by dist-hook and install-data-local to copy all
|
||||
# test files into either dist or install directory
|
||||
|
@ -1 +1,13 @@
|
||||
funcs_1.charset_collation_1 # depends on compile-time decisions
|
||||
binlog.binlog_tmp_table # Bug#45578: Test binlog_tmp_table fails ramdonly on PB2: Unknown table 't2'
|
||||
main.ctype_gbk_binlog # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
|
||||
rpl.rpl_row_create_table # Bug#45576: rpl_row_create_table fails on PB2
|
||||
rpl.rpl_extraColmaster_myisam # Bug#46013: rpl_extraColmaster_myisam fails on pb2
|
||||
rpl.rpl_stm_reset_slave # Bug#46014: rpl_stm_reset_slave crashes the server sporadically in pb2
|
||||
rpl.rpl_extraCol_myisam # Bug#40796
|
||||
rpl.rpl_extraColmaster_innodb # Bug#40796
|
||||
rpl.rpl_extraCol_innodb # Bug#40796
|
||||
rpl_ndb.rpl_ndb_log # Bug#38998
|
||||
rpl.rpl_innodb_bug28430 # Bug#46029
|
||||
rpl.rpl_row_basic_3innodb # Bug#45243
|
||||
rpl.rpl_truncate_3innodb # Bug#46030
|
||||
|
@ -1,5 +1,5 @@
|
||||
perl mysql-test-run.pl --timer --force --comment=n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --comment=embedded --embedded --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --comment=rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --embedded --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
|
||||
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --suite=funcs_1 --experimental=collections/default.experimental
|
||||
|
@ -41,3 +41,57 @@ reset slave;
|
||||
start slave;
|
||||
sync_with_master;
|
||||
show status like 'slave_open_temp_tables';
|
||||
|
||||
#
|
||||
#Bug#34654 RESET SLAVE does not clear LAST_IO_Err*
|
||||
#
|
||||
|
||||
# clearing the status
|
||||
stop slave;
|
||||
reset slave;
|
||||
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
|
||||
echo *** errno must be zero: $last_io_errno ***;
|
||||
|
||||
#
|
||||
# verifying start slave resets Last_IO_Error and Last_IO_Errno.
|
||||
#
|
||||
|
||||
change master to master_user='impossible_user_name';
|
||||
start slave;
|
||||
source include/wait_for_slave_io_error.inc;
|
||||
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
|
||||
--disable_query_log
|
||||
eval SELECT $last_io_errno > 0 as ONE;
|
||||
--enable_query_log
|
||||
|
||||
source include/stop_slave.inc;
|
||||
change master to master_user='root';
|
||||
source include/start_slave.inc;
|
||||
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
|
||||
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
|
||||
--echo *** last errno must be zero: $last_io_errno ***
|
||||
--echo *** last error must be blank: $last_io_error ***
|
||||
|
||||
#
|
||||
# verifying reset slave resets Last_{IO,SQL}_Err{or,no}
|
||||
#
|
||||
|
||||
source include/stop_slave.inc;
|
||||
change master to master_user='impossible_user_name';
|
||||
start slave;
|
||||
source include/wait_for_slave_io_error.inc;
|
||||
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
|
||||
--disable_query_log
|
||||
eval SELECT $last_io_errno > 0 as ONE;
|
||||
--enable_query_log
|
||||
|
||||
source include/stop_slave.inc;
|
||||
reset slave;
|
||||
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
|
||||
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
|
||||
let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
|
||||
let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
|
||||
--echo *** io last errno must be zero: $last_io_errno ***
|
||||
--echo *** io last error must be blank: $last_io_error ***
|
||||
--echo *** sql last errno must be zero: $last_sql_errno ***
|
||||
--echo *** sql last error must be blank: $last_sql_error ***
|
||||
|
@ -669,13 +669,9 @@ call p_verify_status_increment(1, 0, 1, 0);
|
||||
insert t1 set a=3;
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
savepoint a;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
insert t1 set a=4;
|
||||
--echo # Binlog does not register itself this time for other than the 1st
|
||||
--echo # statement of the transaction with MIXED/STATEMENT binlog_format.
|
||||
--echo # It needs registering with the ROW format. Therefore 1,0,2,2 are
|
||||
--echo # the correct arguments to this test after bug#40221 fixed.
|
||||
call p_verify_status_increment(1, 0, 2, 2);
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
release savepoint a;
|
||||
rollback;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
|
@ -659,11 +659,16 @@ drop table t1;
|
||||
connection thread1;
|
||||
select * from t1;
|
||||
|
||||
--echo ** Cleanup
|
||||
connection thread1;
|
||||
disconnect thread1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo ** connection thread2
|
||||
connection thread2;
|
||||
disconnect thread2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo ** connection default
|
||||
connection default;
|
||||
drop table t1;
|
||||
drop user mysqltest@localhost;
|
||||
|
||||
disconnect thread1;
|
||||
disconnect thread2;
|
||||
|
||||
|
@ -171,15 +171,30 @@ show status like "Qcache_not_cached";
|
||||
|
||||
# Cleanup
|
||||
|
||||
--echo ----- switch to connection default and close connections -----
|
||||
connection default;
|
||||
--echo ----- close connections -----
|
||||
connection root;
|
||||
disconnect root;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection root2;
|
||||
disconnect root2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection user1;
|
||||
disconnect user1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection user2;
|
||||
disconnect user2;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection user3;
|
||||
disconnect user3;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection user4;
|
||||
disconnect user4;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection unkuser;
|
||||
disconnect unkuser;
|
||||
--source include/wait_until_disconnected.inc
|
||||
--echo ----- switch to connection default -----
|
||||
connection default;
|
||||
|
||||
#
|
||||
# A temporary 4.1 workaround to make this test pass if
|
||||
|
@ -719,6 +719,7 @@ connection con1;
|
||||
--reap
|
||||
drop table t1;
|
||||
disconnect con1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection default;
|
||||
|
||||
#
|
||||
|
@ -527,4 +527,30 @@ where exists (select 1 from t2, t3
|
||||
|
||||
drop table t0, t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#44810: index merge and order by with low sort_buffer_size
|
||||
--echo # crashes server!
|
||||
--echo #
|
||||
CREATE TABLE t1(a VARCHAR(128),b VARCHAR(128),KEY(A),KEY(B));
|
||||
INSERT INTO t1 VALUES (REPEAT('a',128),REPEAT('b',128));
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
INSERT INTO t1 SELECT * FROM t1;
|
||||
SET SESSION sort_buffer_size=1;
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%'
|
||||
ORDER BY a,b;
|
||||
# we don't actually care about the result : we're checking if it crashes
|
||||
--disable_result_log
|
||||
SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%'
|
||||
ORDER BY a,b;
|
||||
--enable_result_log
|
||||
|
||||
SET SESSION sort_buffer_size=DEFAULT;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
@ -1162,6 +1162,25 @@ ROLLBACK;
|
||||
--error 1305
|
||||
ROLLBACK TO SAVEPOINT s4;
|
||||
|
||||
#
|
||||
# Bug#39793 Foreign keys not constructed when column has a '#' in a comment or default value
|
||||
#
|
||||
|
||||
#This statement should be written on a single line for proper testing
|
||||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY COMMENT 'My ID#', f2 INTEGER DEFAULT NULL, f3 CHAR(10) DEFAULT 'My ID#', CONSTRAINT f2_ref FOREIGN KEY (f2) REFERENCES t1 (f1)) ENGINE=INNODB;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #36995: valgrind error in remove_const during subquery executions
|
||||
--echo #
|
||||
|
||||
create table t1 (a bit(1) not null,b int) engine=myisam;
|
||||
create table t2 (c int) engine=innodb;
|
||||
explain
|
||||
select b from t1 where a not in (select b from t1,t2 group by a) group by a;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
|
||||
@ -1479,43 +1498,12 @@ INSERT INTO t1 VALUES
|
||||
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
|
||||
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
|
||||
EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
|
||||
|
||||
SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
|
||||
SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#21704: Renaming column does not update FK definition.
|
||||
#
|
||||
|
||||
#
|
||||
# --disable_warnings
|
||||
# DROP TABLE IF EXISTS t1;
|
||||
# DROP TABLE IF EXISTS t2;
|
||||
# --enable_warnings
|
||||
#
|
||||
# CREATE TABLE t1(id INT PRIMARY KEY)
|
||||
# ENGINE=innodb;
|
||||
#
|
||||
# CREATE TABLE t2(
|
||||
# t1_id INT PRIMARY KEY,
|
||||
# CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
|
||||
# ENGINE=innodb;
|
||||
#
|
||||
# --echo
|
||||
#
|
||||
# --disable_result_log
|
||||
# --error ER_ERROR_ON_RENAME
|
||||
# ALTER TABLE t1 CHANGE id id2 INT;
|
||||
# --enable_result_log
|
||||
#
|
||||
# --echo
|
||||
#
|
||||
# DROP TABLE t2;
|
||||
# DROP TABLE t1;
|
||||
#
|
||||
|
||||
--echo #
|
||||
--echo # Bug #44290: explain crashes for subquery with distinct in
|
||||
--echo # SQL_SELECT::test_quick_select
|
||||
@ -1535,4 +1523,31 @@ SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
eval
|
||||
CREATE TABLE t1 (c1 REAL, c2 REAL, c3 REAL, KEY (c3), KEY (c2, c3))
|
||||
ENGINE=$engine_type;
|
||||
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
|
||||
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
EXPLAIN
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
eval
|
||||
CREATE TABLE t1 (c1 DECIMAL(12,2), c2 DECIMAL(12,2), c3 DECIMAL(12,2),
|
||||
KEY (c3), KEY (c2, c3))
|
||||
ENGINE=$engine_type;
|
||||
INSERT INTO t1 VALUES (1,1,1), (1,1,1), (1,1,2), (1,1,1), (1,1,2);
|
||||
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
EXPLAIN
|
||||
SELECT 1 FROM (SELECT COUNT(DISTINCT c1)
|
||||
FROM t1 WHERE c2 IN (1, 1) AND c3 = 2 GROUP BY c2) x;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -57,3 +57,13 @@ BEGIN
|
||||
mysql.user;
|
||||
|
||||
END||
|
||||
|
||||
--
|
||||
-- Procedure used by test case used to force all
|
||||
-- servers to restart after testcase and thus skipping
|
||||
-- check test case after test
|
||||
--
|
||||
CREATE DEFINER=root@localhost PROCEDURE force_restart()
|
||||
BEGIN
|
||||
SELECT 1 INTO OUTFILE 'force_restart';
|
||||
END||
|
||||
|
@ -139,9 +139,9 @@ INSERT INTO global_suppressions VALUES
|
||||
("Cannot find or open table test\/bug29807 from"),
|
||||
|
||||
/* innodb foreign key tests that fail in ALTER or RENAME produce this */
|
||||
("InnoDB: Error: in ALTER TABLE `test`.`t[12]`"),
|
||||
("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
|
||||
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
|
||||
("InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal"),
|
||||
("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"),
|
||||
|
||||
/* Test case for Bug#14233 produces the following warnings: */
|
||||
("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"),
|
||||
|
50
mysql-test/include/mysqldump.inc
Normal file
50
mysql-test/include/mysqldump.inc
Normal file
@ -0,0 +1,50 @@
|
||||
################################################################################
|
||||
# mysqldump.inc
|
||||
#
|
||||
# SUMMARY: include file to facilitate testing the quality of mysqldump output
|
||||
#
|
||||
# INPUTS: Two variables:
|
||||
# $table_name - the name of the table that was dumped
|
||||
# $mysqldumpfile - the name of the file that captured mysqldump output
|
||||
#
|
||||
# OUTPUTS: minor echo data:
|
||||
# We 'echo' some stage information to the .result file:
|
||||
# 'altering original table', 'restoring from dumpfile', 'comparing'
|
||||
#
|
||||
# OTHER FILES: We use include/diff_tables.inc to compare the original, renamed
|
||||
# table with the 'restored' one.
|
||||
#
|
||||
# DESCRIPTION: This file works by being fed the name of the original table
|
||||
# and a mysqldump output file. The original table is then renamed
|
||||
# to <table_name>_orig, the mysqldump file is used to recreate the
|
||||
# table, then diff_tables.inc is called to compare them.
|
||||
#
|
||||
# LIMITATIONS: Does *NOT* work with xml output!
|
||||
#
|
||||
# AUTHOR: pcrews 2009-05-21
|
||||
# Bug#40465 mysqldump.test does no checking of dump or restore
|
||||
#
|
||||
# LAST CHANGE: 2009-05-21
|
||||
#
|
||||
################################################################################
|
||||
|
||||
--echo # Begin testing mysqldump output + restore
|
||||
--echo # Create 'original table name - <table>_orig
|
||||
# NOTE: We use SET then let as query_get_value has issues with the extra commas
|
||||
# used in the CONCAT statement.
|
||||
eval SET @orig_table_name = CONCAT('$table_name', '_orig');
|
||||
let $orig_table_name = query_get_value(SELECT @orig_table_name,@orig_table_name,1);
|
||||
--echo # Rename original table
|
||||
eval ALTER TABLE $table_name RENAME to $orig_table_name;
|
||||
--echo # Recreate table from mysqldump output
|
||||
--exec $MYSQL test < $mysqldumpfile
|
||||
--echo # Compare original and recreated tables
|
||||
--echo # Recreated table: $table_name
|
||||
--echo # Original table: $orig_table_name
|
||||
let $diff_table_1 = $table_name;
|
||||
let $diff_table_2 = $orig_table_name;
|
||||
--source include/diff_tables.inc
|
||||
--echo # Cleanup
|
||||
--remove_file $mysqldumpfile
|
||||
eval DROP TABLE $table_name, $orig_table_name;
|
||||
|
12
mysql-test/include/no_valgrind_without_big.inc
Normal file
12
mysql-test/include/no_valgrind_without_big.inc
Normal file
@ -0,0 +1,12 @@
|
||||
# include/no_valgrind_without_big.inc
|
||||
#
|
||||
# If we are running with Valgrind ($VALGRIND_TEST <> 0) than the resource
|
||||
# consumption (storage space needed, runtime ...) will be extreme.
|
||||
# Therefore we require that the option "--big-test" is also set.
|
||||
#
|
||||
|
||||
if (`SELECT $VALGRIND_TEST <> 0 AND '$BIG_TEST' = ''`)
|
||||
{
|
||||
--skip Need "--big-test" when running with Valgrind
|
||||
}
|
||||
|
@ -177,6 +177,7 @@ show status like "Qcache_hits";
|
||||
|
||||
# Final cleanup
|
||||
eval set GLOBAL query_cache_size=$save_query_cache_size;
|
||||
disconnect connection1;
|
||||
--source include/wait_until_disconnected.inc
|
||||
connection default;
|
||||
drop table t2;
|
||||
disconnect connection1;
|
||||
|
23
mysql-test/include/wait_for_slave_io_error.inc
Normal file
23
mysql-test/include/wait_for_slave_io_error.inc
Normal file
@ -0,0 +1,23 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Waits until the IO thread of the current connection has got an
|
||||
# error, or until a timeout is reached.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# source include/wait_for_slave_io_error.inc;
|
||||
#
|
||||
# Parameters to this macro are $slave_timeout and
|
||||
# $slave_keep_connection. See wait_for_slave_param.inc for
|
||||
# descriptions.
|
||||
|
||||
let $old_slave_param_comparison= $slave_param_comparison;
|
||||
|
||||
let $slave_param= Last_IO_Errno;
|
||||
let $slave_param_comparison= !=;
|
||||
let $slave_param_value= 0;
|
||||
let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
|
||||
source include/wait_for_slave_param.inc;
|
||||
let $slave_error_message= ;
|
||||
|
||||
let $slave_param_comparison= $old_slave_param_comparison;
|
@ -22,6 +22,33 @@ use My::Platform;
|
||||
|
||||
use File::Temp qw/ tempfile tempdir /;
|
||||
|
||||
my $hint_mysqld; # Last resort guess for executable path
|
||||
|
||||
# If path in core file is 79 chars we assume it's been truncated
|
||||
# Looks like we can still find the full path using 'strings'
|
||||
# If that doesn't work, use the hint (mysqld path) as last resort.
|
||||
|
||||
sub _verify_binpath {
|
||||
my ($binary, $core_name)= @_;
|
||||
my $binpath;
|
||||
|
||||
if (length $binary != 79) {
|
||||
$binpath= $binary;
|
||||
print "Core generated by '$binpath'\n";
|
||||
} else {
|
||||
# Last occurrence of path ending in /mysql*, cut from first /
|
||||
if (`strings '$core_name' | grep "/mysql[^/. ]*\$" | tail -1` =~ /(\/.*)/) {
|
||||
$binpath= $1;
|
||||
print "Guessing that core was generated by '$binpath'\n";
|
||||
} else {
|
||||
return unless $hint_mysqld;
|
||||
$binpath= $hint_mysqld;
|
||||
print "Wild guess that core was generated by '$binpath'\n";
|
||||
}
|
||||
}
|
||||
return $binpath;
|
||||
}
|
||||
|
||||
sub _gdb {
|
||||
my ($core_name)= @_;
|
||||
|
||||
@ -33,7 +60,8 @@ sub _gdb {
|
||||
`gdb -c '$core_name' --batch 2>&1` =~
|
||||
/Core was generated by `([^\s\'\`]+)/;
|
||||
my $binary= $1 or return;
|
||||
print "Core generated by '$binary'\n";
|
||||
|
||||
$binary= _verify_binpath ($binary, $core_name) or return;
|
||||
|
||||
# Create tempfile containing gdb commands
|
||||
my ($tmp, $tmp_name) = tempfile();
|
||||
@ -73,7 +101,8 @@ sub _dbx {
|
||||
`echo | dbx - '$core_name' 2>&1` =~
|
||||
/Corefile specified executable: "([^"]+)"/;
|
||||
my $binary= $1 or return;
|
||||
print "Core generated by '$binary'\n";
|
||||
|
||||
$binary= _verify_binpath ($binary, $core_name) or return;
|
||||
|
||||
# Find all threads
|
||||
my @thr_ids = `echo threads | dbx '$binary' '$core_name' 2>&1` =~ /t@\d+/g;
|
||||
@ -203,7 +232,7 @@ sub _cdb {
|
||||
|
||||
my $cdb_cmd = "!sym prompts off; !analyze -v; .ecxr; !for_each_frame dv /t;!uniqstack -p;q";
|
||||
my $cdb_output=
|
||||
`cdb -z $core_name -i "$image_path" -y "$symbol_path" -t 0 -lines -c "$cdb_cmd" 2>&1`;
|
||||
`cdb -c "$cdb_cmd" -z $core_name -i "$image_path" -y "$symbol_path" -t 0 -lines 2>&1`;
|
||||
return if $? >> 8;
|
||||
return unless $cdb_output;
|
||||
|
||||
@ -225,7 +254,8 @@ EOF
|
||||
|
||||
|
||||
sub show {
|
||||
my ($class, $core_name)= @_;
|
||||
my ($class, $core_name, $exe_mysqld)= @_;
|
||||
$hint_mysqld= $exe_mysqld;
|
||||
|
||||
# On Windows, rely on cdb to be there...
|
||||
if (IS_WINDOWS)
|
||||
|
@ -164,6 +164,9 @@ sub copytree {
|
||||
copytree("$from_dir/$_", "$to_dir/$_");
|
||||
next;
|
||||
}
|
||||
|
||||
# Only copy plain files
|
||||
next unless -f "$from_dir/$_";
|
||||
copy("$from_dir/$_", "$to_dir/$_");
|
||||
}
|
||||
closedir(DIR);
|
||||
|
@ -536,7 +536,37 @@ sub wait_any {
|
||||
return $proc;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Wait for all processes to exit
|
||||
#
|
||||
sub wait_all {
|
||||
while(keys %running)
|
||||
{
|
||||
wait_any();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Check if any process has exited, but don't wait.
|
||||
#
|
||||
# Returns a reference to the SafeProcess that
|
||||
# exited or undefined
|
||||
#
|
||||
sub check_any {
|
||||
for my $proc (values %running){
|
||||
if ( $proc->is_child($$) ) {
|
||||
if (not $proc->wait_one(0)) {
|
||||
_verbose ("Found exited $proc");
|
||||
return $proc;
|
||||
}
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
# Overload string operator
|
||||
# and fallback to default functions if no
|
||||
# overloaded function is found
|
||||
|
@ -83,6 +83,13 @@ sub exit_status {
|
||||
};
|
||||
}
|
||||
|
||||
# threads.pm may not exist everywhere, so use only on Windows.
|
||||
|
||||
use if $^O eq "MSWin32", "threads";
|
||||
use if $^O eq "MSWin32", "threads::shared";
|
||||
|
||||
my $win32_spawn_lock :shared;
|
||||
|
||||
|
||||
#
|
||||
# Create a new process
|
||||
@ -104,6 +111,8 @@ sub create_process {
|
||||
|
||||
if ($^O eq "MSWin32"){
|
||||
|
||||
lock($win32_spawn_lock);
|
||||
|
||||
#printf STDERR "stdin %d, stdout %d, stderr %d\n",
|
||||
# fileno STDIN, fileno STDOUT, fileno STDERR;
|
||||
|
||||
|
@ -89,7 +89,7 @@ static void die(const char* fmt, ...)
|
||||
}
|
||||
|
||||
|
||||
static void kill_child (void)
|
||||
static void kill_child(void)
|
||||
{
|
||||
int status= 0;
|
||||
|
||||
@ -119,7 +119,7 @@ static void kill_child (void)
|
||||
}
|
||||
|
||||
|
||||
static void handle_abort (int sig)
|
||||
extern "C" void handle_abort(int sig)
|
||||
{
|
||||
message("Got signal %d, child_pid: %d, sending ABRT", sig, child_pid);
|
||||
|
||||
@ -129,7 +129,7 @@ static void handle_abort (int sig)
|
||||
}
|
||||
|
||||
|
||||
static void handle_signal (int sig)
|
||||
extern "C" void handle_signal(int sig)
|
||||
{
|
||||
message("Got signal %d, child_pid: %d", sig, child_pid);
|
||||
terminated= 1;
|
||||
@ -235,7 +235,8 @@ int main(int argc, char* const argv[] )
|
||||
|
||||
// Signal that child is ready
|
||||
buf= 37;
|
||||
write(pfd[1], &buf, 1);
|
||||
if ((write(pfd[1], &buf, 1)) < 1)
|
||||
die("Failed to signal that child is ready");
|
||||
// Close write end
|
||||
close(pfd[1]);
|
||||
|
||||
@ -246,8 +247,10 @@ int main(int argc, char* const argv[] )
|
||||
close(pfd[1]); // Close unused write end
|
||||
|
||||
// Wait for child to signal it's ready
|
||||
read(pfd[0], &buf, 1);
|
||||
if(buf != 37)
|
||||
if ((read(pfd[0], &buf, 1)) < 1)
|
||||
die("Failed to read signal from child");
|
||||
|
||||
if (buf != 37)
|
||||
die("Didn't get 37 from pipe");
|
||||
close(pfd[0]); // Close read end
|
||||
|
||||
@ -272,7 +275,7 @@ int main(int argc, char* const argv[] )
|
||||
if (WIFEXITED(status))
|
||||
{
|
||||
// Process has exited, collect return status
|
||||
int ret_code= WEXITSTATUS(status);
|
||||
ret_code= WEXITSTATUS(status);
|
||||
message("Child exit: %d", ret_code);
|
||||
// Exit with exit status of the child
|
||||
exit(ret_code);
|
||||
@ -287,6 +290,6 @@ int main(int argc, char* const argv[] )
|
||||
}
|
||||
kill_child();
|
||||
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -259,22 +259,37 @@ int main(int argc, const char** argv )
|
||||
the JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE flag, making sure it will be
|
||||
terminated when the last handle to it is closed(which is owned by
|
||||
this process).
|
||||
|
||||
If breakaway from job fails on some reason, fallback is to create a
|
||||
new process group. Process groups also allow to kill process and its
|
||||
descedants, subject to some restrictions (processes have to run within
|
||||
the same console,and must not ignore CTRL_BREAK)
|
||||
*/
|
||||
if (CreateProcess(NULL, (LPSTR)child_args,
|
||||
DWORD create_flags[]= {CREATE_BREAKAWAY_FROM_JOB, CREATE_NEW_PROCESS_GROUP, 0};
|
||||
BOOL process_created= FALSE;
|
||||
BOOL jobobject_assigned= FALSE;
|
||||
|
||||
for (int i=0; i < sizeof(create_flags)/sizeof(create_flags[0]); i++)
|
||||
{
|
||||
process_created= CreateProcess(NULL, (LPSTR)child_args,
|
||||
NULL,
|
||||
NULL,
|
||||
TRUE, /* inherit handles */
|
||||
CREATE_SUSPENDED | CREATE_BREAKAWAY_FROM_JOB,
|
||||
CREATE_SUSPENDED | create_flags[i],
|
||||
NULL,
|
||||
NULL,
|
||||
&si,
|
||||
&process_info) == 0)
|
||||
die("CreateProcess failed");
|
||||
&process_info);
|
||||
if (process_created)
|
||||
{
|
||||
jobobject_assigned= AssignProcessToJobObject(job_handle, process_info.hProcess);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (AssignProcessToJobObject(job_handle, process_info.hProcess) == 0)
|
||||
if (!process_created)
|
||||
{
|
||||
TerminateProcess(process_info.hProcess, 200);
|
||||
die("AssignProcessToJobObject failed");
|
||||
die("CreateProcess failed");
|
||||
}
|
||||
ResumeThread(process_info.hThread);
|
||||
CloseHandle(process_info.hThread);
|
||||
@ -312,6 +327,13 @@ int main(int argc, const char** argv )
|
||||
message("TerminateJobObject failed");
|
||||
CloseHandle(job_handle);
|
||||
message("Job terminated and closed");
|
||||
|
||||
if (!jobobject_assigned)
|
||||
{
|
||||
GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, process_info.dwProcessId);
|
||||
TerminateProcess(process_info.hProcess, 202);
|
||||
}
|
||||
|
||||
if (wait_res != WAIT_OBJECT_0 + CHILD)
|
||||
{
|
||||
/* The child has not yet returned, wait for it */
|
||||
|
@ -33,7 +33,7 @@ our $print_testcases;
|
||||
our $skip_rpl;
|
||||
our $do_test;
|
||||
our $skip_test;
|
||||
our $opt_skip_combination;
|
||||
our $skip_combinations;
|
||||
our $binlog_format;
|
||||
our $enable_disabled;
|
||||
our $default_storage_engine;
|
||||
@ -119,11 +119,22 @@ sub collect_test_cases ($$) {
|
||||
if ( $test->{name} =~ /.*\.$tname/ )
|
||||
{
|
||||
$found= 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ( not $found )
|
||||
{
|
||||
mtr_error("Could not find '$tname' in '$suites' suite(s)");
|
||||
mtr_error("Could not find '$tname' in '$suites' suite(s)") unless $sname;
|
||||
# If suite was part of name, find it there
|
||||
my ($this_case) = collect_one_suite($sname, [ $tname ]);
|
||||
if ($this_case)
|
||||
{
|
||||
push (@$cases, $this_case);
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_error("Could not find '$tname' in '$sname' suite");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -375,7 +386,7 @@ sub collect_one_suite($)
|
||||
# Read combinations for this suite and build testcases x combinations
|
||||
# if any combinations exists
|
||||
# ----------------------------------------------------------------------
|
||||
if ( ! $opt_skip_combination )
|
||||
if ( ! $skip_combinations )
|
||||
{
|
||||
my @combinations;
|
||||
my $combination_file= "$suitedir/combinations";
|
||||
@ -464,6 +475,66 @@ sub collect_one_suite($)
|
||||
#print_testcases(@cases);
|
||||
}
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Testing InnoDB plugin.
|
||||
# ----------------------------------------------------------------------
|
||||
my $lib_innodb_plugin=
|
||||
mtr_file_exists(::vs_config_dirs('storage/innodb_plugin', 'ha_innodb_plugin.dll'),
|
||||
"$::basedir/storage/innodb_plugin/.libs/ha_innodb_plugin.so",
|
||||
"$::basedir/lib/mysql/plugin/ha_innodb_plugin.so",
|
||||
"$::basedir/lib/mysql/plugin/ha_innodb_plugin.dll");
|
||||
if ($::mysql_version_id >= 50100 && !(IS_WINDOWS && $::opt_embedded_server) &&
|
||||
$lib_innodb_plugin)
|
||||
{
|
||||
my @new_cases;
|
||||
|
||||
foreach my $test (@cases)
|
||||
{
|
||||
next if ($test->{'skip'} || !$test->{'innodb_test'});
|
||||
# Exceptions
|
||||
next if ($test->{'name'} eq 'main.innodb'); # Failed with wrong errno (fk)
|
||||
# innodb_file_per_table is rw with innodb_plugin
|
||||
next if ($test->{'name'} eq 'sys_vars.innodb_file_per_table_basic');
|
||||
# innodb_lock_wait_timeout is rw with innodb_plugin
|
||||
next if ($test->{'name'} eq 'sys_vars.innodb_lock_wait_timeout_basic');
|
||||
# Diff around innodb_thread_concurrency variable
|
||||
next if ($test->{'name'} eq 'sys_vars.innodb_thread_concurrency_basic');
|
||||
# Copy test options
|
||||
my $new_test= My::Test->new();
|
||||
while (my ($key, $value) = each(%$test))
|
||||
{
|
||||
if (ref $value eq "ARRAY")
|
||||
{
|
||||
push(@{$new_test->{$key}}, @$value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_test->{$key}= $value;
|
||||
}
|
||||
}
|
||||
my $plugin_filename= basename($lib_innodb_plugin);
|
||||
push(@{$new_test->{master_opt}}, '--ignore-builtin-innodb');
|
||||
push(@{$new_test->{master_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
|
||||
push(@{$new_test->{master_opt}}, "--plugin_load=innodb=$plugin_filename;innodb_locks=$plugin_filename");
|
||||
push(@{$new_test->{slave_opt}}, '--ignore-builtin-innodb');
|
||||
push(@{$new_test->{slave_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
|
||||
push(@{$new_test->{slave_opt}}, "--plugin_load=innodb=$plugin_filename;innodb_locks=$plugin_filename");
|
||||
if ($new_test->{combination})
|
||||
{
|
||||
$new_test->{combination}.= ' + InnoDB plugin';
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_test->{combination}= 'InnoDB plugin';
|
||||
}
|
||||
push(@new_cases, $new_test);
|
||||
}
|
||||
push(@cases, @new_cases);
|
||||
}
|
||||
# ----------------------------------------------------------------------
|
||||
# End of testing InnoDB plugin.
|
||||
# ----------------------------------------------------------------------
|
||||
optimize_cases(\@cases);
|
||||
#print_testcases(@cases);
|
||||
|
||||
@ -887,7 +958,8 @@ sub collect_one_test_case {
|
||||
if ( $tinfo->{'innodb_test'} )
|
||||
{
|
||||
# This is a test that need innodb
|
||||
if ( $::mysqld_variables{'innodb'} ne "TRUE" )
|
||||
if ( $::mysqld_variables{'innodb'} eq "OFF" ||
|
||||
! exists $::mysqld_variables{'innodb'} )
|
||||
{
|
||||
# innodb is not supported, skip it
|
||||
$tinfo->{'skip'}= 1;
|
||||
|
@ -21,6 +21,24 @@
|
||||
use strict;
|
||||
use Socket;
|
||||
use Errno;
|
||||
use My::Platform;
|
||||
use if IS_WINDOWS, "Net::Ping";
|
||||
|
||||
# Ancient perl might not have port_number method for Net::Ping.
|
||||
# Check it and use fallback to connect() if it is not present.
|
||||
BEGIN
|
||||
{
|
||||
my $use_netping= 0;
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
my $ping = Net::Ping->new();
|
||||
if ($ping->can("port_number"))
|
||||
{
|
||||
$use_netping= 1;
|
||||
}
|
||||
}
|
||||
eval 'sub USE_NETPING { $use_netping }';
|
||||
}
|
||||
|
||||
sub sleep_until_file_created ($$$);
|
||||
sub mtr_ping_port ($);
|
||||
@ -30,6 +48,24 @@ sub mtr_ping_port ($) {
|
||||
|
||||
mtr_verbose("mtr_ping_port: $port");
|
||||
|
||||
if (IS_WINDOWS && USE_NETPING)
|
||||
{
|
||||
# Under Windows, connect to a port that is not open is slow
|
||||
# It takes ~1sec. Net::Ping with small timeout is much faster.
|
||||
my $ping = Net::Ping->new();
|
||||
$ping->port_number($port);
|
||||
if ($ping->ping("localhost",0.1))
|
||||
{
|
||||
mtr_verbose("USED");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_verbose("FREE");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
my $remote= "localhost";
|
||||
my $iaddr= inet_aton($remote);
|
||||
if ( ! $iaddr )
|
||||
|
@ -30,6 +30,8 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line
|
||||
mtr_report_test);
|
||||
|
||||
use mtr_match;
|
||||
use My::Platform;
|
||||
use POSIX qw[ _exit ];
|
||||
require "mtr_io.pl";
|
||||
|
||||
my $tot_real_time= 0;
|
||||
@ -69,6 +71,8 @@ sub _mtr_report_test_name ($) {
|
||||
|
||||
print _name(), _timestamp();
|
||||
printf "%-40s ", $tname;
|
||||
my $worker = $tinfo->{worker};
|
||||
printf "w$worker " if $worker;
|
||||
|
||||
return $tname;
|
||||
}
|
||||
@ -217,8 +221,8 @@ sub mtr_report_test ($) {
|
||||
}
|
||||
|
||||
|
||||
sub mtr_report_stats ($) {
|
||||
my $tests= shift;
|
||||
sub mtr_report_stats ($;$) {
|
||||
my ($tests, $dont_error)= @_;
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Find out how we where doing
|
||||
@ -257,6 +261,17 @@ sub mtr_report_stats ($) {
|
||||
$tot_restarts++;
|
||||
}
|
||||
|
||||
# Add counts for repeated runs, if any.
|
||||
# Note that the last run has already been counted above.
|
||||
my $num_repeat = $tinfo->{'repeat'} - 1;
|
||||
if ( $num_repeat > 0 )
|
||||
{
|
||||
$tot_tests += $num_repeat;
|
||||
my $rep_failed = $tinfo->{'rep_failures'} || 0;
|
||||
$tot_failed += $rep_failed;
|
||||
$tot_passed += $num_repeat - $rep_failed;
|
||||
}
|
||||
|
||||
# Look for warnings produced by mysqltest
|
||||
my $base_file= mtr_match_extension($tinfo->{'result_file'},
|
||||
"result"); # Trim extension
|
||||
@ -336,7 +351,7 @@ sub mtr_report_stats ($) {
|
||||
foreach my $tinfo (@$tests)
|
||||
{
|
||||
my $tname= $tinfo->{'name'};
|
||||
if ( $tinfo->{failures} and ! $seen{$tname})
|
||||
if ( ($tinfo->{failures} || $tinfo->{rep_failures}) and ! $seen{$tname})
|
||||
{
|
||||
print " $tname";
|
||||
$seen{$tname}= 1;
|
||||
@ -359,7 +374,7 @@ sub mtr_report_stats ($) {
|
||||
|
||||
if ( $tot_failed != 0 || $found_problems)
|
||||
{
|
||||
mtr_error("there were failing test cases");
|
||||
mtr_error("there were failing test cases") unless $dont_error;
|
||||
}
|
||||
}
|
||||
|
||||
@ -459,7 +474,14 @@ sub mtr_warning (@) {
|
||||
sub mtr_error (@) {
|
||||
print STDERR _name(), _timestamp(),
|
||||
"mysql-test-run: *** ERROR: ", join(" ", @_), "\n";
|
||||
exit(1);
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
POSIX::_exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,32 +28,36 @@ sub msg {
|
||||
# print "### unique($$) - ", join(" ", @_), "\n";
|
||||
}
|
||||
|
||||
my $file;
|
||||
my $dir;
|
||||
|
||||
if(!IS_WINDOWS)
|
||||
{
|
||||
$file= "/tmp/mysql-test-ports";
|
||||
$dir= "/tmp/mysql-unique-ids";
|
||||
}
|
||||
else
|
||||
{
|
||||
$file= $ENV{'TEMP'}."/mysql-test-ports";
|
||||
# Try to use machine-wide directory location for unique IDs,
|
||||
# $ALLUSERSPROFILE . IF it is not available, fallback to $TEMP
|
||||
# which is typically a per-user temporary directory
|
||||
if (exists $ENV{'ALLUSERSPROFILE'} && -w $ENV{'ALLUSERSPROFILE'})
|
||||
{
|
||||
$dir= $ENV{'ALLUSERSPROFILE'}."/mysql-unique-ids";
|
||||
}
|
||||
else
|
||||
{
|
||||
$dir= $ENV{'TEMP'}."/mysql-unique-ids";
|
||||
}
|
||||
}
|
||||
|
||||
my $mtr_unique_fh = undef;
|
||||
|
||||
my %mtr_unique_ids;
|
||||
|
||||
END {
|
||||
my $allocated_id= $mtr_unique_ids{$$};
|
||||
if (defined $allocated_id)
|
||||
{
|
||||
mtr_release_unique_id($allocated_id);
|
||||
}
|
||||
delete $mtr_unique_ids{$$};
|
||||
END
|
||||
{
|
||||
mtr_release_unique_id();
|
||||
}
|
||||
|
||||
#
|
||||
# Get a unique, numerical ID, given a file name (where all
|
||||
# requested IDs are stored), a minimum and a maximum value.
|
||||
# Get a unique, numerical ID in a specified range.
|
||||
#
|
||||
# If no unique ID within the specified parameters can be
|
||||
# obtained, return undef.
|
||||
@ -61,135 +65,63 @@ END {
|
||||
sub mtr_get_unique_id($$) {
|
||||
my ($min, $max)= @_;;
|
||||
|
||||
msg("get, '$file', $min-$max");
|
||||
msg("get $min-$max, $$");
|
||||
|
||||
die "Can only get one unique id per process!" if $mtr_unique_ids{$$};
|
||||
die "Can only get one unique id per process!" if defined $mtr_unique_fh;
|
||||
|
||||
my $ret = undef;
|
||||
my $changed = 0;
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
# Make sure our ID directory exists
|
||||
if (! -d $dir)
|
||||
{
|
||||
# If there is a file with the reserved
|
||||
# directory name, just delete the file.
|
||||
if (-e $dir)
|
||||
{
|
||||
unlink($dir);
|
||||
}
|
||||
|
||||
chmod 0777, "$file.sem";
|
||||
open SEM, ">", "$file.sem" or die "can't write to $file.sem";
|
||||
flock SEM, LOCK_EX or die "can't lock $file.sem";
|
||||
if(! -e $file) {
|
||||
open FILE, ">", $file or die "can't create $file";
|
||||
close FILE;
|
||||
}
|
||||
mkdir $dir;
|
||||
chmod 0777, $dir;
|
||||
|
||||
msg("HAVE THE LOCK");
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
chmod 0777, $file;
|
||||
open FILE, "+<", $file or die "can't open $file";
|
||||
#select undef,undef,undef,0.2;
|
||||
seek FILE, 0, 0;
|
||||
my %taken = ();
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
my ($id, $pid) = split / /;
|
||||
$taken{$id} = $pid;
|
||||
msg("taken: $id, $pid");
|
||||
# Check if process with given pid is alive
|
||||
if(!process_alive($pid)) {
|
||||
print "Removing slot $id used by missing process $pid\n";
|
||||
msg("Removing slot $id used by missing process $pid");
|
||||
delete $taken{$id};
|
||||
$changed++;
|
||||
if(! -d $dir)
|
||||
{
|
||||
die "can't make directory $dir";
|
||||
}
|
||||
}
|
||||
for(my $i=$min; $i<=$max; ++$i) {
|
||||
if(! exists $taken{$i}) {
|
||||
$ret = $i;
|
||||
$taken{$i} = $$;
|
||||
$changed++;
|
||||
# Remember the id this process got
|
||||
$mtr_unique_ids{$$}= $i;
|
||||
msg(" got $i");
|
||||
last;
|
||||
|
||||
|
||||
my $fh;
|
||||
for(my $id = $min; $id <= $max; $id++)
|
||||
{
|
||||
open( $fh, ">$dir/$id");
|
||||
chmod 0666, "$dir/$id";
|
||||
# Try to lock the file exclusively. If lock succeeds, we're done.
|
||||
if (flock($fh, LOCK_EX|LOCK_NB))
|
||||
{
|
||||
# Store file handle - we would need it to release the ID (==unlock the file)
|
||||
$mtr_unique_fh = $fh;
|
||||
return $id;
|
||||
}
|
||||
else
|
||||
{
|
||||
close $fh;
|
||||
}
|
||||
}
|
||||
if($changed) {
|
||||
seek FILE, 0, 0;
|
||||
truncate FILE, 0 or die "can't truncate $file";
|
||||
for my $k (keys %taken) {
|
||||
print FILE $k . ' ' . $taken{$k} . "\n";
|
||||
}
|
||||
}
|
||||
close FILE;
|
||||
|
||||
msg("RELEASING THE LOCK");
|
||||
flock SEM, LOCK_UN or warn "can't unlock $file.sem";
|
||||
close SEM;
|
||||
|
||||
return $ret;
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Release a unique ID.
|
||||
#
|
||||
sub mtr_release_unique_id($) {
|
||||
my ($myid)= @_;
|
||||
|
||||
msg("release, $myid");
|
||||
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
open SEM, ">", "$file.sem" or die "can't write to $file.sem";
|
||||
flock SEM, LOCK_EX or die "can't lock $file.sem";
|
||||
|
||||
msg("HAVE THE LOCK");
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
if(! -e $file) {
|
||||
open FILE, ">", $file or die "can't create $file";
|
||||
close FILE;
|
||||
}
|
||||
open FILE, "+<", $file or die "can't open $file";
|
||||
#select undef,undef,undef,0.2;
|
||||
seek FILE, 0, 0;
|
||||
my %taken = ();
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
my ($id, $pid) = split / /;
|
||||
msg(" taken, $id $pid");
|
||||
$taken{$id} = $pid;
|
||||
}
|
||||
|
||||
if ($taken{$myid} != $$)
|
||||
sub mtr_release_unique_id()
|
||||
{
|
||||
msg("release $$");
|
||||
if (defined $mtr_unique_fh)
|
||||
{
|
||||
msg(" The unique id for this process does not match pid");
|
||||
close $mtr_unique_fh;
|
||||
$mtr_unique_fh = undef;
|
||||
}
|
||||
|
||||
|
||||
msg(" removing $myid");
|
||||
delete $taken{$myid};
|
||||
seek FILE, 0, 0;
|
||||
truncate FILE, 0 or die "can't truncate $file";
|
||||
for my $k (keys %taken) {
|
||||
print FILE $k . ' ' . $taken{$k} . "\n";
|
||||
}
|
||||
close FILE;
|
||||
|
||||
msg("RELEASE THE LOCK");
|
||||
|
||||
flock SEM, LOCK_UN or warn "can't unlock $file.sem";
|
||||
close SEM;
|
||||
|
||||
delete $mtr_unique_ids{$$};
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,7 +126,7 @@ my $path_config_file; # The generated config file, var/my.cnf
|
||||
# executables will be used by the test suite.
|
||||
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
|
||||
|
||||
my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb";
|
||||
my $DEFAULT_SUITES= "main,binlog,federated,rpl,rpl_ndb,ndb,innodb";
|
||||
my $opt_suites;
|
||||
|
||||
our $opt_verbose= 0; # Verbose output, enable with --verbose
|
||||
@ -209,6 +209,7 @@ sub check_timeout { return $opt_testcase_timeout * 6; };
|
||||
|
||||
my $opt_start;
|
||||
my $opt_start_dirty;
|
||||
my $opt_wait_all;
|
||||
my $opt_repeat= 1;
|
||||
my $opt_retry= 3;
|
||||
my $opt_retry_failure= 2;
|
||||
@ -312,7 +313,7 @@ sub main {
|
||||
|
||||
#######################################################################
|
||||
my $num_tests= @$tests;
|
||||
if ( not defined $opt_parallel ) {
|
||||
if ( $opt_parallel eq "auto" ) {
|
||||
# Try to find a suitable value for number of workers
|
||||
my $sys_info= My::SysInfo->new();
|
||||
|
||||
@ -429,6 +430,7 @@ sub run_test_server ($$$) {
|
||||
my $completed= [];
|
||||
my %running;
|
||||
my $result;
|
||||
my $exe_mysqld= find_mysqld($basedir) || ""; # Used as hint to CoreDump
|
||||
|
||||
my $suite_timeout_proc= My::SafeProcess->timer(suite_timeout());
|
||||
|
||||
@ -500,7 +502,7 @@ sub run_test_server ($$$) {
|
||||
mtr_report(" - found '$core_name'",
|
||||
"($num_saved_cores/$opt_max_save_core)");
|
||||
|
||||
My::CoreDump->show($core_file);
|
||||
My::CoreDump->show($core_file, $exe_mysqld);
|
||||
|
||||
if ($num_saved_cores >= $opt_max_save_core) {
|
||||
mtr_report(" - deleting it, already saved",
|
||||
@ -515,6 +517,7 @@ sub run_test_server ($$$) {
|
||||
}
|
||||
}
|
||||
$num_saved_datadir++;
|
||||
$num_failed_test++ unless $result->{retries};
|
||||
|
||||
if ( !$opt_force ) {
|
||||
# Test has failed, force is off
|
||||
@ -525,11 +528,12 @@ sub run_test_server ($$$) {
|
||||
elsif ($opt_max_test_fail > 0 and
|
||||
$num_failed_test >= $opt_max_test_fail) {
|
||||
$suite_timeout_proc->kill();
|
||||
push(@$completed, $result);
|
||||
mtr_report_stats($completed, 1);
|
||||
mtr_report("Too many tests($num_failed_test) failed!",
|
||||
"Terminating...");
|
||||
return undef;
|
||||
}
|
||||
$num_failed_test++;
|
||||
}
|
||||
|
||||
# Retry test run after test failure
|
||||
@ -554,9 +558,11 @@ sub run_test_server ($$$) {
|
||||
|
||||
# Repeat test $opt_repeat number of times
|
||||
my $repeat= $result->{repeat} || 1;
|
||||
if ($repeat < $opt_repeat)
|
||||
# Don't repeat if test was skipped
|
||||
if ($repeat < $opt_repeat && $result->{'result'} ne 'MTR_RES_SKIPPED')
|
||||
{
|
||||
$result->{retries}= 0;
|
||||
$result->{rep_failures}++ if $result->{failures};
|
||||
$result->{failures}= 0;
|
||||
delete($result->{result});
|
||||
$result->{repeat}= $repeat+1;
|
||||
@ -655,6 +661,7 @@ sub run_test_server ($$$) {
|
||||
# ----------------------------------------------------
|
||||
if ( ! $suite_timeout_proc->wait_one(0) )
|
||||
{
|
||||
mtr_report_stats($completed, 1);
|
||||
mtr_report("Test suite timeout! Terminating...");
|
||||
return undef;
|
||||
}
|
||||
@ -719,6 +726,8 @@ sub run_worker ($) {
|
||||
delete($test->{'comment'});
|
||||
delete($test->{'logfile'});
|
||||
|
||||
$test->{worker} = $thread_num if $opt_parallel > 1;
|
||||
|
||||
run_testcase($test);
|
||||
#$test->{result}= 'MTR_RES_PASSED';
|
||||
# Send it back, now with results set
|
||||
@ -786,7 +795,7 @@ sub command_line_setup {
|
||||
'vs-config' => \$opt_vs_config,
|
||||
|
||||
# Max number of parallel threads to use
|
||||
'parallel=i' => \$opt_parallel,
|
||||
'parallel=s' => \$opt_parallel,
|
||||
|
||||
# Config file to use as template for all tests
|
||||
'defaults-file=s' => \&collect_option,
|
||||
@ -876,6 +885,7 @@ sub command_line_setup {
|
||||
'sleep=i' => \$opt_sleep,
|
||||
'start-dirty' => \$opt_start_dirty,
|
||||
'start' => \$opt_start,
|
||||
'wait-all' => \$opt_wait_all,
|
||||
'print-testcases' => \&collect_option,
|
||||
'repeat=i' => \$opt_repeat,
|
||||
'retry=i' => \$opt_retry,
|
||||
@ -1125,9 +1135,9 @@ sub command_line_setup {
|
||||
# --------------------------------------------------------------------------
|
||||
# Check parallel value
|
||||
# --------------------------------------------------------------------------
|
||||
if ($opt_parallel < 1)
|
||||
if ($opt_parallel ne "auto" && $opt_parallel < 1)
|
||||
{
|
||||
mtr_error("0 or negative parallel value makes no sense, use positive number");
|
||||
mtr_error("0 or negative parallel value makes no sense, use 'auto' or positive number");
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
@ -1233,6 +1243,15 @@ sub command_line_setup {
|
||||
}
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Check use of wait-all
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
if ($opt_wait_all && ! ($opt_start_dirty || $opt_start))
|
||||
{
|
||||
mtr_error("--wait-all can only be used with --start or --start-dirty");
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Check timeout arguments
|
||||
# --------------------------------------------------------------------------
|
||||
@ -1323,29 +1342,31 @@ sub set_build_thread_ports($) {
|
||||
|
||||
if ( lc($opt_build_thread) eq 'auto' ) {
|
||||
my $found_free = 0;
|
||||
$build_thread = 250; # Start attempts from here
|
||||
$build_thread = 300; # Start attempts from here
|
||||
while (! $found_free)
|
||||
{
|
||||
$build_thread= mtr_get_unique_id($build_thread, 299);
|
||||
$build_thread= mtr_get_unique_id($build_thread, 349);
|
||||
if ( !defined $build_thread ) {
|
||||
mtr_error("Could not get a unique build thread id");
|
||||
mtr_error("Could not get a unique build thread id");
|
||||
}
|
||||
$found_free= check_ports_free($build_thread);
|
||||
# If not free, release and try from next number
|
||||
mtr_release_unique_id($build_thread++) unless $found_free;
|
||||
if (! $found_free) {
|
||||
mtr_release_unique_id();
|
||||
$build_thread++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$build_thread = $opt_build_thread + $thread - 1;
|
||||
if (! check_ports_free($build_thread)) {
|
||||
# Some port was not free(which one has already been printed)
|
||||
mtr_error("Some port(s) was not free")
|
||||
}
|
||||
}
|
||||
$ENV{MTR_BUILD_THREAD}= $build_thread;
|
||||
|
||||
if (! check_ports_free($build_thread)) {
|
||||
# Some port was not free(which one has already been printed)
|
||||
mtr_error("Some port(s) was not free")
|
||||
}
|
||||
|
||||
# Calculate baseport
|
||||
$baseport= $build_thread * 10 + 10000;
|
||||
if ( $baseport < 5001 or $baseport + 9 >= 32767 )
|
||||
@ -1739,15 +1760,26 @@ sub environment_setup {
|
||||
# --------------------------------------------------------------------------
|
||||
# Add the path where mysqld will find ha_example.so
|
||||
# --------------------------------------------------------------------------
|
||||
if ($mysql_version_id >= 50100) {
|
||||
if ($mysql_version_id >= 50100 && !(IS_WINDOWS && $opt_embedded_server)) {
|
||||
my $plugin_filename;
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
$plugin_filename = "ha_example.dll";
|
||||
}
|
||||
else
|
||||
{
|
||||
$plugin_filename = "ha_example.so";
|
||||
}
|
||||
my $lib_example_plugin=
|
||||
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
|
||||
"$basedir/storage/example/.libs/ha_example.so",);
|
||||
mtr_file_exists(vs_config_dirs('storage/example',$plugin_filename),
|
||||
"$basedir/storage/example/.libs/".$plugin_filename);
|
||||
$ENV{'EXAMPLE_PLUGIN'}=
|
||||
($lib_example_plugin ? basename($lib_example_plugin) : "");
|
||||
$ENV{'EXAMPLE_PLUGIN_OPT'}= "--plugin-dir=".
|
||||
($lib_example_plugin ? dirname($lib_example_plugin) : "");
|
||||
|
||||
$ENV{'HA_EXAMPLE_SO'}="'".$plugin_filename."'";
|
||||
$ENV{'EXAMPLE_PLUGIN_LOAD'}="--plugin_load=;EXAMPLE=".$plugin_filename.";";
|
||||
}
|
||||
|
||||
# ----------------------------------------------------
|
||||
@ -3134,6 +3166,26 @@ sub find_analyze_request
|
||||
}
|
||||
|
||||
|
||||
# The test can leave a file in var/tmp/ to signal
|
||||
# that all servers should be restarted
|
||||
sub restart_forced_by_test
|
||||
{
|
||||
my $restart = 0;
|
||||
foreach my $mysqld ( mysqlds() )
|
||||
{
|
||||
my $datadir = $mysqld->value('datadir');
|
||||
my $force_restart_file = "$datadir/mtr/force_restart";
|
||||
if ( -f $force_restart_file )
|
||||
{
|
||||
mtr_verbose("Restart of servers forced by test");
|
||||
$restart = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return $restart;
|
||||
}
|
||||
|
||||
|
||||
# Return timezone value of tinfo or default value
|
||||
sub timezone {
|
||||
my ($tinfo)= @_;
|
||||
@ -3175,7 +3227,7 @@ sub run_testcase ($) {
|
||||
{
|
||||
|
||||
# Remove old datadirs
|
||||
clean_datadir();
|
||||
clean_datadir() unless $opt_start_dirty;
|
||||
|
||||
# Restore old ENV
|
||||
while (my ($option, $value)= each( %old_env )) {
|
||||
@ -3242,19 +3294,29 @@ sub run_testcase ($) {
|
||||
# --------------------------------------------------------------------
|
||||
# If --start or --start-dirty given, stop here to let user manually
|
||||
# run tests
|
||||
# If --wait-all is also given, do the same, but don't die if one
|
||||
# server exits
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
if ( $opt_start or $opt_start_dirty )
|
||||
{
|
||||
mtr_print("\nStarted", started(all_servers()));
|
||||
mtr_print("Waiting for server(s) to exit...");
|
||||
my $proc= My::SafeProcess->wait_any();
|
||||
if ( grep($proc eq $_, started(all_servers())) )
|
||||
{
|
||||
mtr_print("Server $proc died");
|
||||
if ( $opt_wait_all ) {
|
||||
My::SafeProcess->wait_all();
|
||||
mtr_print( "All servers exited" );
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
my $proc= My::SafeProcess->wait_any();
|
||||
if ( grep($proc eq $_, started(all_servers())) )
|
||||
{
|
||||
mtr_print("Server $proc died");
|
||||
exit(1);
|
||||
}
|
||||
mtr_print("Unknown process $proc died");
|
||||
exit(1);
|
||||
}
|
||||
mtr_print("Unknown process $proc died");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my $test_timeout_proc= My::SafeProcess->timer(testcase_timeout());
|
||||
@ -3272,10 +3334,38 @@ sub run_testcase ($) {
|
||||
}
|
||||
|
||||
my $test= start_mysqltest($tinfo);
|
||||
# Set only when we have to keep waiting after expectedly died server
|
||||
my $keep_waiting_proc = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
my $proc= My::SafeProcess->wait_any();
|
||||
my $proc;
|
||||
if ($keep_waiting_proc)
|
||||
{
|
||||
# Any other process exited?
|
||||
$proc = My::SafeProcess->check_any();
|
||||
if ($proc)
|
||||
{
|
||||
mtr_verbose ("Found exited process $proc");
|
||||
# If that was the timeout, cancel waiting
|
||||
if ( $proc eq $test_timeout_proc )
|
||||
{
|
||||
$keep_waiting_proc = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$proc = $keep_waiting_proc;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$proc= My::SafeProcess->wait_any();
|
||||
}
|
||||
|
||||
# Will be restored if we need to keep waiting
|
||||
$keep_waiting_proc = 0;
|
||||
|
||||
unless ( defined $proc )
|
||||
{
|
||||
mtr_error("wait_any failed");
|
||||
@ -3302,7 +3392,11 @@ sub run_testcase ($) {
|
||||
if ( $res == 0 )
|
||||
{
|
||||
my $check_res;
|
||||
if ( $opt_check_testcases and
|
||||
if ( restart_forced_by_test() )
|
||||
{
|
||||
stop_all_servers();
|
||||
}
|
||||
elsif ( $opt_check_testcases and
|
||||
$check_res= check_testcase($tinfo, "after"))
|
||||
{
|
||||
if ($check_res == 1) {
|
||||
@ -3367,8 +3461,12 @@ sub run_testcase ($) {
|
||||
# ----------------------------------------------------
|
||||
# Check if it was an expected crash
|
||||
# ----------------------------------------------------
|
||||
if ( check_expected_crash_and_restart($proc) )
|
||||
my $check_crash = check_expected_crash_and_restart($proc);
|
||||
if ($check_crash)
|
||||
{
|
||||
# Keep waiting if it returned 2, if 1 don't wait or stop waiting.
|
||||
$keep_waiting_proc = 0 if $check_crash == 1;
|
||||
$keep_waiting_proc = $proc if $check_crash == 2;
|
||||
next;
|
||||
}
|
||||
|
||||
@ -3709,16 +3807,16 @@ sub check_expected_crash_and_restart {
|
||||
{
|
||||
mtr_verbose("Crash was expected, file '$expect_file' exists");
|
||||
|
||||
while (1){
|
||||
|
||||
for (my $waits = 0; $waits < 50; $waits++)
|
||||
{
|
||||
# If last line in expect file starts with "wait"
|
||||
# sleep a little and try again, thus allowing the
|
||||
# test script to control when the server should start
|
||||
# up again
|
||||
# up again. Keep trying for up to 5s at a time.
|
||||
my $last_line= mtr_lastlinesfromfile($expect_file, 1);
|
||||
if ($last_line =~ /^wait/ )
|
||||
{
|
||||
mtr_verbose("Test says wait before restart");
|
||||
mtr_verbose("Test says wait before restart") if $waits == 0;
|
||||
mtr_milli_sleep(100);
|
||||
next;
|
||||
}
|
||||
@ -3728,11 +3826,11 @@ sub check_expected_crash_and_restart {
|
||||
# Start server with same settings as last time
|
||||
mysqld_start($mysqld, $mysqld->{'started_opts'});
|
||||
|
||||
last;
|
||||
return 1;
|
||||
}
|
||||
# Loop ran through: we should keep waiting after a re-check
|
||||
return 2;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Not an expected crash
|
||||
@ -4431,14 +4529,17 @@ sub start_servers($) {
|
||||
my $mysqld_basedir= $mysqld->value('basedir');
|
||||
if ( $basedir eq $mysqld_basedir )
|
||||
{
|
||||
# Copy datadir from installed system db
|
||||
for my $path ( "$opt_vardir", "$opt_vardir/..") {
|
||||
my $install_db= "$path/install.db";
|
||||
copytree($install_db, $datadir)
|
||||
if -d $install_db;
|
||||
if (! $opt_start_dirty) # If dirty, keep possibly grown system db
|
||||
{
|
||||
# Copy datadir from installed system db
|
||||
for my $path ( "$opt_vardir", "$opt_vardir/..") {
|
||||
my $install_db= "$path/install.db";
|
||||
copytree($install_db, $datadir)
|
||||
if -d $install_db;
|
||||
}
|
||||
mtr_error("Failed to copy system db to '$datadir'")
|
||||
unless -d $datadir;
|
||||
}
|
||||
mtr_error("Failed to copy system db to '$datadir'")
|
||||
unless -d $datadir;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4978,10 +5079,13 @@ Options to control what engine/variation to run
|
||||
vs-config Visual Studio configuration used to create executables
|
||||
(default: MTR_VS_CONFIG environment variable)
|
||||
|
||||
config|defaults-file=<config template> Use fixed config template for all
|
||||
defaults-file=<config template> Use fixed config template for all
|
||||
tests
|
||||
defaults_extra_file=<config template> Extra config template to add to
|
||||
all generated configs
|
||||
combination=<opt> Use at least twice to run tests with specified
|
||||
options to mysqld
|
||||
skip-combinations Ignore combination file (or options)
|
||||
|
||||
Options to control directories to use
|
||||
tmpdir=DIR The directory where temporary files are stored
|
||||
@ -5004,7 +5108,6 @@ Options to control what test suites or cases to run
|
||||
force Continue to run the suite after failure
|
||||
with-ndbcluster-only Run only tests that include "ndb" in the filename
|
||||
skip-ndb[cluster] Skip all tests that need cluster
|
||||
skip-ndb[cluster]-slave Skip all tests that need a slave cluster
|
||||
do-test=PREFIX or REGEX
|
||||
Run test cases which name are prefixed with PREFIX
|
||||
or fulfills REGEX
|
||||
@ -5019,6 +5122,9 @@ Options to control what test suites or cases to run
|
||||
The default is: "$DEFAULT_SUITES"
|
||||
skip-rpl Skip the replication test cases.
|
||||
big-test Also run tests marked as "big"
|
||||
enable-disabled Run also tests marked as disabled
|
||||
print_testcases Don't run the tests but print details about all the
|
||||
selected tests, in the order they would be run.
|
||||
|
||||
Options that specify ports
|
||||
|
||||
@ -5087,7 +5193,7 @@ Options for valgrind
|
||||
valgrind-options=ARGS Deprecated, use --valgrind-option
|
||||
valgrind-option=ARGS Option to give valgrind, replaces default option(s),
|
||||
can be specified more then once
|
||||
valgrind-path=[EXE] Path to the valgrind executable
|
||||
valgrind-path=<EXE> Path to the valgrind executable
|
||||
callgrind Instruct valgrind to use callgrind
|
||||
|
||||
Misc options
|
||||
@ -5095,14 +5201,19 @@ Misc options
|
||||
comment=STR Write STR to the output
|
||||
notimer Don't show test case execution time
|
||||
verbose More verbose output(use multiple times for even more)
|
||||
verbose-restart Write when and why servers are restarted
|
||||
start Only initialize and start the servers, using the
|
||||
startup settings for the first specified test case
|
||||
Example:
|
||||
$0 --start alias &
|
||||
start-dirty Only start the servers (without initialization) for
|
||||
the first specified test case
|
||||
wait-all If --start or --start-dirty option is used, wait for all
|
||||
servers to exit before finishing the process
|
||||
fast Run as fast as possible, dont't wait for servers
|
||||
to shutdown etc.
|
||||
parallel=N Run tests in N parallel threads (default=1)
|
||||
Use parallel=auto for auto-setting of N
|
||||
repeat=N Run each test N number of times
|
||||
retry=N Retry tests that fail N times, limit number of failures
|
||||
to $opt_retry_failure
|
||||
@ -5120,6 +5231,12 @@ Misc options
|
||||
sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
|
||||
gcov Collect coverage information after the test.
|
||||
The result is a gcov file per source and header file.
|
||||
experimental=<file> Refer to list of tests considered experimental;
|
||||
failures will be marked exp-fail instead of fail.
|
||||
report-features First run a "test" that reports mysql features
|
||||
timestamp Print timestamp before each test report line
|
||||
timediff With --timestamp, also print time passed since
|
||||
*previous* test started
|
||||
|
||||
HERE
|
||||
exit(1);
|
||||
|
14
mysql-test/r/bug46080.result
Normal file
14
mysql-test/r/bug46080.result
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Bug #46080: group_concat(... order by) crashes server when
|
||||
# sort_buffer_size cannot allocate
|
||||
#
|
||||
CREATE TABLE t1(a CHAR(255));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
SET @@SESSION.sort_buffer_size=5*16*1000000;
|
||||
SET @@SESSION.max_heap_table_size=5*1000000;
|
||||
# Must not crash.
|
||||
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.sort_buffer_size=default;
|
||||
SET @@SESSION.max_heap_table_size=default;
|
||||
End of 5.0 tests
|
@ -439,3 +439,16 @@ HOUR(NULL) MINUTE(NULL) SECOND(NULL)
|
||||
NULL NULL NULL
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
#
|
||||
# Bug #44766: valgrind error when using convert() in a subquery
|
||||
#
|
||||
CREATE TABLE t1(a tinyint);
|
||||
INSERT INTO t1 VALUES (127);
|
||||
SELECT 1 FROM
|
||||
(
|
||||
SELECT CONVERT(t2.a USING UTF8) FROM t1, t1 t2 LIMIT 1
|
||||
) AS s LIMIT 1;
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
@ -766,15 +766,11 @@ call p_verify_status_increment(2, 2, 2, 2);
|
||||
SUCCESS
|
||||
|
||||
savepoint a;
|
||||
call p_verify_status_increment(0, 0, 0, 0);
|
||||
call p_verify_status_increment(1, 0, 1, 0);
|
||||
SUCCESS
|
||||
|
||||
insert t1 set a=4;
|
||||
# Binlog does not register itself this time for other than the 1st
|
||||
# statement of the transaction with MIXED/STATEMENT binlog_format.
|
||||
# It needs registering with the ROW format. Therefore 1,0,2,2 are
|
||||
# the correct arguments to this test after bug#40221 fixed.
|
||||
call p_verify_status_increment(1, 0, 2, 2);
|
||||
call p_verify_status_increment(2, 2, 2, 2);
|
||||
SUCCESS
|
||||
|
||||
release savepoint a;
|
||||
|
@ -785,6 +785,8 @@ eta tipo c
|
||||
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|
||||
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
|
||||
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
** Cleanup
|
||||
** connection thread2
|
||||
** connection default
|
||||
drop table t1;
|
||||
drop user mysqltest@localhost;
|
||||
|
@ -781,6 +781,8 @@ eta tipo c
|
||||
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
|
||||
80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
|
||||
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
|
||||
** Cleanup
|
||||
** connection thread2
|
||||
** connection default
|
||||
drop table t1;
|
||||
drop user mysqltest@localhost;
|
||||
|
@ -1,6 +1,9 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
# Establish connection con1 (user=root)
|
||||
# Establish connection con2 (user=root)
|
||||
### Test 1:
|
||||
### - While a consistent snapshot transaction is executed,
|
||||
### no external inserts should be visible to the transaction.
|
||||
# Switch to connection con1
|
||||
CREATE TABLE t1 (a INT) ENGINE=innodb;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
@ -10,6 +13,9 @@ INSERT INTO t1 VALUES(1);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
COMMIT;
|
||||
### Test 2:
|
||||
### - For any non-consistent snapshot transaction, external
|
||||
### committed inserts should be visible to the transaction.
|
||||
DELETE FROM t1;
|
||||
START TRANSACTION;
|
||||
# Switch to connection con2
|
||||
@ -19,5 +25,18 @@ SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
COMMIT;
|
||||
### Test 3:
|
||||
### - Bug#44664: valgrind warning for COMMIT_AND_CHAIN and ROLLBACK_AND_CHAIN
|
||||
### Chaining a transaction does not retain consistency level.
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
DELETE FROM t1;
|
||||
COMMIT WORK AND CHAIN;
|
||||
# Switch to connection con2
|
||||
INSERT INTO t1 VALUES(1);
|
||||
# Switch to connection con1
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
COMMIT;
|
||||
# Switch to connection default + close connections con1 and con2
|
||||
DROP TABLE t1;
|
||||
|
@ -9,10 +9,10 @@ EXECUTE stmt1 USING @var1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
SELECT HEX(f1) FROM t1;
|
||||
HEX(f1)
|
||||
8300
|
||||
|
@ -9,7 +9,7 @@ EXECUTE stmt1 USING @var1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES('ƒ\0')
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(0x8300)
|
||||
SELECT HEX(f1) FROM t1;
|
||||
HEX(f1)
|
||||
8300
|
||||
@ -29,21 +29,29 @@ HEX(s1) HEX(s2) d
|
||||
466F6F2773206120426172 ED40ED41ED42 47.93
|
||||
DROP PROCEDURE bug18293|
|
||||
DROP TABLE t4|
|
||||
SHOW BINLOG EVENTS FROM 369|
|
||||
SHOW BINLOG EVENTS FROM 370|
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 369 Query 1 535 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
|
||||
master-bin.000001 370 Query 1 536 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
|
||||
s2 CHAR(50) CHARACTER SET cp932,
|
||||
d DECIMAL(10,2))
|
||||
master-bin.000001 535 Query 1 784 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
|
||||
master-bin.000001 536 Query 1 785 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
|
||||
IN ins2 CHAR(50) CHARACTER SET cp932,
|
||||
IN ind DECIMAL(10,2))
|
||||
BEGIN
|
||||
INSERT INTO t4 VALUES (ins1, ins2, ind);
|
||||
END
|
||||
master-bin.000001 784 Query 1 1048 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
|
||||
master-bin.000001 1048 Query 1 1137 use `test`; DROP PROCEDURE bug18293
|
||||
master-bin.000001 1137 Query 1 1216 use `test`; DROP TABLE t4
|
||||
master-bin.000001 785 Query 1 1049 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
|
||||
master-bin.000001 1049 Query 1 1138 use `test`; DROP PROCEDURE bug18293
|
||||
master-bin.000001 1138 Query 1 1217 use `test`; DROP TABLE t4
|
||||
End of 5.0 tests
|
||||
SHOW BINLOG EVENTS FROM 364;
|
||||
SHOW BINLOG EVENTS FROM 365;
|
||||
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
|
||||
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
|
||||
CREATE TABLE t1 (a varchar(16)) character set cp932;
|
||||
INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
|
||||
SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
|
||||
hex(a) hex(lower(a)) hex(upper(a))
|
||||
8352835E 8352835E 8352835E
|
||||
8372835E 8372835E 8372835E
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
26
mysql-test/r/ctype_gbk_binlog.result
Normal file
26
mysql-test/r/ctype_gbk_binlog.result
Normal file
@ -0,0 +1,26 @@
|
||||
SET NAMES gbk;
|
||||
CREATE TABLE t1 (
|
||||
f1 BLOB
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=gbk;
|
||||
CREATE PROCEDURE p1(IN val BLOB)
|
||||
BEGIN
|
||||
SET @tval = val;
|
||||
SET @sql_cmd = CONCAT_WS(' ', 'insert into t1(f1) values(?)');
|
||||
PREPARE stmt FROM @sql_cmd;
|
||||
EXECUTE stmt USING @tval;
|
||||
DEALLOCATE PREPARE stmt;
|
||||
END|
|
||||
SET @`tcontent`:=_binary 0x50434B000900000000000000E9000000 COLLATE `binary`/*!*/;
|
||||
CALL p1(@`tcontent`);
|
||||
FLUSH LOGS;
|
||||
DROP PROCEDURE p1;
|
||||
RENAME TABLE t1 to t2;
|
||||
SELECT hex(f1) FROM t2;
|
||||
hex(f1)
|
||||
50434B000900000000000000E9000000
|
||||
SELECT hex(f1) FROM t1;
|
||||
hex(f1)
|
||||
50434B000900000000000000E9000000
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
@ -40,6 +40,14 @@ abcd abcd
|
||||
efgh efgh
|
||||
ijkl ijkl
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#43827 Server closes connections and restarts
|
||||
#
|
||||
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
|
||||
INSERT INTO t1 SELECT REPEAT('a',11);
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'c1' at row 1
|
||||
DROP TABLE t1;
|
||||
show collation like 'ucs2_vn_ci';
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
ucs2_vn_ci ucs2 242 8
|
||||
|
@ -209,3 +209,13 @@ SET NAMES sjis;
|
||||
SELECT HEX('佐淘 圭') FROM DUAL;
|
||||
HEX('佐淘 圭')
|
||||
8DB2939181408C5C
|
||||
# Start of 5.1 tests
|
||||
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
|
||||
CREATE TABLE t1 (a varchar(16)) character set sjis;
|
||||
INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
|
||||
SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
|
||||
hex(a) hex(lower(a)) hex(upper(a))
|
||||
8352835E 8352835E 8352835E
|
||||
8372835E 8372835E 8372835E
|
||||
DROP TABLE t1;
|
||||
# End of 5.1 tests
|
||||
|
@ -2829,7 +2829,11 @@ t2 CREATE TABLE `t2` (
|
||||
`col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
|
||||
|
||||
---> connection: con2
|
||||
|
||||
---> connection: con3
|
||||
|
||||
---> connection: default
|
||||
use test|
|
||||
DROP DATABASE mysqltest1|
|
||||
DROP DATABASE mysqltest2|
|
||||
USE test;
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
|
@ -2829,7 +2829,11 @@ t2 CREATE TABLE `t2` (
|
||||
`col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
|
||||
|
||||
---> connection: con2
|
||||
|
||||
---> connection: con3
|
||||
|
||||
---> connection: default
|
||||
use test|
|
||||
DROP DATABASE mysqltest1|
|
||||
DROP DATABASE mysqltest2|
|
||||
USE test;
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP DATABASE mysqltest2;
|
||||
|
@ -383,3 +383,21 @@ select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
|
||||
ID DATA FID
|
||||
drop table t1, t2;
|
||||
drop user mysqltest_1;
|
||||
# End of 4.1 tests
|
||||
SELECT 0 FROM
|
||||
(SELECT 0) t01, (SELECT 0) t02, (SELECT 0) t03, (SELECT 0) t04, (SELECT 0) t05,
|
||||
(SELECT 0) t06, (SELECT 0) t07, (SELECT 0) t08, (SELECT 0) t09, (SELECT 0) t10,
|
||||
(SELECT 0) t11, (SELECT 0) t12, (SELECT 0) t13, (SELECT 0) t14, (SELECT 0) t15,
|
||||
(SELECT 0) t16, (SELECT 0) t17, (SELECT 0) t18, (SELECT 0) t19, (SELECT 0) t20,
|
||||
(SELECT 0) t21, (SELECT 0) t22, (SELECT 0) t23, (SELECT 0) t24, (SELECT 0) t25,
|
||||
(SELECT 0) t26, (SELECT 0) t27, (SELECT 0) t28, (SELECT 0) t29, (SELECT 0) t30,
|
||||
(SELECT 0) t31, (SELECT 0) t32, (SELECT 0) t33, (SELECT 0) t34, (SELECT 0) t35,
|
||||
(SELECT 0) t36, (SELECT 0) t37, (SELECT 0) t38, (SELECT 0) t39, (SELECT 0) t40,
|
||||
(SELECT 0) t41, (SELECT 0) t42, (SELECT 0) t43, (SELECT 0) t44, (SELECT 0) t45,
|
||||
(SELECT 0) t46, (SELECT 0) t47, (SELECT 0) t48, (SELECT 0) t49, (SELECT 0) t50,
|
||||
(SELECT 0) t51, (SELECT 0) t52, (SELECT 0) t53, (SELECT 0) t54, (SELECT 0) t55,
|
||||
(SELECT 0) t56, (SELECT 0) t57, (SELECT 0) t58, (SELECT 0) t59, (SELECT 0) t60,
|
||||
(SELECT 0) t61;
|
||||
0
|
||||
0
|
||||
# End of 5.0 tests
|
||||
|
@ -629,21 +629,21 @@ SELECT DISTINCT @v5:= fruit_id, @v6:= fruit_name INTO @v7, @v8 FROM t1 WHERE
|
||||
fruit_name = 'APPLE';
|
||||
SELECT @v5, @v6, @v7, @v8;
|
||||
@v5 @v6 @v7 @v8
|
||||
3 PEAR 3 PEAR
|
||||
2 APPLE 2 APPLE
|
||||
SELECT DISTINCT @v5 + fruit_id, CONCAT(@v6, fruit_name) INTO @v9, @v10 FROM t1
|
||||
WHERE fruit_name = 'APPLE';
|
||||
SELECT @v5, @v6, @v7, @v8, @v9, @v10;
|
||||
@v5 @v6 @v7 @v8 @v9 @v10
|
||||
3 PEAR 3 PEAR 5 PEARAPPLE
|
||||
2 APPLE 2 APPLE 4 APPLEAPPLE
|
||||
SELECT DISTINCT @v11:= @v5 + fruit_id, @v12:= CONCAT(@v6, fruit_name) INTO
|
||||
@v13, @v14 FROM t1 WHERE fruit_name = 'APPLE';
|
||||
SELECT @v11, @v12, @v13, @v14;
|
||||
@v11 @v12 @v13 @v14
|
||||
6 PEARPEAR 6 PEARPEAR
|
||||
4 APPLEAPPLE 4 APPLEAPPLE
|
||||
SELECT DISTINCT @v13, @v14 INTO @v15, @v16 FROM t1 WHERE fruit_name = 'APPLE';
|
||||
SELECT @v15, @v16;
|
||||
@v15 @v16
|
||||
6 PEARPEAR
|
||||
4 APPLEAPPLE
|
||||
SELECT DISTINCT 2 + 2, 'Bob' INTO @v17, @v18 FROM t1 WHERE fruit_name =
|
||||
'APPLE';
|
||||
SELECT @v17, @v18;
|
||||
|
@ -63,3 +63,4 @@ DROP TABLE fill_it1;
|
||||
DROP TABLE fill_it2;
|
||||
DROP TABLE fill_it3;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler=off;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user