mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 5.2->5.3
- Re-commit Monty's merge, partially fixed by Igor and SergeyP, but still broken
This commit is contained in:
20
.bzrignore
20
.bzrignore
@ -1470,15 +1470,15 @@ storage/maria/ma_test1
|
||||
storage/maria/ma_test2
|
||||
storage/maria/ma_test3
|
||||
storage/maria/ma_test_all
|
||||
storage/maria/maria.log
|
||||
storage/maria/maria_chk
|
||||
storage/maria/maria_control
|
||||
storage/maria/maria_dump_log
|
||||
storage/maria/maria_ftdump
|
||||
storage/maria/maria_log
|
||||
storage/maria/maria_log.*
|
||||
storage/maria/maria_pack
|
||||
storage/maria/maria_read_log
|
||||
storage/maria/aria.log
|
||||
storage/maria/aria_chk
|
||||
storage/maria/aria_control
|
||||
storage/maria/aria_dump_log
|
||||
storage/maria/aria_ftdump
|
||||
storage/maria/aria_log
|
||||
storage/maria/aria_log.*
|
||||
storage/maria/aria_pack
|
||||
storage/maria/aria_read_log
|
||||
storage/maria/tmp
|
||||
storage/maria/tmp/*
|
||||
storage/maria/unittest/ma_pagecache_consist_1k-t-big
|
||||
@ -1941,3 +1941,5 @@ sql/client_plugin.c
|
||||
libmysqld/create_options.cc
|
||||
storage/pbxt/bin/xtstat
|
||||
libmysqld/sql_expression_cache.cc
|
||||
mysql-test/mtr_command
|
||||
scripts/convert-debug-for-diff
|
||||
|
@ -83,6 +83,3 @@ EXTRA_DIST = FINISH.sh \
|
||||
compile-solaris-x86-32-debug-forte \
|
||||
compile-solaris-x86-forte-32 \
|
||||
util.sh
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -91,29 +91,26 @@ path=`dirname $0`
|
||||
get_make_parallel_flag
|
||||
|
||||
# SSL library to use.--with-ssl will select our bundled yaSSL
|
||||
# implementation of SSL. To use openSSl you will nee too point out
|
||||
# the location of openSSL headers and lbs on your system.
|
||||
# implementation of SSL. To use OpenSSL you will need to specify
|
||||
# the location of OpenSSL headers and libs on your system.
|
||||
# Ex --with-ssl=/usr
|
||||
SSL_LIBRARY=--with-ssl
|
||||
|
||||
if [ "x$warning_mode" != "xpedantic" ]; then
|
||||
# Both C and C++ warnings
|
||||
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
|
||||
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
|
||||
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
|
||||
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
|
||||
|
||||
# For more warnings, uncomment the following line
|
||||
# warnings="$global_warnings -Wshadow"
|
||||
# warnings="$warnings -Wshadow"
|
||||
|
||||
# C warnings
|
||||
c_warnings="$warnings -Wunused-parameter"
|
||||
c_warnings="$warnings"
|
||||
# C++ warnings
|
||||
cxx_warnings="$warnings"
|
||||
cxx_warnings="$warnings -Wno-unused-parameter"
|
||||
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
|
||||
cxx_warnings="$cxx_warnings -Wreorder"
|
||||
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||
# Added unless --with-debug=full
|
||||
debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized"
|
||||
debug_extra_cflags="-O0 -g3 -gdwarf-2"
|
||||
else
|
||||
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
|
||||
c_warnings="$warnings"
|
||||
@ -127,8 +124,12 @@ fi
|
||||
|
||||
# Set flags for various build configurations.
|
||||
# Used in -valgrind builds
|
||||
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
|
||||
# LINT_INIT(), which is only useful for silencing spurious warnings
|
||||
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
|
||||
valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
|
||||
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||
valgrind_configs="--with-valgrind"
|
||||
#
|
||||
# Used in -debug builds
|
||||
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
|
||||
@ -162,7 +163,7 @@ base_configs="--prefix=$prefix --enable-assembler "
|
||||
base_configs="$base_configs --with-extra-charsets=complex "
|
||||
base_configs="$base_configs --enable-thread-safe-client "
|
||||
base_configs="$base_configs --with-big-tables"
|
||||
base_configs="$base_configs --with-plugin-maria --with-maria-tmp-tables --without-plugin-innodb_plugin"
|
||||
base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables --without-plugin-innodb_plugin"
|
||||
# Compile our client programs with static libraries to allow them to be moved
|
||||
base_configs="$base_configs --with-mysqld-ldflags=-static --with-client-ldflags=-static"
|
||||
|
||||
@ -178,8 +179,7 @@ max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max"
|
||||
max_no_qc_configs="$SSL_LIBRARY --with-plugins=max --without-query-cache"
|
||||
max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server --with-libevent"
|
||||
max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server --with-libevent"
|
||||
# Disable NDB in maria max builds
|
||||
max_configs=$max_no_ndb_configs
|
||||
all_configs="$SSL_LIBRARY --with-plugins=max --with-plugin-ndbcluster --with-embedded-server --with-innodb_plugin --with-libevent"
|
||||
|
||||
#
|
||||
# CPU and platform specific compilation flags.
|
||||
|
@ -941,6 +941,7 @@ set_valgrind_flags()
|
||||
loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
|
||||
loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
|
||||
compiler_flags="$compiler_flags $loc_valgrind_flags"
|
||||
with_flags="$with_flags --with-valgrind"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -181,14 +181,17 @@ check_cpu () {
|
||||
cc=$CC
|
||||
fi
|
||||
|
||||
cc_ver=`$cc --version | sed 1q`
|
||||
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
|
||||
set -- `echo $cc_verno | tr '.' ' '`
|
||||
cc_major=$1
|
||||
cc_minor=$2
|
||||
cc_patch=$3
|
||||
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
|
||||
|
||||
# check if compiler is gcc and dump its version
|
||||
cc_verno=`$cc -dumpversion 2>/dev/null`
|
||||
if test "x$?" = "x0" ; then
|
||||
set -- `echo $cc_verno | tr '.' ' '`
|
||||
cc_ver="GCC"
|
||||
cc_major=$1
|
||||
cc_minor=$2
|
||||
cc_patch=$3
|
||||
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
|
||||
fi
|
||||
|
||||
case "$cc_ver--$cc_verno" in
|
||||
*GCC*)
|
||||
# different gcc backends (and versions) have different CPU flags
|
||||
@ -229,7 +232,7 @@ check_cpu () {
|
||||
fi
|
||||
while [ "$cpu_arg" ] ; do
|
||||
printf "testing $cpu_arg ... " >&2
|
||||
|
||||
|
||||
# compile check
|
||||
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
|
||||
if test "x$?" = "x0" ; then
|
||||
@ -243,5 +246,5 @@ check_cpu () {
|
||||
done
|
||||
rm __test.*
|
||||
}
|
||||
|
||||
|
||||
check_cpu
|
||||
|
7
BUILD/compile-amd64-debug-all
Executable file
7
BUILD/compile-amd64-debug-all
Executable file
@ -0,0 +1,7 @@
|
||||
#! /bin/sh
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
extra_flags="$amd64_cflags $debug_cflags"
|
||||
extra_configs="$amd64_configs $debug_configs $all_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
@ -4,7 +4,7 @@ path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$amd64_cflags $debug_cflags $valgrind_flags"
|
||||
extra_configs="$amd64_configs $debug_configs $max_configs"
|
||||
extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
||||
|
10
BUILD/compile-pentium-debug-all
Executable file
10
BUILD/compile-pentium-debug-all
Executable file
@ -0,0 +1,10 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
set -- "$@" --with-debug=full
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags"
|
||||
extra_configs="$pentium_configs $debug_configs $all_configs $error_inject --with-experimental-collations"
|
||||
|
||||
. "$path/FINISH.sh"
|
@ -29,6 +29,6 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
|
||||
c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
|
||||
cxx_warnings="$c_warnings -wd869,874"
|
||||
base_cxxflags="-fno-exceptions -fno-rtti"
|
||||
extra_configs="$pentium_configs $debug_configs"
|
||||
extra_configs="$pentium_configs $debug_configs $valgrind_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
@ -4,7 +4,7 @@ path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
|
||||
extra_configs="$pentium_configs $debug_configs $max_configs"
|
||||
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
||||
|
@ -4,7 +4,7 @@ path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
|
||||
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
|
||||
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
||||
|
12
BUILD/compile-pentium64-debug-all
Executable file
12
BUILD/compile-pentium64-debug-all
Executable file
@ -0,0 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
set -- "$@" --with-debug=full
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium64_cflags $debug_cflags"
|
||||
extra_configs="$pentium_configs $debug_configs $all_configs"
|
||||
|
||||
extra_configs="$extra_configs "
|
||||
CC="$CC --pipe"
|
||||
. "$path/FINISH.sh"
|
@ -4,7 +4,7 @@ path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
|
||||
extra_configs="$pentium_configs $debug_configs $max_configs"
|
||||
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
||||
|
135
CMakeLists.txt
135
CMakeLists.txt
@ -116,8 +116,7 @@ IF(MSVC)
|
||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
|
||||
STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
|
||||
|
||||
# generate map files, set stack size (see bug#20815)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS")
|
||||
# set stack size (see bug#20815)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576")
|
||||
|
||||
# remove support for Exception handling
|
||||
@ -283,13 +282,13 @@ IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
|
||||
SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_partition_plugin")
|
||||
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
|
||||
|
||||
# Special handling for tmp tables with the maria engine
|
||||
IF(WITH_MARIA_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_MARIA_STORAGE_ENGINE)
|
||||
# Special handling for tmp tables with the Aria engine
|
||||
IF(WITH_ARIA_STORAGE_ENGINE)
|
||||
ADD_DEFINITIONS(-DWITH_ARIA_STORAGE_ENGINE)
|
||||
IF(WITH_MARIA_TMP_TABLES)
|
||||
ADD_DEFINITIONS(-DUSE_MARIA_FOR_TMP_TABLES)
|
||||
ENDIF(WITH_MARIA_TMP_TABLES)
|
||||
ENDIF(WITH_MARIA_STORAGE_ENGINE)
|
||||
ENDIF(WITH_ARIA_STORAGE_ENGINE)
|
||||
|
||||
ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS})
|
||||
|
||||
@ -329,10 +328,132 @@ ADD_SUBDIRECTORY(libmysql)
|
||||
ADD_SUBDIRECTORY(libservices)
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(unittest/mytap)
|
||||
ADD_SUBDIRECTORY(unittest/examples)
|
||||
ADD_SUBDIRECTORY(unittest/mysys)
|
||||
IF(WITH_EMBEDDED_SERVER)
|
||||
ADD_SUBDIRECTORY(libmysqld)
|
||||
ADD_SUBDIRECTORY(libmysqld/examples)
|
||||
ENDIF(WITH_EMBEDDED_SERVER)
|
||||
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
|
||||
|
||||
# Set up the installer
|
||||
SET(CPACK_PACKAGE_NAME "MariaDB")
|
||||
STRING(REPLACE "-MariaDB" "" CPACK_PACKAGE_VERSION ${VERSION})
|
||||
SET(CPACK_PACKAGE_VENDOR "Monty Program AB http://www.montyprogram.com")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB")
|
||||
SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING)
|
||||
SET(CPACK_GENERATOR NSIS)
|
||||
|
||||
# Use our own NSIS template
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/win/cmake" ${CMAKE_MODULE_PATH})
|
||||
|
||||
# Installer components and grouping
|
||||
SET(CPACK_COMPONENT_GROUP_SERVER_DESCRIPTION "The files necessary for running the MariaDB server.")
|
||||
SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "Files used in development on the MariaDB server.")
|
||||
SET(CPACK_ALL_INSTALL_TYPES Normal Development)
|
||||
SET(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "MariaDB server")
|
||||
SET(CPACK_COMPONENT_RUNTIME_DESCRIPTION "The server itself. You want to install this one.")
|
||||
SET(CPACK_COMPONENT_RUNTIME_GROUP "Server")
|
||||
SET(CPACK_COMPONENT_RUNTIME_INSTALL_TYPES Normal Development)
|
||||
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Development headers")
|
||||
SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "Header files for development on MariaDB.")
|
||||
SET(CPACK_COMPONENT_HEADERS_DEPENDS runtime)
|
||||
SET(CPACK_COMPONENT_HEADERS_GROUP "Development")
|
||||
SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Development)
|
||||
SET(CPACK_COMPONENT_EMBEDDED_DISPLAY_NAME "Embedded")
|
||||
SET(CPACK_COMPONENT_EMBEDDED_DESCRIPTION "Files for embedding MariaDB in other projects.")
|
||||
SET(CPACK_COMPONENT_EMBEDDED_DEPENDS headers)
|
||||
SET(CPACK_COMPONENT_EMBEDDED_GROUP "Development")
|
||||
SET(CPACK_COMPONENT_EMBEDDED_INSTALL_TYPES Development)
|
||||
SET(CPACK_COMPONENT_SCRIPTS_DISPLAY_NAME "Server scripts")
|
||||
SET(CPACK_COMPONENT_SCRIPTS_DESCRIPTION "SQL and Perl scripts to control and modify the server. You need a perl installation for some of these to work.")
|
||||
SET(CPACK_COMPONENT_SCRIPTS_DEPENDS runtime)
|
||||
SET(CPACK_COMPONENT_SCRIPTS_GROUP "Server")
|
||||
SET(CPACK_COMPONENT_SCRIPTS_INSTALL_TYPES Normal Development)
|
||||
SET(CPACK_COMPONENT_MYSQLTEST_DISPLAY_NAME "MariaDB test suite")
|
||||
SET(CPACK_COMPONENT_MYSQLTEST_DESCRIPTION "The MariaDB regression test suite.")
|
||||
SET(CPACK_COMPONENT_MYSQLTEST_DEPENDS runtime)
|
||||
SET(CPACK_COMPONENT_MYSQLTEST_GROUP "Testing")
|
||||
SET(CPACK_COMPONENT_MYSQLTEST_INSTALL_TYPES Normal Development)
|
||||
SET(CPACK_COMPONENT_SQLBENCH_DISPLAY_NAME "SQL Bench")
|
||||
SET(CPACK_COMPONENT_SQLBENCH_DESCRIPTION "The MariaDB benchmark suite.")
|
||||
SET(CPACK_COMPONENT_SQLBENCH_DEPENDS runtime)
|
||||
SET(CPACK_COMPONENT_SQLBENCH_GROUP "Testing")
|
||||
SET(CPACK_COMPONENT_SQLBENCH_INSTALL_TYPES Normal Development)
|
||||
|
||||
# Add files to the installer
|
||||
INSTALL(FILES COPYING EXCEPTIONS-CLIENT DESTINATION .)
|
||||
INSTALL(FILES support-files/my-huge.ini support-files/my-innodb-heavy-4G.ini DESTINATION .)
|
||||
INSTALL(FILES support-files/my-large.ini support-files/my-medium.ini DESTINATION .)
|
||||
INSTALL(FILES support-files/my-small.ini DESTINATION .)
|
||||
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION Docs)
|
||||
INSTALL(FILES COPYING DESTINATION Docs)
|
||||
FILE(GLOB headerfiles "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
||||
INSTALL(FILES ${headerfiles} DESTINATION include COMPONENT headers)
|
||||
INSTALL(FILES include/mysql/plugin.h DESTINATION include/mysql COMPONENT headers)
|
||||
INSTALL(FILES libmysql/libmysql.def DESTINATION include COMPONENT headers)
|
||||
|
||||
# Handle the database files
|
||||
FILE(GLOB datafiles "${CMAKE_CURRENT_SOURCE_DIR}/win/data/mysql/*")
|
||||
INSTALL(FILES ${datafiles} DESTINATION data/clean/mysql)
|
||||
INSTALL(FILES win/data/aria_log.00000001 win/data/aria_log_control DESTINATION data/clean)
|
||||
INSTALL(DIRECTORY win/data/test DESTINATION data/clean)
|
||||
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
|
||||
IfFileExists '$INSTDIR\\\\data\\\\mysql\\\\db.frm' 0 CopyDatabaseFiles
|
||||
MessageBox MB_OK 'There are already database files present in the data directory. Clean database files are not written to the directory'
|
||||
GoTo EndCopyDatabaseFiles
|
||||
CopyDatabaseFiles:
|
||||
CopyFiles '$INSTDIR\\\\data\\\\clean\\\\*' '$INSTDIR\\\\data'
|
||||
EndCopyDatabaseFiles:")
|
||||
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
|
||||
MessageBox MB_OK 'This will not delete the database files in $INSTDIR\\\\data'")
|
||||
|
||||
# Files in the share dir
|
||||
INSTALL(FILES sql/share/errmsg.txt DESTINATION share COMPONENT runtime)
|
||||
FILE(GLOB charsets sql/share/charsets/*)
|
||||
INSTALL(FILES ${charsets} DESTINATION share/charsets COMPONENT runtime)
|
||||
FILE(GLOB share_dirs sql/share/*/errmsg.sys)
|
||||
FOREACH(ERRMSGFILE ${share_dirs})
|
||||
STRING(REPLACE "//" "/" ERRMSGFILE ${ERRMSGFILE}) # Work around a cmake bug
|
||||
FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/sql/share ${ERRMSGFILE})
|
||||
STRING(REPLACE "/errmsg.sys" "" DIRNAME ${DIRNAME})
|
||||
INSTALL(FILES ${ERRMSGFILE} DESTINATION share/${DIRNAME} COMPONENT runtime)
|
||||
ENDFOREACH(ERRMSGFILE ${share_dirs})
|
||||
|
||||
# MTR files
|
||||
FILE(GLOB_RECURSE testfiles mysql-test/*)
|
||||
FOREACH(testfile ${testfiles})
|
||||
FILE(RELATIVE_PATH dirname ${PROJECT_SOURCE_DIR} ${testfile})
|
||||
GET_FILENAME_COMPONENT(dirname ${dirname} PATH)
|
||||
GET_FILENAME_COMPONENT(filename ${testfile} NAME)
|
||||
GET_FILENAME_COMPONENT(ext ${testfile} EXT)
|
||||
SET(ok "yes")
|
||||
IF (NOT "x_${ext}" STREQUAL "x_")
|
||||
# Test if this is one of the extensions we don't want to install
|
||||
STRING(TOLOWER ${ext} ext)
|
||||
IF(${ext} STREQUAL ".dir" OR ${ext} STREQUAL ".vcproj" OR ${ext} STREQUAL ".user" OR ${ext} STREQUAL ".ilk"
|
||||
OR ${ext} STREQUAL ".idb" OR ${ext} STREQUAL ".map" OR ${ext} STREQUAL ".gcov"
|
||||
OR ${ext} STREQUAL ".supp" OR ${ext} STREQUAL ".am" OR ${ext} STREQUAL ".stress")
|
||||
SET(ok "no")
|
||||
ENDIF()
|
||||
ENDIF(NOT "x_${ext}" STREQUAL "x_")
|
||||
IF (${ok} STREQUAL "yes")
|
||||
# Message("Dir: ${dirname}. File: ${filename}. Ext: ${ext}")
|
||||
INSTALL(FILES ${testfile} DESTINATION ${dirname} COMPONENT mysqltest)
|
||||
ENDIF(${ok} STREQUAL "yes")
|
||||
ENDFOREACH(testfile ${testfiles})
|
||||
|
||||
# SQL Bench
|
||||
FILE(GLOB_RECURSE benchfiles sql-bench/*)
|
||||
FOREACH(testfile ${testfiles})
|
||||
FILE(RELATIVE_PATH dirname ${PROJECT_SOURCE_DIR} ${testfile})
|
||||
GET_FILENAME_COMPONENT(dirname ${dirname} PATH)
|
||||
GET_FILENAME_COMPONENT(filename ${testfile} NAME)
|
||||
IF(NOT ${dirname} STREQUAL "sql-bench" OR ${filename} STREQUAL "README")
|
||||
INSTALL(FILES ${testfile} DESTINATION ${dirname} COMPONENT sqlbench)
|
||||
ENDIF()
|
||||
ENDFOREACH(testfile ${testfiles})
|
||||
|
||||
INCLUDE(InstallRequiredSystemLibraries)
|
||||
|
||||
# This must always be the last line
|
||||
INCLUDE(CPack)
|
||||
|
@ -37,6 +37,3 @@ uninstall-local:
|
||||
@RM@ -f $(DESTDIR)$(infodir)/mysql.info ; \
|
||||
@RM@ -f $(DESTDIR)$(pkgdatadir)/ChangeLog ; \
|
||||
fi
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -161,8 +161,8 @@ test-bt:
|
||||
-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
|
||||
cd mysql-test ; \
|
||||
MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+rpl_ndb+ps --force --timer \
|
||||
--ps-protocol --mysqld=--binlog-format=row --suite=ndb,rpl_ndb ; \
|
||||
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+ps --force --timer \
|
||||
--ps-protocol --mysqld=--binlog-format=row --suite=ndb ; \
|
||||
MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
|
||||
--with-ndbcluster-only ; \
|
||||
@ -325,7 +325,7 @@ abi_check_all: $(TEST_PREPROCESSOR_HEADER)
|
||||
do_abi_check:
|
||||
set -ex; \
|
||||
for file in $(abi_headers); do \
|
||||
@CC@ -E -nostdinc -dI \
|
||||
@CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/include/mysql \
|
||||
-I$(top_srcdir)/sql \
|
||||
@ -341,6 +341,3 @@ do_abi_check:
|
||||
@DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
|
||||
@RM@ $(top_builddir)/abi_check.out; \
|
||||
done
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -85,3 +85,5 @@ ENDIF(EMBED_MANIFESTS)
|
||||
|
||||
ADD_DEFINITIONS(-DHAVE_DLOPEN)
|
||||
|
||||
INSTALL(TARGETS mysql mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow
|
||||
mysqlbinlog mysqladmin mysqlslap echo DESTINATION bin COMPONENT runtime)
|
||||
|
@ -123,6 +123,3 @@ link_sources:
|
||||
rm -f $(srcdir)/my_user.c; \
|
||||
@LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c;
|
||||
echo timestamp > link_sources;
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
214
client/mysql.cc
214
client/mysql.cc
@ -1,5 +1,6 @@
|
||||
/* Copyright (C) 2000-2009 MySQL AB & Monty Program Ab
|
||||
/* Copyright (C) 2000-2009 MySQL AB
|
||||
Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright 2000-2010 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -15,7 +16,6 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#define COPYRIGHT_NOTICE "\
|
||||
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.\n\
|
||||
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
|
||||
and you are welcome to modify and redistribute it under the GPL v2 license\n"
|
||||
|
||||
@ -151,16 +151,18 @@ 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,
|
||||
ignore_spaces= 0;
|
||||
static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error;
|
||||
static my_bool column_types_flag;
|
||||
static my_bool preserve_comments= 0;
|
||||
static my_bool in_com_source, aborted= 0;
|
||||
static ulong opt_max_allowed_packet, opt_net_buffer_length;
|
||||
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
|
||||
static uint my_end_arg;
|
||||
static char * opt_mysql_unix_port=0;
|
||||
static int connect_flag=CLIENT_INTERACTIVE;
|
||||
static int interrupted_query= 0;
|
||||
static char *current_host,*current_db,*current_user=0,*opt_password=0,
|
||||
*current_prompt=0, *delimiter_str= 0,
|
||||
*default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
|
||||
@ -1088,6 +1090,7 @@ int main(int argc,char *argv[])
|
||||
"\\N [\\d]> ",MYF(MY_WME));
|
||||
current_prompt = my_strdup(default_prompt,MYF(MY_WME));
|
||||
prompt_counter=0;
|
||||
aborted= 0;
|
||||
|
||||
outfile[0]=0; // no (default) outfile
|
||||
strmov(pager, "stdout"); // the default, if --pager wasn't given
|
||||
@ -1282,8 +1285,10 @@ sig_handler mysql_end(int sig)
|
||||
/*
|
||||
This function handles sigint calls
|
||||
If query is in process, kill query
|
||||
If 'source' is executed, abort source command
|
||||
no query in process, terminate like previous behavior
|
||||
*/
|
||||
|
||||
sig_handler handle_sigint(int sig)
|
||||
{
|
||||
char kill_buffer[40];
|
||||
@ -1322,7 +1327,8 @@ sig_handler handle_sigint(int sig)
|
||||
mysql_close(kill_mysql);
|
||||
tee_fprintf(stdout, "Ctrl-C -- query killed. Continuing normally.\n");
|
||||
interrupted_query= 0;
|
||||
|
||||
if (in_com_source)
|
||||
aborted= 1; // Abort source command
|
||||
return;
|
||||
|
||||
err:
|
||||
@ -1348,65 +1354,73 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, 0, 0},
|
||||
{"abort-source-on-error", OPT_ABORT_SOURCE_ON_ERROR,
|
||||
"Abort 'source filename' operations in case of errors",
|
||||
(uchar**) &batch_abort_on_error, (uchar**) &batch_abort_on_error, 0,
|
||||
&batch_abort_on_error, &batch_abort_on_error, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __NETWARE__
|
||||
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"auto-rehash", OPT_AUTO_REHASH,
|
||||
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
|
||||
(uchar**) &opt_rehash, (uchar**) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
||||
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table "
|
||||
"and field completion, but startup and reconnecting may take a longer time. "
|
||||
"Disable with --disable-auto-rehash.",
|
||||
&opt_rehash, &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
||||
0, 0},
|
||||
{"no-auto-rehash", 'A',
|
||||
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.",
|
||||
"No automatic rehashing. One has to use 'rehash' to get table and field "
|
||||
"completion. This gives a quicker start of mysql and disables rehashing "
|
||||
"on reconnect.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"batch", 'B',
|
||||
"Don't use history file. Disable interactive behavior. (Enables --silent.)", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Don't use history file. Disable interactive behavior. (Enables --silent.)",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &charsets_dir,
|
||||
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", &charsets_dir,
|
||||
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"column-type-info", OPT_COLUMN_TYPES, "Display column type information.",
|
||||
(uchar**) &column_types_flag, (uchar**) &column_types_flag,
|
||||
&column_types_flag, &column_types_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"comments", 'c', "Preserve comments. Send comments to the server."
|
||||
" The default is --skip-comments (discard comments), enable with --comments.",
|
||||
(uchar**) &preserve_comments, (uchar**) &preserve_comments,
|
||||
&preserve_comments, &preserve_comments,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit.",
|
||||
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
|
||||
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug", '#', "Output debug log.", &default_dbug_option,
|
||||
&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.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &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,
|
||||
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"database", 'D', "Database to use.", (uchar**) ¤t_db,
|
||||
(uchar**) ¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
|
||||
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"database", 'D', "Database to use.", ¤t_db,
|
||||
¤t_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (uchar**) &default_charset,
|
||||
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", (uchar**) &delimiter_str,
|
||||
(uchar**) &delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Set the default character set.", &default_charset,
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delimiter", OPT_DELIMITER, "Delimiter to be used.", &delimiter_str,
|
||||
&delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0,
|
||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"vertical", 'E', "Print the output of a query (rows) vertically.",
|
||||
(uchar**) &vertical, (uchar**) &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
&vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"force", 'f', "Continue even if we get an SQL error. Sets abort-source-on-error to 0",
|
||||
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"named-commands", 'G',
|
||||
"Enable named commands. Named commands mean this program's internal commands; see mysql> help . When enabled, the named commands can be used from any line of the query, otherwise only from the first line, before an enter. Disable with --disable-named-commands. This option is disabled by default.",
|
||||
(uchar**) &named_cmds, (uchar**) &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
"Enable named commands. Named commands mean this program's internal "
|
||||
"commands; see mysql> help . When enabled, the named commands can be "
|
||||
"used from any line of the query, otherwise only from the first line, "
|
||||
"before an enter. Disable with --disable-named-commands. This option "
|
||||
"is disabled by default.",
|
||||
&named_cmds, &named_cmds, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"no-named-commands", 'g',
|
||||
"Named commands are disabled. Use \\* form only, or use named commands "
|
||||
@ -1416,47 +1430,54 @@ static struct my_option my_long_options[] =
|
||||
"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.",
|
||||
(uchar**) &ignore_spaces, (uchar**) &ignore_spaces, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&ignore_spaces, &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},
|
||||
{"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
|
||||
(uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) ¤t_host,
|
||||
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"html", 'H', "Produce HTML output.", (uchar**) &opt_html, (uchar**) &opt_html,
|
||||
&opt_local_infile,
|
||||
&opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
|
||||
&opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", ¤t_host,
|
||||
¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"html", 'H', "Produce HTML output.", &opt_html, &opt_html,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"xml", 'X', "Produce XML output.", (uchar**) &opt_xml, (uchar**) &opt_xml, 0,
|
||||
{"xml", 'X', "Produce XML output.", &opt_xml, &opt_xml, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"line-numbers", OPT_LINE_NUMBERS, "Write line numbers for errors.",
|
||||
(uchar**) &line_numbers, (uchar**) &line_numbers, 0, GET_BOOL,
|
||||
&line_numbers, &line_numbers, 0, GET_BOOL,
|
||||
NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"skip-line-numbers", 'L', "Don't write line number for errors.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"unbuffered", 'n', "Flush buffer after each query.", (uchar**) &unbuffered,
|
||||
(uchar**) &unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"unbuffered", 'n', "Flush buffer after each query.", &unbuffered,
|
||||
&unbuffered, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"column-names", OPT_COLUMN_NAMES, "Write column names in results.",
|
||||
(uchar**) &column_names, (uchar**) &column_names, 0, GET_BOOL,
|
||||
&column_names, &column_names, 0, GET_BOOL,
|
||||
NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"skip-column-names", 'N',
|
||||
"Don't write column names in results.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"set-variable", 'O',
|
||||
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
|
||||
"Change the value of a variable. Please note that this option is "
|
||||
"deprecated; you can set variables directly with --variable-name=value.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"sigint-ignore", OPT_SIGINT_IGNORE, "Ignore SIGINT (CTRL-C).",
|
||||
(uchar**) &opt_sigint_ignore, (uchar**) &opt_sigint_ignore, 0, GET_BOOL,
|
||||
&opt_sigint_ignore, &opt_sigint_ignore, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"one-database", 'o',
|
||||
"Only update the default database. This is useful for skipping updates to other database in the update log.",
|
||||
"Only update the default database. This is useful for skipping updates "
|
||||
"to other database in the update log.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef USE_POPEN
|
||||
{"pager", OPT_PAGER,
|
||||
"Pager to use to display results. If you don't supply an option, the default pager is taken from your ENV variable PAGER. Valid pagers are less, more, cat [> filename], etc. See interactive help (\\h) also. This option does not work in batch mode. Disable with --disable-pager. This option is disabled by default.",
|
||||
"Pager to use to display results. If you don't supply an option, the "
|
||||
"default pager is taken from your ENV variable PAGER. Valid pagers are "
|
||||
"less, more, cat [> filename], etc. See interactive help (\\h) also. "
|
||||
"This option does not work in batch mode. Disable with --disable-pager. "
|
||||
"This option is disabled by default.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-pager", OPT_NOPAGER,
|
||||
"Disable pager and print to stdout. See interactive help (\\h) also. WARNING: option deprecated; use --disable-pager instead.",
|
||||
"Disable pager and print to stdout. See interactive help (\\h) also. "
|
||||
"WARNING: option deprecated; use --disable-pager instead.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"password", 'p',
|
||||
@ -1472,48 +1493,53 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &opt_mysql_port,
|
||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
|
||||
(uchar**) ¤t_prompt, (uchar**) ¤t_prompt, 0, GET_STR_ALLOC,
|
||||
¤t_prompt, ¤t_prompt, 0, GET_STR_ALLOC,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"quick", 'q',
|
||||
"Don't cache result, print it row by row. This may slow down the server if the output is suspended. Doesn't use history file.",
|
||||
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Don't cache result, print it row by row. This may slow down the server "
|
||||
"if the output is suspended. Doesn't use history file.",
|
||||
&quick, &quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"raw", 'r', "Write fields without conversion. Used with --batch.",
|
||||
(uchar**) &opt_raw_data, (uchar**) &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_raw_data, &opt_raw_data, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable with --disable-reconnect. This option is enabled by default.",
|
||||
(uchar**) &opt_reconnect, (uchar**) &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"silent", 's', "Be more silent. Print results with a tab as separator, each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"reconnect", OPT_RECONNECT, "Reconnect if the connection is lost. Disable "
|
||||
"with --disable-reconnect. This option is enabled by default.",
|
||||
&opt_reconnect, &opt_reconnect, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"silent", 's', "Be more silent. Print results with a tab as separator, "
|
||||
"each row on new line.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Base name of shared memory.", &shared_memory_base_name,
|
||||
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
|
||||
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR_ALLOC,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include "sslopt-longopts.h"
|
||||
{"table", 't', "Output in table format.", (uchar**) &output_tables,
|
||||
(uchar**) &output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"table", 't', "Output in table format.", &output_tables,
|
||||
&output_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"tee", OPT_TEE,
|
||||
"Append everything into outfile. See interactive help (\\h) also. Does not work in batch mode. Disable with --disable-tee. This option is disabled by default.",
|
||||
"Append everything into outfile. See interactive help (\\h) also. "
|
||||
"Does not work in batch mode. Disable with --disable-tee. "
|
||||
"This option is disabled by default.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. WARNING: Option deprecated; use --disable-tee instead.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-tee", OPT_NOTEE, "Disable outfile. See interactive help (\\h) also. "
|
||||
"WARNING: Option deprecated; use --disable-tee instead.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
|
||||
(uchar**) ¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", ¤t_user,
|
||||
¤t_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
|
||||
(uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
|
||||
(uchar**) &safe_updates, (uchar**) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
|
||||
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -1523,35 +1549,32 @@ static struct my_option my_long_options[] =
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"connect_timeout", OPT_CONNECT_TIMEOUT,
|
||||
"Number of seconds before connection timeout.",
|
||||
(uchar**) &opt_connect_timeout,
|
||||
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
|
||||
0, 0},
|
||||
&opt_connect_timeout, &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG,
|
||||
0, 0, 3600*12, 0, 0, 0},
|
||||
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
|
||||
"The maximum packet length to send to or receive from server.",
|
||||
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
|
||||
&opt_max_allowed_packet, &opt_max_allowed_packet, 0,
|
||||
GET_ULONG, REQUIRED_ARG, 16 *1024L*1024L, 4096,
|
||||
(longlong) 2*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
|
||||
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
|
||||
"The buffer size for TCP/IP and socket communication.",
|
||||
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0, GET_ULONG,
|
||||
&opt_net_buffer_length, &opt_net_buffer_length, 0, GET_ULONG,
|
||||
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
|
||||
{"select_limit", OPT_SELECT_LIMIT,
|
||||
"Automatic limit for SELECT when using --safe-updates.",
|
||||
(uchar**) &select_limit,
|
||||
(uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ULONG_MAX,
|
||||
0, 1, 0},
|
||||
&select_limit, &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L,
|
||||
1, ULONG_MAX, 0, 1, 0},
|
||||
{"max_join_size", OPT_MAX_JOIN_SIZE,
|
||||
"Automatic limit for rows in a join when using --safe-updates.",
|
||||
(uchar**) &max_join_size,
|
||||
(uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ULONG_MAX,
|
||||
0, 1, 0},
|
||||
&max_join_size, &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L,
|
||||
1, ULONG_MAX, 0, 1, 0},
|
||||
{"secure-auth", OPT_SECURE_AUTH, "Refuse client connecting to server if it"
|
||||
" uses old (pre-4.1.1) protocol.", (uchar**) &opt_secure_auth,
|
||||
(uchar**) &opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
" uses old (pre-4.1.1) protocol.", &opt_secure_auth,
|
||||
&opt_secure_auth, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"server-arg", OPT_SERVER_ARG, "Send embedded server this as a parameter.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.",
|
||||
(uchar**) &show_warnings, (uchar**) &show_warnings, 0, GET_BOOL, NO_ARG,
|
||||
&show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
|
||||
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
|
||||
@ -1869,7 +1892,7 @@ static int read_and_execute(bool interactive)
|
||||
String buffer;
|
||||
#endif
|
||||
|
||||
char *line;
|
||||
char *line= 0;
|
||||
char in_string=0;
|
||||
ulong line_number=0;
|
||||
bool ml_comment= 0;
|
||||
@ -1877,7 +1900,7 @@ static int read_and_execute(bool interactive)
|
||||
bool truncated= 0;
|
||||
status.exit_status=1;
|
||||
|
||||
for (;;)
|
||||
while (!aborted)
|
||||
{
|
||||
if (!interactive)
|
||||
{
|
||||
@ -2220,9 +2243,12 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
||||
the line -- which would occur only because of the
|
||||
user sending newline -- which is itself whitespace
|
||||
and should also match.
|
||||
We also ignore lines starting with '--', even if there
|
||||
isn't a whitespace after. (This makes it easier to run
|
||||
mysql-test-run cases through the client)
|
||||
*/
|
||||
(my_isspace(charset_info,pos[2]) ||
|
||||
!pos[2])))))
|
||||
((my_isspace(charset_info,pos[2]) || !pos[2]) ||
|
||||
(buffer.is_empty() && out == line))))))
|
||||
{
|
||||
// Flush previously accepted characters
|
||||
if (out != line)
|
||||
@ -3638,7 +3664,7 @@ xmlencode_print(const char *src, uint length)
|
||||
tee_fputs("NULL", PAGER);
|
||||
else
|
||||
{
|
||||
for (const char *p = src; length; *p++, length--)
|
||||
for (const char *p = src; length; p++, length--)
|
||||
{
|
||||
const char *t;
|
||||
if ((t = array_value(xmlmeta, *p)))
|
||||
@ -3957,7 +3983,7 @@ static int
|
||||
com_connect(String *buffer, char *line)
|
||||
{
|
||||
char *tmp, buff[256];
|
||||
bool save_rehash= opt_rehash;
|
||||
my_bool save_rehash= opt_rehash;
|
||||
int error;
|
||||
|
||||
bzero(buff, sizeof(buff));
|
||||
@ -4054,17 +4080,19 @@ static int com_source(String *buffer, char *line)
|
||||
status.file_name=source_name;
|
||||
glob_buffer.length(0); // Empty command buffer
|
||||
ignore_errors= !batch_abort_on_error;
|
||||
in_com_source= 1;
|
||||
error= read_and_execute(false);
|
||||
ignore_errors= save_ignore_errors;
|
||||
status=old_status; // Continue as before
|
||||
in_com_source= aborted= 0;
|
||||
my_fclose(sql_file,MYF(0));
|
||||
batch_readline_end(line_buff);
|
||||
/*
|
||||
If we got an error during source operation, don't abort the client
|
||||
if ignore_errors is set
|
||||
*/
|
||||
if (error && batch_abort_on_error && ignore_errors)
|
||||
error= -1;
|
||||
if (error && !batch_abort_on_error && ignore_errors)
|
||||
error= -1; // Ignore error
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -4806,7 +4834,7 @@ static const char *construct_prompt()
|
||||
struct tm *t = localtime(&lclock);
|
||||
|
||||
/* parse thru the settings for the prompt */
|
||||
for (char *c = current_prompt; *c ; *c++)
|
||||
for (char *c = current_prompt; *c ; c++)
|
||||
{
|
||||
if (*c != PROMPT_CHAR)
|
||||
processed_prompt.append(*c);
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
Copyright (C) 2010 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -17,7 +18,7 @@
|
||||
#include <sslopt-vars.h>
|
||||
#include "../scripts/mysql_fix_privilege_tables_sql.c"
|
||||
|
||||
#define VER "1.1"
|
||||
#define VER "1.2"
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
@ -34,8 +35,9 @@
|
||||
static char mysql_path[FN_REFLEN];
|
||||
static char mysqlcheck_path[FN_REFLEN];
|
||||
|
||||
static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag;
|
||||
static uint my_end_arg= 0;
|
||||
static my_bool opt_force, debug_info_flag, debug_check_flag, opt_silent;
|
||||
static my_bool opt_not_used; /* For compatiblity */
|
||||
static uint my_end_arg= 0, opt_verbose;
|
||||
static char *opt_user= (char*)"root";
|
||||
|
||||
static DYNAMIC_STRING ds_args;
|
||||
@ -62,13 +64,15 @@ static struct my_option my_long_options[]=
|
||||
{
|
||||
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"basedir", 'b', "Not used by mysql_upgrade. Only for backward compatibility.",
|
||||
{"basedir", 'b',
|
||||
"Not used by mysql_upgrade. Only for backward compatibility.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", 0,
|
||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
|
||||
(uchar**)¬_used, (uchar**)¬_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Not used by mysql_upgrade. Only for backward compatibility.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
|
||||
{"compress", OPT_COMPRESS,
|
||||
"Not used by mysql_upgrade. Only for backward compatibility.",
|
||||
¬_used, ¬_used, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"datadir", 'd',
|
||||
"Not used by mysql_upgrade. Only for backward compatibility.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -76,26 +80,25 @@ static struct my_option my_long_options[]=
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit.",
|
||||
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log.", (uchar* *) & default_dbug_option,
|
||||
(uchar* *) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug", '#', "Output debug log.", &default_dbug_option,
|
||||
&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.",
|
||||
(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,
|
||||
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&debug_check_flag, &debug_check_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
|
||||
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", 0,
|
||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Not used by mysql_upgrade. Only for backward compatibility.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
|
||||
"has already been executed for the current version of MySQL.",
|
||||
(uchar**)&opt_force, (uchar**)&opt_force, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host",'h', "Connect to host.", 0,
|
||||
&opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", 0,
|
||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given,"
|
||||
" it's solicited on the tty.", (uchar**) &opt_password,(uchar**) &opt_password,
|
||||
" it's solicited on the tty.", &opt_password,&opt_password,
|
||||
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __WIN__
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
|
||||
@ -116,20 +119,21 @@ static struct my_option my_long_options[]=
|
||||
"Base name of shared memory.", 0,
|
||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Print less information", &opt_silent,
|
||||
&opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The 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},
|
||||
{"user", 'u', "User for login if not current user.", &opt_user,
|
||||
&opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"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},
|
||||
&opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"write-binlog", OPT_WRITE_BINLOG,
|
||||
"All commands including mysqlcheck are binlogged. Enabled by default;"
|
||||
"use --skip-write-binlog when commands should not be sent to replication slaves.",
|
||||
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
|
||||
&opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
@ -173,7 +177,7 @@ static void verbose(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
if (!opt_verbose)
|
||||
if (opt_silent)
|
||||
return;
|
||||
|
||||
/* Print the verbose message */
|
||||
@ -266,6 +270,18 @@ get_one_option(int optid, const struct my_option *opt,
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'v': /* --verbose */
|
||||
opt_verbose++;
|
||||
if (argument == disabled_my_option)
|
||||
{
|
||||
opt_verbose= 0;
|
||||
opt_silent= 1;
|
||||
}
|
||||
add_option= 0;
|
||||
break;
|
||||
case 's':
|
||||
opt_verbose= 0;
|
||||
add_option= 0;
|
||||
break;
|
||||
case 'f': /* --force */
|
||||
add_option= FALSE;
|
||||
break;
|
||||
@ -426,7 +442,8 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
|
||||
len, self_name, FN_LIBCHAR, tool_name);
|
||||
}
|
||||
|
||||
verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
|
||||
if (opt_verbose)
|
||||
verbose("Looking for '%s' as: %s", tool_name, tool_executable_name);
|
||||
|
||||
/*
|
||||
Make sure it can be executed
|
||||
@ -496,7 +513,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
|
||||
"--database=mysql",
|
||||
"--batch", /* Turns off pager etc. */
|
||||
force ? "--force": "--skip-force",
|
||||
ds_res ? "--silent": "",
|
||||
ds_res || opt_silent ? "--silent": "",
|
||||
"<",
|
||||
query_file_path,
|
||||
"2>&1",
|
||||
@ -649,6 +666,8 @@ static void create_mysql_upgrade_info_file(void)
|
||||
|
||||
static void print_conn_args(const char *tool_name)
|
||||
{
|
||||
if (opt_verbose < 2)
|
||||
return;
|
||||
if (conn_args.str[0])
|
||||
verbose("Running '%s' with connection arguments: %s", tool_name,
|
||||
conn_args.str);
|
||||
@ -664,6 +683,7 @@ static void print_conn_args(const char *tool_name)
|
||||
|
||||
static int run_mysqlcheck_upgrade(void)
|
||||
{
|
||||
verbose("Phase 2/3: Checking and upgrading tables");
|
||||
print_conn_args("mysqlcheck");
|
||||
return run_tool(mysqlcheck_path,
|
||||
NULL, /* Send output from mysqlcheck directly to screen */
|
||||
@ -672,6 +692,8 @@ static int run_mysqlcheck_upgrade(void)
|
||||
"--check-upgrade",
|
||||
"--all-databases",
|
||||
"--auto-repair",
|
||||
!opt_silent || opt_verbose ? "--verbose": "",
|
||||
opt_silent ? "--silent": "",
|
||||
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
|
||||
NULL);
|
||||
}
|
||||
@ -679,6 +701,7 @@ static int run_mysqlcheck_upgrade(void)
|
||||
|
||||
static int run_mysqlcheck_fixnames(void)
|
||||
{
|
||||
verbose("Phase 1/3: Fixing table and database names");
|
||||
print_conn_args("mysqlcheck");
|
||||
return run_tool(mysqlcheck_path,
|
||||
NULL, /* Send output from mysqlcheck directly to screen */
|
||||
@ -687,6 +710,8 @@ static int run_mysqlcheck_fixnames(void)
|
||||
"--all-databases",
|
||||
"--fix-db-names",
|
||||
"--fix-table-names",
|
||||
opt_verbose ? "--verbose": "",
|
||||
opt_silent ? "--silent": "",
|
||||
opt_write_binlog ? "--write-binlog" : "--skip-write-binlog",
|
||||
NULL);
|
||||
}
|
||||
@ -756,7 +781,7 @@ static int run_sql_fix_privilege_tables(void)
|
||||
if (init_dynamic_string(&ds_result, "", 512, 512))
|
||||
die("Out of memory");
|
||||
|
||||
verbose("Running 'mysql_fix_privilege_tables'...");
|
||||
verbose("Phase 3/3: Running 'mysql_fix_privilege_tables'...");
|
||||
run_query(mysql_fix_privilege_tables,
|
||||
&ds_result, /* Collect result */
|
||||
TRUE);
|
||||
|
@ -128,37 +128,37 @@ static struct my_option my_long_options[] =
|
||||
#endif
|
||||
{"count", 'c',
|
||||
"Number of iterations to make. This works with -i (--sleep) only.",
|
||||
(uchar**) &nr_iterations, (uchar**) &nr_iterations, 0, GET_UINT,
|
||||
&nr_iterations, &nr_iterations, 0, GET_UINT,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifndef DBUG_OFF
|
||||
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
|
||||
0, 0, 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.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"force", 'f',
|
||||
"Don't ask for confirmation on drop database; with multiple commands, continue even if an error occurs.",
|
||||
(uchar**) &option_force, (uchar**) &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&option_force, &option_force, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &charsets_dir,
|
||||
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", &charsets_dir,
|
||||
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (uchar**) &default_charset,
|
||||
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Set the default character set.", &default_charset,
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
|
||||
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-beep", 'b', "Turn off beep on error.", (uchar**) &opt_nobeep,
|
||||
(uchar**) &opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-beep", 'b', "Turn off beep on error.", &opt_nobeep,
|
||||
&opt_nobeep, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -172,50 +172,52 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &tcp_port,
|
||||
(uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&tcp_port,
|
||||
&tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"relative", 'r',
|
||||
"Show difference between current and previous values when used with -i. Currently only works with extended-status.",
|
||||
(uchar**) &opt_relative, (uchar**) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
"Show difference between current and previous values when used with -i. "
|
||||
"Currently only works with extended-status.",
|
||||
&opt_relative, &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"set-variable", 'O',
|
||||
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
|
||||
"Change the value of a variable. Please note that this option is "
|
||||
"deprecated; you can set variables directly with --variable-name=value.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||
"Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Silently exit if one can't connect to server.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &unix_port, (uchar**) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
&unix_port, &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"sleep", 'i', "Execute commands repeatedly with a sleep between.",
|
||||
(uchar**) &interval, (uchar**) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
&interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) &user,
|
||||
(uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", &user,
|
||||
&user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"verbose", 'v', "Write more information.", (uchar**) &opt_verbose,
|
||||
(uchar**) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Write more information.", &opt_verbose,
|
||||
&opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"vertical", 'E',
|
||||
"Print output vertically. Is similar to --relative, but prints output vertically.",
|
||||
(uchar**) &opt_vertical, (uchar**) &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_vertical, &opt_vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"wait", 'w', "Wait and retry if connection is down.", 0, 0, 0, GET_UINT,
|
||||
OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", (uchar**) &opt_connect_timeout,
|
||||
(uchar**) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
|
||||
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", &opt_connect_timeout,
|
||||
&opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
|
||||
3600*12, 0, 1, 0},
|
||||
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
|
||||
(uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
|
||||
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout,
|
||||
&opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
|
||||
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
@ -1467,7 +1469,7 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified,
|
||||
struct stat *pidfile_status)
|
||||
{
|
||||
char buff[FN_REFLEN];
|
||||
int error= 1;
|
||||
my_bool error= 1;
|
||||
uint count= 0;
|
||||
DBUG_ENTER("wait_pidfile");
|
||||
|
||||
|
@ -1062,9 +1062,8 @@ static struct my_option my_long_options[] =
|
||||
"events); 'always' prints base64 whenever possible. 'always' is for "
|
||||
"debugging only and should not be used in a production system. If this "
|
||||
"argument is not given, the default is 'auto'; if it is given with no "
|
||||
"argument, 'always' is used."
|
||||
,(uchar**) &opt_base64_output_mode_str,
|
||||
(uchar**) &opt_base64_output_mode_str,
|
||||
"argument, 'always' is used.",
|
||||
&opt_base64_output_mode_str, &opt_base64_output_mode_str,
|
||||
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
/*
|
||||
mysqlbinlog needs charsets knowledge, to be able to convert a charset
|
||||
@ -1073,43 +1072,43 @@ static struct my_option my_long_options[] =
|
||||
SET @`a`:=_cp850 0x4DFC6C6C6572 COLLATE `cp850_general_ci`;
|
||||
*/
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &charsets_dir,
|
||||
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", &charsets_dir,
|
||||
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"database", 'd', "List entries for just this database (local log only).",
|
||||
(uchar**) &database, (uchar**) &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
|
||||
&database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#ifndef DBUG_OFF
|
||||
{"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
|
||||
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug", '#', "Output debug log.", &default_dbug_option,
|
||||
&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 .",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
|
||||
"enabled --to-last-log and are sending the output to the same MySQL server. "
|
||||
"This way you could avoid an endless loop. You would also like to use it "
|
||||
"when restoring after a crash to avoid duplication of the statements you "
|
||||
"already have. NOTE: you will need a SUPER privilege to use this option.",
|
||||
(uchar**) &disable_log_bin, (uchar**) &disable_log_bin, 0, GET_BOOL,
|
||||
&disable_log_bin, &disable_log_bin, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"force-if-open", 'F', "Force if binlog was not closed properly.",
|
||||
(uchar**) &force_if_open_opt, (uchar**) &force_if_open_opt, 0, GET_BOOL, NO_ARG,
|
||||
&force_if_open_opt, &force_if_open_opt, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"force-read", 'f', "Force reading unknown binlog events.",
|
||||
(uchar**) &force_opt, (uchar**) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&force_opt, &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"hexdump", 'H', "Augment output with hexadecimal and ASCII event dump.",
|
||||
(uchar**) &opt_hexdump, (uchar**) &opt_hexdump, 0, GET_BOOL, NO_ARG,
|
||||
&opt_hexdump, &opt_hexdump, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Get the binlog from server.", (uchar**) &host, (uchar**) &host,
|
||||
{"host", 'h', "Get the binlog from server.", &host, &host,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"local-load", 'l', "Prepare local temporary files for LOAD DATA INFILE in the specified directory.",
|
||||
(uchar**) &dirname_for_local_load, (uchar**) &dirname_for_local_load, 0,
|
||||
&dirname_for_local_load, &dirname_for_local_load, 0,
|
||||
GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"offset", 'o', "Skip the first N entries.", (uchar**) &offset, (uchar**) &offset,
|
||||
{"offset", 'o', "Skip the first N entries.", &offset, &offset,
|
||||
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p', "Password to connect to remote server.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -1119,10 +1118,10 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
|
||||
&port, &port, 0, GET_INT, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"position", OPT_POSITION, "Deprecated. Use --start-position instead.",
|
||||
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
||||
&start_position, &start_position, 0, GET_ULL,
|
||||
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
|
||||
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */
|
||||
(ulonglong)(~(uint32)0), 0, 0, 0},
|
||||
@ -1130,31 +1129,31 @@ static struct my_option my_long_options[] =
|
||||
"The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"read-from-remote-server", 'R', "Read binary logs from a MySQL server.",
|
||||
(uchar**) &remote_opt, (uchar**) &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&remote_opt, &remote_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"server-id", OPT_SERVER_ID,
|
||||
"Extract only binlog entries created by the server having the given id.",
|
||||
(uchar**) &server_id, (uchar**) &server_id, 0, GET_ULONG,
|
||||
&server_id, &server_id, 0, GET_ULONG,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"set-charset", OPT_SET_CHARSET,
|
||||
"Add 'SET NAMES character_set' to the output.", (uchar**) &charset,
|
||||
(uchar**) &charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Add 'SET NAMES character_set' to the output.", &charset,
|
||||
&charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
||||
(uchar**) &shared_memory_base_name,
|
||||
"Base name of shared memory.", &shared_memory_base_name,
|
||||
&shared_memory_base_name,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"short-form", 's', "Just show regular queries: no extra info and no "
|
||||
"row-based events. This is for testing only, and should not be used in "
|
||||
"production systems. If you want to suppress base64-output, consider "
|
||||
"using --base64-output=never instead.",
|
||||
(uchar**) &short_form, (uchar**) &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &sock, (uchar**) &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
&sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"start-datetime", OPT_START_DATETIME,
|
||||
"Start reading the binlog at first event having a datetime equal or "
|
||||
@ -1162,12 +1161,12 @@ static struct my_option my_long_options[] =
|
||||
"in the local time zone, in any format accepted by the MySQL server "
|
||||
"for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
|
||||
"(you should probably use quotes for your shell to set it properly).",
|
||||
(uchar**) &start_datetime_str, (uchar**) &start_datetime_str,
|
||||
&start_datetime_str, &start_datetime_str,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"start-position", 'j',
|
||||
"Start reading the binlog at position N. Applies to the first binlog "
|
||||
"passed on the command line.",
|
||||
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
||||
&start_position, &start_position, 0, GET_ULL,
|
||||
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
|
||||
/* COM_BINLOG_DUMP accepts only 4 bytes for the position */
|
||||
(ulonglong)(~(uint32)0), 0, 0, 0},
|
||||
@ -1177,22 +1176,22 @@ static struct my_option my_long_options[] =
|
||||
"in the local time zone, in any format accepted by the MySQL server "
|
||||
"for DATETIME and TIMESTAMP types, for example: 2004-12-25 11:25:56 "
|
||||
"(you should probably use quotes for your shell to set it properly).",
|
||||
(uchar**) &stop_datetime_str, (uchar**) &stop_datetime_str,
|
||||
&stop_datetime_str, &stop_datetime_str,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"stop-position", OPT_STOP_POSITION,
|
||||
"Stop reading the binlog at position N. Applies to the last binlog "
|
||||
"passed on the command line.",
|
||||
(uchar**) &stop_position, (uchar**) &stop_position, 0, GET_ULL,
|
||||
&stop_position, &stop_position, 0, GET_ULL,
|
||||
REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
|
||||
(ulonglong)(~(my_off_t)0), 0, 0, 0},
|
||||
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
|
||||
requested binlog but rather continue printing until the end of the last \
|
||||
binlog of the MySQL server. If you send the output to the same MySQL server, \
|
||||
that may lead to an endless loop.",
|
||||
(uchar**) &to_last_remote_log, (uchar**) &to_last_remote_log, 0, GET_BOOL,
|
||||
&to_last_remote_log, &to_last_remote_log, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "Connect to the remote server as username.",
|
||||
(uchar**) &user, (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
&user, &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"verbose", 'v', "Reconstruct SQL statements out of row events. "
|
||||
"-v -v adds comments on column data types.",
|
||||
@ -1201,7 +1200,7 @@ that may lead to an endless loop.",
|
||||
0, 0, 0, 0, 0},
|
||||
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
|
||||
"Used to reserve file descriptors for use by this program.",
|
||||
(uchar**) &open_files_limit, (uchar**) &open_files_limit, 0, GET_ULONG,
|
||||
&open_files_limit, &open_files_limit, 0, GET_ULONG,
|
||||
REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
|
||||
{"rewrite-db", OPT_REWRITE_DB,
|
||||
"Updates to a database with a different name than the original. \
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
/* Copyright (C) 2000 MySQL AB & Jani Tolonen
|
||||
Copyright (C) 2010 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -15,7 +16,7 @@
|
||||
|
||||
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
|
||||
|
||||
#define CHECK_VERSION "2.5.0"
|
||||
#define CHECK_VERSION "2.6.0"
|
||||
|
||||
#include "client_priv.h"
|
||||
#include <m_ctype.h>
|
||||
@ -54,13 +55,13 @@ static struct my_option my_long_options[] =
|
||||
{
|
||||
{"all-databases", 'A',
|
||||
"Check all the databases. This is the same as --databases with all databases selected.",
|
||||
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"analyze", 'a', "Analyze given tables.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"all-in-1", '1',
|
||||
"Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.",
|
||||
(uchar**) &opt_all_in_1, (uchar**) &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_all_in_1, &opt_all_in_1, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
#ifdef __NETWARE__
|
||||
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
|
||||
@ -68,11 +69,11 @@ static struct my_option my_long_options[] =
|
||||
#endif
|
||||
{"auto-repair", OPT_AUTO_REPAIR,
|
||||
"If a checked table is corrupted, automatically fix it. Repairing will be done after all tables have been checked, if corrupted ones were found.",
|
||||
(uchar**) &opt_auto_repair, (uchar**) &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
|
||||
&opt_auto_repair, &opt_auto_repair, 0, GET_BOOL, NO_ARG, 0,
|
||||
0, 0, 0, 0, 0},
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &charsets_dir,
|
||||
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", (char**) &charsets_dir,
|
||||
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"check", 'c', "Check table for errors.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"check-only-changed", 'C',
|
||||
@ -82,11 +83,11 @@ static struct my_option my_long_options[] =
|
||||
"Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compress", OPT_COMPRESS, "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"databases", 'B',
|
||||
"Check several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names.",
|
||||
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG,
|
||||
&opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit.",
|
||||
@ -96,40 +97,40 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 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.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (uchar**) &default_charset,
|
||||
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Set the default character set.", &default_charset,
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fast",'F', "Check only tables that haven't been closed properly.",
|
||||
(uchar**) &opt_fast, (uchar**) &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"fix-db-names", OPT_FIX_DB_NAMES, "Fix database names.",
|
||||
(uchar**) &opt_fix_db_names, (uchar**) &opt_fix_db_names,
|
||||
&opt_fix_db_names, &opt_fix_db_names,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fix-table-names", OPT_FIX_TABLE_NAMES, "Fix table names.",
|
||||
(uchar**) &opt_fix_table_names, (uchar**) &opt_fix_table_names,
|
||||
&opt_fix_table_names, &opt_fix_table_names,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"force", 'f', "Continue even if we get an SQL error.",
|
||||
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"extended", 'e',
|
||||
"If you are using this option with CHECK TABLE, it will ensure that the table is 100 percent consistent, but will take a long time. If you are using this option with REPAIR TABLE, it will force using old slow repair with keycache method, instead of much faster repair by sorting.",
|
||||
(uchar**) &opt_extended, (uchar**) &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host",'h', "Connect to host.", (uchar**) ¤t_host,
|
||||
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host",'h', "Connect to host.", ¤t_host,
|
||||
¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"medium-check", 'm',
|
||||
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"write-binlog", OPT_WRITE_BINLOG,
|
||||
"Log ANALYZE, OPTIMIZE and REPAIR TABLE commands. Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.",
|
||||
(uchar**) &opt_write_binlog, (uchar**) &opt_write_binlog, 0, GET_BOOL, NO_ARG,
|
||||
&opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"optimize", 'o', "Optimize table.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
@ -146,38 +147,38 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &opt_mysql_port,
|
||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"quick", 'q',
|
||||
"If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it will try to repair only the index tree. This is the fastest repair method for a table.",
|
||||
(uchar**) &opt_quick, (uchar**) &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_quick, &opt_quick, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"repair", 'r',
|
||||
"Can fix almost anything except unique keys that aren't unique.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||
"Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Print only error messages.", (uchar**) &opt_silent,
|
||||
(uchar**) &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"silent", 's', "Print only error messages.", &opt_silent,
|
||||
&opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
|
||||
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
{"tables", OPT_TABLES, "Overrides option --databases (-B).", 0, 0, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"use-frm", OPT_FRM,
|
||||
"When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
|
||||
(uchar**) &opt_frm, (uchar**) &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_frm, &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
|
||||
(uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", ¤t_user,
|
||||
¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -222,24 +223,26 @@ static void usage(void)
|
||||
{
|
||||
print_version();
|
||||
puts("By Jani Tolonen, 2001-04-20, MySQL Development Team.\n");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n");
|
||||
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
|
||||
puts("and you are welcome to modify and redistribute it under the GPL license.\n");
|
||||
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
|
||||
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
|
||||
my_progname);
|
||||
printf("OR %s [OPTIONS] --all-databases\n\n", my_progname);
|
||||
puts("This program can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a),");
|
||||
puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be");
|
||||
puts("used at the same time. Not all options are supported by all storage engines.");
|
||||
puts("Please consult the MySQL manual for latest information about the");
|
||||
puts("above. The options -c, -r, -a, and -o are exclusive to each other, which");
|
||||
puts("The options -c, -r, -a, and -o are exclusive to each other, which");
|
||||
puts("means that the last option will be used, if several was specified.\n");
|
||||
puts("The option -c will be used by default, if none was specified. You");
|
||||
puts("can change the default behavior by making a symbolic link, or");
|
||||
puts("The option -c (--check) will be used by default, if none was specified.");
|
||||
puts("You can change the default behavior by making a symbolic link, or");
|
||||
puts("copying this file somewhere with another name, the alternatives are:");
|
||||
puts("mysqlrepair: The default option will be -r");
|
||||
puts("mysqlanalyze: The default option will be -a");
|
||||
puts("mysqloptimize: The default option will be -o\n");
|
||||
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
|
||||
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
|
||||
my_progname);
|
||||
printf("OR %s [OPTIONS] --all-databases\n", my_progname);
|
||||
puts("Please consult the MariaDB/MySQL knowledgebase at");
|
||||
puts("http://kb.askmonty.org/v/mysqlcheck for latest information about");
|
||||
puts("this program.");
|
||||
print_defaults("my", load_default_groups);
|
||||
my_print_help(my_long_options);
|
||||
my_print_variables(my_long_options);
|
||||
@ -416,6 +419,8 @@ static int process_all_databases()
|
||||
MYF(0), mysql_error(sock));
|
||||
return 1;
|
||||
}
|
||||
if (verbose)
|
||||
printf("Processing databases\n");
|
||||
while ((row = mysql_fetch_row(tableres)))
|
||||
{
|
||||
if (process_one_db(row[0]))
|
||||
@ -429,6 +434,8 @@ static int process_all_databases()
|
||||
static int process_databases(char **db_names)
|
||||
{
|
||||
int result = 0;
|
||||
if (verbose)
|
||||
printf("Processing databases\n");
|
||||
for ( ; *db_names ; db_names++)
|
||||
{
|
||||
if (process_one_db(*db_names))
|
||||
@ -521,6 +528,7 @@ static int process_all_tables_in_db(char *database)
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
uint num_columns;
|
||||
my_bool system_database= 0;
|
||||
|
||||
LINT_INIT(res);
|
||||
if (use_db(database))
|
||||
@ -534,6 +542,9 @@ static int process_all_tables_in_db(char *database)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!strcmp(database, "mysql") || !strcmp(database, "MYSQL"))
|
||||
system_database= 1;
|
||||
|
||||
num_columns= mysql_num_fields(res);
|
||||
|
||||
if (opt_all_in_1 && what_to_do != DO_UPGRADE)
|
||||
@ -576,6 +587,10 @@ static int process_all_tables_in_db(char *database)
|
||||
/* Skip views if we don't perform renaming. */
|
||||
if ((what_to_do != DO_UPGRADE) && (num_columns == 2) && (strcmp(row[1], "VIEW") == 0))
|
||||
continue;
|
||||
if (system_database &&
|
||||
(!strcmp(row[0], "general_log") ||
|
||||
!strcmp(row[0], "slow_log")))
|
||||
continue; /* Skip logging tables */
|
||||
|
||||
handle_request_for_tables(row[0], fixed_name_length(row[0]));
|
||||
}
|
||||
@ -624,6 +639,8 @@ static int fix_database_storage_name(const char *name)
|
||||
|
||||
static int process_one_db(char *database)
|
||||
{
|
||||
if (verbose)
|
||||
puts(database);
|
||||
if (what_to_do == DO_UPGRADE)
|
||||
{
|
||||
int rc= 0;
|
||||
@ -731,7 +748,7 @@ static void print_result()
|
||||
{
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
char prev[NAME_LEN*2+2];
|
||||
char prev[(NAME_LEN+9)*2+2];
|
||||
uint i;
|
||||
my_bool found_error=0;
|
||||
|
||||
@ -761,7 +778,15 @@ static void print_result()
|
||||
printf("%-50s %s", row[0], row[3]);
|
||||
else if (!status && changed)
|
||||
{
|
||||
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
|
||||
/*
|
||||
If the error message includes REPAIR TABLE, we assume it means
|
||||
we have to run upgrade on it. In this case we write a nicer message
|
||||
than "Please do "REPAIR TABLE""...
|
||||
*/
|
||||
if (!strcmp(row[2],"error") && strinstr(row[3],"REPAIR TABLE") != 0)
|
||||
printf("%-50s %s", row[0], "Needs upgrade");
|
||||
else
|
||||
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
|
||||
if (strcmp(row[2],"note"))
|
||||
found_error=1;
|
||||
}
|
||||
@ -780,7 +805,7 @@ static void print_result()
|
||||
static int dbConnect(char *host, char *user, char *passwd)
|
||||
{
|
||||
DBUG_ENTER("dbConnect");
|
||||
if (verbose)
|
||||
if (verbose > 1)
|
||||
{
|
||||
fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost");
|
||||
}
|
||||
@ -813,7 +838,7 @@ static int dbConnect(char *host, char *user, char *passwd)
|
||||
|
||||
static void dbDisconnect(char *host)
|
||||
{
|
||||
if (verbose)
|
||||
if (verbose > 1)
|
||||
fprintf(stderr, "# Disconnecting from %s...\n", host ? host : "localhost");
|
||||
mysql_close(sock);
|
||||
} /* dbDisconnect */
|
||||
|
@ -180,115 +180,115 @@ HASH ignore_table;
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
{"all", OPT_ALL, "Deprecated. Use --create-options instead.",
|
||||
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
|
||||
&create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
|
||||
0, 0, 0, 0, 0},
|
||||
{"all-databases", 'A',
|
||||
"Dump all the databases. This will be same as --databases with all databases selected.",
|
||||
(uchar**) &opt_alldbs, (uchar**) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_alldbs, &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"all-tablespaces", 'Y',
|
||||
"Dump all the tablespaces.",
|
||||
(uchar**) &opt_alltspcs, (uchar**) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_alltspcs, &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"no-tablespaces", 'y',
|
||||
"Do not dump any tablespace information.",
|
||||
(uchar**) &opt_notspcs, (uchar**) &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_notspcs, &opt_notspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"add-drop-database", OPT_DROP_DATABASE, "Add a DROP DATABASE before each create.",
|
||||
(uchar**) &opt_drop_database, (uchar**) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_drop_database, &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"add-drop-table", OPT_DROP, "Add a DROP TABLE before each create.",
|
||||
(uchar**) &opt_drop, (uchar**) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
|
||||
&opt_drop, &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
|
||||
0},
|
||||
{"add-locks", OPT_LOCKS, "Add locks around INSERT statements.",
|
||||
(uchar**) &opt_lock, (uchar**) &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
|
||||
&opt_lock, &opt_lock, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
|
||||
0},
|
||||
{"allow-keywords", OPT_KEYWORDS,
|
||||
"Allow creation of column names that are keywords.", (uchar**) &opt_keywords,
|
||||
(uchar**) &opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Allow creation of column names that are keywords.", &opt_keywords,
|
||||
&opt_keywords, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef __NETWARE__
|
||||
{"autoclose", OPT_AUTO_CLOSE, "Automatically close the screen on exit for Netware.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &charsets_dir,
|
||||
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", (char**) &charsets_dir,
|
||||
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"comments", 'i', "Write additional information.",
|
||||
(uchar**) &opt_comments, (uchar**) &opt_comments, 0, GET_BOOL, NO_ARG,
|
||||
&opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"compatible", OPT_COMPATIBLE,
|
||||
"Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.",
|
||||
(uchar**) &opt_compatible_mode_str, (uchar**) &opt_compatible_mode_str, 0,
|
||||
&opt_compatible_mode_str, &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 --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,
|
||||
&opt_compact, &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"complete-insert", 'c', "Use complete insert statements.",
|
||||
(uchar**) &opt_complete_insert, (uchar**) &opt_complete_insert, 0, GET_BOOL,
|
||||
&opt_complete_insert, &opt_complete_insert, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"create-options", 'a',
|
||||
"Include all MySQL specific create options.",
|
||||
(uchar**) &create_options, (uchar**) &create_options, 0, GET_BOOL, NO_ARG, 1,
|
||||
&create_options, &create_options, 0, GET_BOOL, NO_ARG, 1,
|
||||
0, 0, 0, 0, 0},
|
||||
{"databases", 'B',
|
||||
"Dump several databases. Note the difference in usage; in this case no tables are given. All name arguments are regarded as database names. 'USE db_name;' will be included in the output.",
|
||||
(uchar**) &opt_databases, (uchar**) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&opt_databases, &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit.",
|
||||
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log.", (uchar**) &default_dbug_option,
|
||||
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug", '#', "Output debug log.", (char**) &default_dbug_option,
|
||||
(char**) &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.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (uchar**) &default_charset,
|
||||
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Set the default character set.", &default_charset,
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delayed-insert", OPT_DELAYED, "Insert rows with INSERT DELAYED.",
|
||||
(uchar**) &opt_delayed, (uchar**) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_delayed, &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
|
||||
"Delete logs on master after backup. This automatically enables --master-data.",
|
||||
(uchar**) &opt_delete_master_logs, (uchar**) &opt_delete_master_logs, 0,
|
||||
&opt_delete_master_logs, &opt_delete_master_logs, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"disable-keys", 'K',
|
||||
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (uchar**) &opt_disable_keys,
|
||||
(uchar**) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", &opt_disable_keys,
|
||||
&opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"events", 'E', "Dump events.",
|
||||
(uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
|
||||
&opt_events, &opt_events, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"extended-insert", 'e',
|
||||
"Use multiple-row INSERT syntax that include several VALUES lists.",
|
||||
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
|
||||
&extended_insert, &extended_insert, 0, GET_BOOL, NO_ARG,
|
||||
1, 0, 0, 0, 0, 0},
|
||||
{"fields-terminated-by", OPT_FTB,
|
||||
"Fields in the output file are terminated by the given string.",
|
||||
(uchar**) &fields_terminated, (uchar**) &fields_terminated, 0,
|
||||
&fields_terminated, &fields_terminated, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fields-enclosed-by", OPT_ENC,
|
||||
"Fields in the output file are enclosed by the given character.",
|
||||
(uchar**) &enclosed, (uchar**) &enclosed, 0,
|
||||
&enclosed, &enclosed, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
|
||||
{"fields-optionally-enclosed-by", OPT_O_ENC,
|
||||
"Fields in the output file are optionally enclosed by the given character.",
|
||||
(uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0,
|
||||
&opt_enclosed, &opt_enclosed, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
|
||||
{"fields-escaped-by", OPT_ESC,
|
||||
"Fields in the output file are escaped by the given character.",
|
||||
(uchar**) &escaped, (uchar**) &escaped, 0,
|
||||
&escaped, &escaped, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"first-slave", OPT_FIRST_SLAVE, "Deprecated, renamed to --lock-all-tables.",
|
||||
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
|
||||
&opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"flush-logs", 'F', "Flush logs file in server before starting dump. "
|
||||
"Note that if you dump many databases at once (using the option "
|
||||
@ -299,24 +299,24 @@ static struct my_option my_long_options[] =
|
||||
"to the moment all tables are locked. So if you want your dump and "
|
||||
"the log flush to happen at the same exact moment you should use "
|
||||
"--lock-all-tables or --master-data with --flush-logs.",
|
||||
(uchar**) &flush_logs, (uchar**) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&flush_logs, &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
|
||||
"after dumping the mysql database. This option should be used any "
|
||||
"time the dump contains the mysql database and any other database "
|
||||
"that depends on the data in the mysql database for proper restore. ",
|
||||
(uchar**) &flush_privileges, (uchar**) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&flush_privileges, &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"force", 'f', "Continue even if we get an SQL error.",
|
||||
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG,
|
||||
&ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, "
|
||||
"VARBINARY, BLOB) in hexadecimal format.",
|
||||
(uchar**) &opt_hex_blob, (uchar**) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) ¤t_host,
|
||||
(uchar**) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&opt_hex_blob, &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", ¤t_host,
|
||||
¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore-table", OPT_IGNORE_TABLE,
|
||||
"Do not dump the specified table. To specify more than one table to ignore, "
|
||||
"use the directive multiple times, once for each table. Each table must "
|
||||
@ -324,21 +324,21 @@ static struct my_option my_long_options[] =
|
||||
"--ignore-table=database.table.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"insert-ignore", OPT_INSERT_IGNORE, "Insert rows with INSERT IGNORE.",
|
||||
(uchar**) &opt_ignore, (uchar**) &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_ignore, &opt_ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"lines-terminated-by", OPT_LTB,
|
||||
"Lines in the output file are terminated by the given string.",
|
||||
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
|
||||
&lines_terminated, &lines_terminated, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"lock-all-tables", 'x', "Locks all tables across all databases. This "
|
||||
"is achieved by taking a global read lock for the duration of the whole "
|
||||
"dump. Automatically turns --single-transaction and --lock-tables off.",
|
||||
(uchar**) &opt_lock_all_tables, (uchar**) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
|
||||
&opt_lock_all_tables, &opt_lock_all_tables, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"lock-tables", 'l', "Lock all tables for read.", (uchar**) &lock_tables,
|
||||
(uchar**) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"lock-tables", 'l', "Lock all tables for read.", &lock_tables,
|
||||
&lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
|
||||
(uchar**) &log_error_file, (uchar**) &log_error_file, 0, GET_STR,
|
||||
&log_error_file, &log_error_file, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"master-data", OPT_MASTER_DATA,
|
||||
"This causes the binary log position and filename to be appended to the "
|
||||
@ -350,33 +350,33 @@ static struct my_option my_long_options[] =
|
||||
"don't forget to read about --single-transaction below). In all cases, "
|
||||
"any action on logs will happen at the exact moment of the dump. "
|
||||
"Option automatically turns --lock-tables off.",
|
||||
(uchar**) &opt_master_data, (uchar**) &opt_master_data, 0,
|
||||
&opt_master_data, &opt_master_data, 0,
|
||||
GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0},
|
||||
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
|
||||
"The maximum packet length to send to or receive from server.",
|
||||
(uchar**) &opt_max_allowed_packet, (uchar**) &opt_max_allowed_packet, 0,
|
||||
&opt_max_allowed_packet, &opt_max_allowed_packet, 0,
|
||||
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
|
||||
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
|
||||
{"net_buffer_length", OPT_NET_BUFFER_LENGTH,
|
||||
"The buffer size for TCP/IP and socket communication.",
|
||||
(uchar**) &opt_net_buffer_length, (uchar**) &opt_net_buffer_length, 0,
|
||||
&opt_net_buffer_length, &opt_net_buffer_length, 0,
|
||||
GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
|
||||
MALLOC_OVERHEAD-1024, 1024, 0},
|
||||
{"no-autocommit", OPT_AUTOCOMMIT,
|
||||
"Wrap tables with autocommit/commit statements.",
|
||||
(uchar**) &opt_autocommit, (uchar**) &opt_autocommit, 0, GET_BOOL, NO_ARG,
|
||||
&opt_autocommit, &opt_autocommit, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"no-create-db", 'n',
|
||||
"Suppress the CREATE DATABASE ... IF EXISTS statement that normally is "
|
||||
"output for each dumped database if --all-databases or --databases is "
|
||||
"given.",
|
||||
(uchar**) &opt_create_db, (uchar**) &opt_create_db, 0,
|
||||
&opt_create_db, &opt_create_db, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-create-info", 't', "Don't write table creation info.",
|
||||
(uchar**) &opt_no_create_info, (uchar**) &opt_no_create_info, 0, GET_BOOL,
|
||||
&opt_no_create_info, &opt_no_create_info, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-data", 'd', "No row information.", (uchar**) &opt_no_data,
|
||||
(uchar**) &opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-data", 'd', "No row information.", &opt_no_data,
|
||||
&opt_no_data, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-set-names", 'N',"Suppress the SET NAMES statement",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"opt", OPT_OPTIMIZE,
|
||||
@ -384,7 +384,7 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
|
||||
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
|
||||
(uchar**) &opt_order_by_primary, (uchar**) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&opt_order_by_primary, &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's solicited on the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -392,36 +392,36 @@ static struct my_option my_long_options[] =
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL,
|
||||
"The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"quick", 'q', "Don't buffer query, dump directly to stdout.",
|
||||
(uchar**) &quick, (uchar**) &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
&quick, &quick, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"quote-names",'Q', "Quote table and column names with backticks (`).",
|
||||
(uchar**) &opt_quoted, (uchar**) &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
||||
&opt_quoted, &opt_quoted, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
|
||||
0, 0},
|
||||
{"replace", OPT_MYSQL_REPLACE_INTO, "Use REPLACE INTO instead of INSERT INTO.",
|
||||
(uchar**) &opt_replace_into, (uchar**) &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_replace_into, &opt_replace_into, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"result-file", 'r',
|
||||
"Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"routines", 'R', "Dump stored routines (functions and procedures).",
|
||||
(uchar**) &opt_routines, (uchar**) &opt_routines, 0, GET_BOOL,
|
||||
&opt_routines, &opt_routines, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"set-charset", OPT_SET_CHARSET,
|
||||
"Add 'SET NAMES default_character_set' to the output. Enabled by default; suppress with --skip-set-charset.",
|
||||
(uchar**) &opt_set_charset, (uchar**) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
|
||||
&opt_set_charset, &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
|
||||
0, 0, 0, 0, 0},
|
||||
{"set-variable", 'O',
|
||||
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||
"Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
/*
|
||||
@ -439,42 +439,42 @@ static struct my_option my_long_options[] =
|
||||
"connection should use the following statements: ALTER TABLE, DROP "
|
||||
"TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not "
|
||||
"isolated from them. Option automatically turns off --lock-tables.",
|
||||
(uchar**) &opt_single_transaction, (uchar**) &opt_single_transaction, 0,
|
||||
&opt_single_transaction, &opt_single_transaction, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"dump-date", OPT_DUMP_DATE, "Put a dump date to the end of the output.",
|
||||
(uchar**) &opt_dump_date, (uchar**) &opt_dump_date, 0,
|
||||
&opt_dump_date, &opt_dump_date, 0,
|
||||
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"skip-opt", OPT_SKIP_OPTIMIZATION,
|
||||
"Disable --opt. Disables --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0,
|
||||
&opt_mysql_unix_port, &opt_mysql_unix_port, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
{"tab",'T',
|
||||
"Create tab-separated textfile for each table to given path. (Create .sql "
|
||||
"and .txt files.) NOTE: This only works if mysqldump is run on the same "
|
||||
"machine as the mysqld server.",
|
||||
(uchar**) &path, (uchar**) &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&path, &path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"tables", OPT_TABLES, "Overrides option --databases (-B).",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"triggers", OPT_TRIGGERS, "Dump triggers for each dumped table.",
|
||||
(uchar**) &opt_dump_triggers, (uchar**) &opt_dump_triggers, 0, GET_BOOL,
|
||||
&opt_dump_triggers, &opt_dump_triggers, 0, GET_BOOL,
|
||||
NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"tz-utc", OPT_TZ_UTC,
|
||||
"SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
|
||||
(uchar**) &opt_tz_utc, (uchar**) &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
&opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.",
|
||||
(uchar**) ¤t_user, (uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG,
|
||||
¤t_user, ¤t_user, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"verbose", 'v', "Print info about the various stages.",
|
||||
(uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version",'V', "Output version information and exit.", 0, 0, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"where", 'w', "Dump only selected records. Quotes are mandatory.",
|
||||
(uchar**) &where, (uchar**) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
@ -964,7 +964,7 @@ static int get_options(int *argc, char ***argv)
|
||||
static void DB_error(MYSQL *mysql_arg, const char *when)
|
||||
{
|
||||
DBUG_ENTER("DB_error");
|
||||
maybe_die(EX_MYSQLERR, "Got error: %d: %s %s",
|
||||
maybe_die(EX_MYSQLERR, "Got error: %d: \"%s\" %s",
|
||||
mysql_errno(mysql_arg), mysql_error(mysql_arg), when);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -1441,6 +1441,7 @@ static void free_resources()
|
||||
if (md_result_file && md_result_file != stdout)
|
||||
my_fclose(md_result_file, MYF(0));
|
||||
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
||||
my_free(current_host, MYF(MY_ALLOW_ZERO_PTR));
|
||||
if (hash_inited(&ignore_table))
|
||||
hash_free(&ignore_table);
|
||||
if (extended_insert)
|
||||
@ -4222,7 +4223,7 @@ static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root)
|
||||
}
|
||||
mysql_free_result(table_res);
|
||||
}
|
||||
DBUG_PRINT("exit", ("new_table_name: %s", name));
|
||||
DBUG_PRINT("exit", ("new_table_name: %s", val_or_null(name)));
|
||||
DBUG_RETURN(name);
|
||||
}
|
||||
|
||||
@ -4818,6 +4819,7 @@ static my_bool get_view_structure(char *table, char* db)
|
||||
field= mysql_fetch_field_direct(table_res, 0);
|
||||
if (strcmp(field->name, "View") != 0)
|
||||
{
|
||||
mysql_free_result(table_res);
|
||||
switch_character_set_results(mysql, default_charset);
|
||||
verbose_msg("-- It's base table, skipped\n");
|
||||
DBUG_RETURN(0);
|
||||
@ -4827,8 +4829,10 @@ static my_bool get_view_structure(char *table, char* db)
|
||||
if (path)
|
||||
{
|
||||
if (!(sql_file= open_sql_file_for_table(table, O_WRONLY)))
|
||||
{
|
||||
mysql_free_result(table_res);
|
||||
DBUG_RETURN(1);
|
||||
|
||||
}
|
||||
write_header(sql_file, db);
|
||||
}
|
||||
|
||||
|
@ -73,68 +73,68 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &charsets_dir,
|
||||
(uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", (char**) &charsets_dir,
|
||||
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (uchar**) &default_charset,
|
||||
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Set the default character set.", &default_charset,
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"columns", 'c',
|
||||
"Use only these columns to import the data to. Give the column names in a comma separated list. This is same as giving columns to LOAD DATA INFILE.",
|
||||
(uchar**) &opt_columns, (uchar**) &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
&opt_columns, &opt_columns, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"debug",'#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0,
|
||||
GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delete", 'd', "First delete all rows from table.", (uchar**) &opt_delete,
|
||||
(uchar**) &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delete", 'd', "First delete all rows from table.", &opt_delete,
|
||||
&opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fields-terminated-by", OPT_FTB,
|
||||
"Fields in the input file are terminated by the given string.",
|
||||
(uchar**) &fields_terminated, (uchar**) &fields_terminated, 0,
|
||||
&fields_terminated, &fields_terminated, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fields-enclosed-by", OPT_ENC,
|
||||
"Fields in the import file are enclosed by the given character.",
|
||||
(uchar**) &enclosed, (uchar**) &enclosed, 0,
|
||||
&enclosed, &enclosed, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fields-optionally-enclosed-by", OPT_O_ENC,
|
||||
"Fields in the input file are optionally enclosed by the given character.",
|
||||
(uchar**) &opt_enclosed, (uchar**) &opt_enclosed, 0,
|
||||
&opt_enclosed, &opt_enclosed, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"fields-escaped-by", OPT_ESC,
|
||||
"Fields in the input file are escaped by the given character.",
|
||||
(uchar**) &escaped, (uchar**) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
&escaped, &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"force", 'f', "Continue even if we get an SQL error.",
|
||||
(uchar**) &ignore_errors, (uchar**) &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
&ignore_errors, &ignore_errors, 0, GET_BOOL, NO_ARG, 0, 0,
|
||||
0, 0, 0, 0},
|
||||
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) ¤t_host,
|
||||
(uchar**) ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", ¤t_host,
|
||||
¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore", 'i', "If duplicate unique key was found, keep old row.",
|
||||
(uchar**) &ignore, (uchar**) &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&ignore, &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.",
|
||||
(uchar**) &opt_ignore_lines, (uchar**) &opt_ignore_lines, 0, GET_LL,
|
||||
&opt_ignore_lines, &opt_ignore_lines, 0, GET_LL,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"lines-terminated-by", OPT_LTB,
|
||||
"Lines in the input file are terminated by the given string.",
|
||||
(uchar**) &lines_terminated, (uchar**) &lines_terminated, 0, GET_STR,
|
||||
&lines_terminated, &lines_terminated, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"local", 'L', "Read all files through the client.", (uchar**) &opt_local_file,
|
||||
(uchar**) &opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"local", 'L', "Read all files through the client.", &opt_local_file,
|
||||
&opt_local_file, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"lock-tables", 'l', "Lock all tables for write (this disables threads).",
|
||||
(uchar**) &lock_tables, (uchar**) &lock_tables, 0, GET_BOOL, NO_ARG,
|
||||
&lock_tables, &lock_tables, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"low-priority", OPT_LOW_PRIORITY,
|
||||
"Use LOW_PRIORITY when updating the table.", (uchar**) &opt_low_priority,
|
||||
(uchar**) &opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Use LOW_PRIORITY when updating the table.", &opt_low_priority,
|
||||
&opt_low_priority, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -148,35 +148,35 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &opt_mysql_port,
|
||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"replace", 'r', "If duplicate unique key was found, replace old row.",
|
||||
(uchar**) &replace, (uchar**) &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&replace, &replace, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||
"Base name of shared memory.", &shared_memory_base_name, &shared_memory_base_name,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent, 0,
|
||||
{"silent", 's', "Be more silent.", &silent, &silent, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
|
||||
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
{"use-threads", OPT_USE_THREADS,
|
||||
"Load files in parallel. The argument is the number "
|
||||
"of threads to use for loading data.",
|
||||
(uchar**) &opt_use_threads, (uchar**) &opt_use_threads, 0,
|
||||
&opt_use_threads, &opt_use_threads, 0,
|
||||
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) ¤t_user,
|
||||
(uchar**) ¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", ¤t_user,
|
||||
¤t_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"verbose", 'v', "Print info about the various stages.", (uchar**) &verbose,
|
||||
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Print info about the various stages.", &verbose,
|
||||
&verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
|
@ -164,35 +164,35 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"character-sets-dir", 'c', "Directory for character set files.",
|
||||
(uchar**) &charsets_dir, (uchar**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
|
||||
(char**) &charsets_dir, (char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0,
|
||||
0, 0, 0, 0, 0},
|
||||
{"default-character-set", OPT_DEFAULT_CHARSET,
|
||||
"Set the default character set.", (uchar**) &default_charset,
|
||||
(uchar**) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Set the default character set.", &default_charset,
|
||||
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"count", OPT_COUNT,
|
||||
"Show number of rows per table (may be slow for non-MyISAM tables).",
|
||||
(uchar**) &opt_count, (uchar**) &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_count, &opt_count, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
|
||||
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"status", 'i', "Shows a lot of extra information about each table.",
|
||||
(uchar**) &opt_status, (uchar**) &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
&opt_status, &opt_status, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"keys", 'k', "Show keys for table.", (uchar**) &opt_show_keys,
|
||||
(uchar**) &opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"keys", 'k', "Show keys for table.", &opt_show_keys,
|
||||
&opt_show_keys, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given, it's "
|
||||
"solicited on the tty.",
|
||||
@ -203,8 +203,8 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &opt_mysql_port,
|
||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
&opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||
0},
|
||||
#ifdef __WIN__
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
@ -215,19 +215,20 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
|
||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Base name of shared memory.", &shared_memory_base_name,
|
||||
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"show-table-type", 't', "Show table type column.",
|
||||
(uchar**) &opt_table_type, (uchar**) &opt_table_type, 0, GET_BOOL,
|
||||
&opt_table_type, &opt_table_type, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
|
||||
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) &user,
|
||||
(uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", &user,
|
||||
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"verbose", 'v',
|
||||
"More verbose output; you can use this multiple times to get even more "
|
||||
@ -668,8 +669,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
|
||||
char query[1024],*end;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
ulong rows;
|
||||
LINT_INIT(rows);
|
||||
ulong UNINIT_VAR(rows);
|
||||
|
||||
if (mysql_select_db(mysql,db))
|
||||
{
|
||||
|
@ -525,62 +525,62 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql", 'a',
|
||||
"Generate SQL where not supplied by file or command line.",
|
||||
(uchar**) &auto_generate_sql, (uchar**) &auto_generate_sql,
|
||||
&auto_generate_sql, &auto_generate_sql,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-add-autoincrement", OPT_SLAP_AUTO_GENERATE_ADD_AUTO,
|
||||
"Add an AUTO_INCREMENT column to auto-generated tables.",
|
||||
(uchar**) &auto_generate_sql_autoincrement,
|
||||
(uchar**) &auto_generate_sql_autoincrement,
|
||||
&auto_generate_sql_autoincrement,
|
||||
&auto_generate_sql_autoincrement,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-execute-number", OPT_SLAP_AUTO_GENERATE_EXECUTE_QUERIES,
|
||||
"Set this number to generate a set number of queries to run.",
|
||||
(uchar**) &auto_actual_queries, (uchar**) &auto_actual_queries,
|
||||
&auto_actual_queries, &auto_actual_queries,
|
||||
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-guid-primary", OPT_SLAP_AUTO_GENERATE_GUID_PRIMARY,
|
||||
"Add GUID based primary keys to auto-generated tables.",
|
||||
(uchar**) &auto_generate_sql_guid_primary,
|
||||
(uchar**) &auto_generate_sql_guid_primary,
|
||||
&auto_generate_sql_guid_primary,
|
||||
&auto_generate_sql_guid_primary,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-load-type", OPT_SLAP_AUTO_GENERATE_SQL_LOAD_TYPE,
|
||||
"Specify test load type: mixed, update, write, key, or read; default is mixed.",
|
||||
(uchar**) &auto_generate_sql_type, (uchar**) &auto_generate_sql_type,
|
||||
(char**) &auto_generate_sql_type, (char**) &auto_generate_sql_type,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-secondary-indexes",
|
||||
OPT_SLAP_AUTO_GENERATE_SECONDARY_INDEXES,
|
||||
"Number of secondary indexes to add to auto-generated tables.",
|
||||
(uchar**) &auto_generate_sql_secondary_indexes,
|
||||
(uchar**) &auto_generate_sql_secondary_indexes, 0,
|
||||
&auto_generate_sql_secondary_indexes,
|
||||
&auto_generate_sql_secondary_indexes, 0,
|
||||
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-unique-query-number",
|
||||
OPT_SLAP_AUTO_GENERATE_UNIQUE_QUERY_NUM,
|
||||
"Number of unique queries to generate for automatic tests.",
|
||||
(uchar**) &auto_generate_sql_unique_query_number,
|
||||
(uchar**) &auto_generate_sql_unique_query_number,
|
||||
&auto_generate_sql_unique_query_number,
|
||||
&auto_generate_sql_unique_query_number,
|
||||
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-unique-write-number",
|
||||
OPT_SLAP_AUTO_GENERATE_UNIQUE_WRITE_NUM,
|
||||
"Number of unique queries to generate for auto-generate-sql-write-number.",
|
||||
(uchar**) &auto_generate_sql_unique_write_number,
|
||||
(uchar**) &auto_generate_sql_unique_write_number,
|
||||
&auto_generate_sql_unique_write_number,
|
||||
&auto_generate_sql_unique_write_number,
|
||||
0, GET_ULL, REQUIRED_ARG, 10, 0, 0, 0, 0, 0},
|
||||
{"auto-generate-sql-write-number", OPT_SLAP_AUTO_GENERATE_WRITE_NUM,
|
||||
"Number of row inserts to perform for each thread (default is 100).",
|
||||
(uchar**) &auto_generate_sql_number, (uchar**) &auto_generate_sql_number,
|
||||
&auto_generate_sql_number, &auto_generate_sql_number,
|
||||
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
|
||||
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
|
||||
(uchar**) &commit_rate, (uchar**) &commit_rate, 0, GET_UINT, REQUIRED_ARG,
|
||||
&commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"compress", 'C', "Use compression in server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"concurrency", 'c', "Number of clients to simulate for query to run.",
|
||||
(uchar**) &concurrency_str, (uchar**) &concurrency_str, 0, GET_STR,
|
||||
(char**) &concurrency_str, (char**) &concurrency_str, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"create", OPT_SLAP_CREATE_STRING, "File or string to use create tables.",
|
||||
(uchar**) &create_string, (uchar**) &create_string, 0, GET_STR, REQUIRED_ARG,
|
||||
&create_string, &create_string, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"create-schema", OPT_CREATE_SLAP_SCHEMA, "Schema to run tests in.",
|
||||
(uchar**) &create_schema_string, (uchar**) &create_schema_string, 0, GET_STR,
|
||||
(char**) &create_schema_string, (char**) &create_schema_string, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"csv", OPT_SLAP_CSV,
|
||||
"Generate CSV output to named file or to stdout if no file is named.",
|
||||
@ -590,47 +590,48 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
|
||||
(uchar**) &default_dbug_option, (uchar**) &default_dbug_option, 0, GET_STR,
|
||||
(char**) &default_dbug_option, (char**) &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.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &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,
|
||||
(uchar**) &debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
|
||||
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"delimiter", 'F',
|
||||
"Delimiter to use in SQL statements supplied in file or command line.",
|
||||
(uchar**) &delimiter, (uchar**) &delimiter, 0, GET_STR, REQUIRED_ARG,
|
||||
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"detach", OPT_SLAP_DETACH,
|
||||
"Detach (close and reopen) connections after X number of requests.",
|
||||
(uchar**) &detach_rate, (uchar**) &detach_rate, 0, GET_UINT, REQUIRED_ARG,
|
||||
&detach_rate, &detach_rate, 0, GET_UINT, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"engine", 'e', "Comma separated list of storage engines to use for creating the table."
|
||||
" The test is run for each engine. You can also specify an option for an engine"
|
||||
" after a `:', like memory:max_row=2300",
|
||||
(uchar**) &default_engine, (uchar**) &default_engine, 0,
|
||||
{"engine", 'e',
|
||||
"Comma separated list of storage engines to use for creating the table."
|
||||
" The test is run for each engine. You can also specify an option for an "
|
||||
"engine after a `:', like memory:max_row=2300",
|
||||
&default_engine, &default_engine, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) &host, (uchar**) &host, 0, GET_STR,
|
||||
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"iterations", 'i', "Number of times to run the tests.", (uchar**) &iterations,
|
||||
(uchar**) &iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"iterations", 'i', "Number of times to run the tests.", &iterations,
|
||||
&iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"number-char-cols", 'x',
|
||||
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
|
||||
(uchar**) &num_char_cols_opt, (uchar**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
|
||||
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"number-int-cols", 'y',
|
||||
"Number of INT columns to create in table if specifying --auto-generate-sql.",
|
||||
(uchar**) &num_int_cols_opt, (uchar**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
|
||||
(char**) &num_int_cols_opt, (char**) &num_int_cols_opt, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"number-of-queries", OPT_MYSQL_NUMBER_OF_QUERY,
|
||||
"Limit each client to this number of queries (this is not exact).",
|
||||
(uchar**) &num_of_query, (uchar**) &num_of_query, 0,
|
||||
&num_of_query, &num_of_query, 0,
|
||||
GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"only-print", OPT_MYSQL_ONLY_PRINT,
|
||||
"Do not connect to the databases, but instead print out what would have "
|
||||
"been done.",
|
||||
(uchar**) &opt_only_print, (uchar**) &opt_only_print, 0, GET_BOOL, NO_ARG,
|
||||
&opt_only_print, &opt_only_print, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p',
|
||||
"Password to use when connecting to server. If password is not given it's "
|
||||
@ -639,58 +640,54 @@ static struct my_option my_long_options[] =
|
||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
|
||||
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
|
||||
0},
|
||||
{"post-query", OPT_SLAP_POST_QUERY,
|
||||
"Query to run or file containing query to execute after tests have completed.",
|
||||
(uchar**) &user_supplied_post_statements,
|
||||
(uchar**) &user_supplied_post_statements,
|
||||
&user_supplied_post_statements, &user_supplied_post_statements,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"post-system", OPT_SLAP_POST_SYSTEM,
|
||||
"system() string to execute after tests have completed.",
|
||||
(uchar**) &post_system,
|
||||
(uchar**) &post_system,
|
||||
&post_system, &post_system,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"pre-query", OPT_SLAP_PRE_QUERY,
|
||||
"Query to run or file containing query to execute before running tests.",
|
||||
(uchar**) &user_supplied_pre_statements,
|
||||
(uchar**) &user_supplied_pre_statements,
|
||||
&user_supplied_pre_statements, &user_supplied_pre_statements,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"pre-system", OPT_SLAP_PRE_SYSTEM,
|
||||
"system() string to execute before running tests.",
|
||||
(uchar**) &pre_system,
|
||||
(uchar**) &pre_system,
|
||||
&pre_system, &pre_system,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL,
|
||||
"The protocol to use for connection (tcp, socket, pipe, memory).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"query", 'q', "Query to run or file containing query to run.",
|
||||
(uchar**) &user_supplied_query, (uchar**) &user_supplied_query,
|
||||
&user_supplied_query, &user_supplied_query,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
||||
(uchar**) &shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
|
||||
"Base name of shared memory.", &shared_memory_base_name,
|
||||
&shared_memory_base_name, 0, GET_STR_ALLOC, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Run program in silent mode - no output.",
|
||||
(uchar**) &opt_silent, (uchar**) &opt_silent, 0, GET_BOOL, NO_ARG,
|
||||
&opt_silent, &opt_silent, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &opt_mysql_unix_port, (uchar**) &opt_mysql_unix_port, 0, GET_STR,
|
||||
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#include <sslopt-longopts.h>
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", 'u', "User for login if not current user.", (uchar**) &user,
|
||||
(uchar**) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login if not current user.", &user,
|
||||
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"verbose", 'v',
|
||||
"More verbose output; you can use this multiple times to get even more "
|
||||
"verbose output.", (uchar**) &verbose, (uchar**) &verbose, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"More verbose output; you can use this multiple times to get even more "
|
||||
"verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.", 0, 0, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -74,6 +74,10 @@
|
||||
#define QUERY_SEND_FLAG 1
|
||||
#define QUERY_REAP_FLAG 2
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
static int setenv(const char *name, const char *value, int overwrite);
|
||||
#endif
|
||||
|
||||
enum {
|
||||
OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION,
|
||||
OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL,
|
||||
@ -227,7 +231,6 @@ typedef struct
|
||||
int alloced_len;
|
||||
int int_dirty; /* do not update string if int is updated until first read */
|
||||
int alloced;
|
||||
char *env_s;
|
||||
} VAR;
|
||||
|
||||
/*Perl/shell-like variable registers */
|
||||
@ -539,7 +542,7 @@ public:
|
||||
{
|
||||
DBUG_ENTER("LogFile::open");
|
||||
DBUG_PRINT("enter", ("dir: '%s', name: '%s'",
|
||||
dir, name));
|
||||
val_or_null(dir), val_or_null(name)));
|
||||
if (!name)
|
||||
{
|
||||
m_file= stdout;
|
||||
@ -1077,7 +1080,8 @@ void check_command_args(struct st_command *command,
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void handle_command_error(struct st_command *command, uint error)
|
||||
void handle_command_error(struct st_command *command, uint error,
|
||||
int sys_errno)
|
||||
{
|
||||
DBUG_ENTER("handle_command_error");
|
||||
DBUG_PRINT("enter", ("error: %d", error));
|
||||
@ -1093,12 +1097,13 @@ void handle_command_error(struct st_command *command, uint error)
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %d",
|
||||
command->first_word_len, command->query, error));
|
||||
DBUG_PRINT("info", ("command \"%.*s\" failed with expected error: %u, errno: %d",
|
||||
command->first_word_len, command->query, error,
|
||||
sys_errno));
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
die("command \"%.*s\" failed with wrong error: %d",
|
||||
command->first_word_len, command->query, error);
|
||||
die("command \"%.*s\" failed with wrong error: %u, errno: %d",
|
||||
command->first_word_len, command->query, error, sys_errno);
|
||||
}
|
||||
else if (command->expected_errors.err[0].type == ERR_ERRNO &&
|
||||
command->expected_errors.err[0].code.errnum != 0)
|
||||
@ -1807,7 +1812,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
|
||||
{
|
||||
my_close(fd, MYF(0));
|
||||
/* Remove the temporary file */
|
||||
my_delete(temp_file_path, MYF(0));
|
||||
my_delete(temp_file_path, MYF(MY_WME));
|
||||
die("Failed to write file '%s'", temp_file_path);
|
||||
}
|
||||
|
||||
@ -1815,7 +1820,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
|
||||
|
||||
my_close(fd, MYF(0));
|
||||
/* Remove the temporary file */
|
||||
my_delete(temp_file_path, MYF(0));
|
||||
my_delete(temp_file_path, MYF(MY_WME));
|
||||
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
@ -1982,13 +1987,20 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
||||
+ name_len+1, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
|
||||
if (name != NULL)
|
||||
{
|
||||
tmp_var->name= reinterpret_cast<char*>(tmp_var) + sizeof(*tmp_var);
|
||||
memcpy(tmp_var->name, name, name_len);
|
||||
tmp_var->name[name_len]= 0;
|
||||
}
|
||||
else
|
||||
tmp_var->name= NULL;
|
||||
|
||||
tmp_var->alloced = (v == 0);
|
||||
|
||||
if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
memcpy(tmp_var->name, name, name_len);
|
||||
if (val)
|
||||
{
|
||||
memcpy(tmp_var->str_val, val, val_len);
|
||||
@ -1999,7 +2011,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
||||
tmp_var->alloced_len = val_alloc_len;
|
||||
tmp_var->int_val = (val) ? atoi(val) : 0;
|
||||
tmp_var->int_dirty = 0;
|
||||
tmp_var->env_s = 0;
|
||||
return tmp_var;
|
||||
}
|
||||
|
||||
@ -2127,20 +2138,15 @@ void var_set(const char *var_name, const char *var_name_end,
|
||||
|
||||
if (env_var)
|
||||
{
|
||||
char buf[1024], *old_env_s= v->env_s;
|
||||
if (v->int_dirty)
|
||||
{
|
||||
sprintf(v->str_val, "%d", v->int_val);
|
||||
v->int_dirty= 0;
|
||||
v->str_val_len= strlen(v->str_val);
|
||||
}
|
||||
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
|
||||
v->name_len, v->name,
|
||||
v->str_val_len, v->str_val);
|
||||
if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
putenv(v->env_s);
|
||||
my_free(old_env_s, MYF(MY_ALLOW_ZERO_PTR));
|
||||
/* setenv() expects \0-terminated strings */
|
||||
DBUG_ASSERT(v->name[v->name_len] == 0);
|
||||
setenv(v->name, v->str_val, 1);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -2928,8 +2934,8 @@ void do_remove_file(struct st_command *command)
|
||||
' ');
|
||||
|
||||
DBUG_PRINT("info", ("removing file: %s", ds_filename.str));
|
||||
error= my_delete(ds_filename.str, MYF(0)) != 0;
|
||||
handle_command_error(command, error);
|
||||
error= my_delete(ds_filename.str, MYF(disable_warnings ? 0 : MY_WME)) != 0;
|
||||
handle_command_error(command, error, my_errno);
|
||||
dynstr_free(&ds_filename);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -2947,7 +2953,7 @@ void do_remove_file(struct st_command *command)
|
||||
|
||||
void do_remove_files_wildcard(struct st_command *command)
|
||||
{
|
||||
int error= 0;
|
||||
int error= 0, sys_errno= 0;
|
||||
uint i;
|
||||
MY_DIR *dir_info;
|
||||
FILEINFO *file;
|
||||
@ -2971,9 +2977,10 @@ void do_remove_files_wildcard(struct st_command *command)
|
||||
|
||||
DBUG_PRINT("info", ("listing directory: %s", dirname));
|
||||
/* Note that my_dir sorts the list if not given any flags */
|
||||
if (!(dir_info= my_dir(dirname, MYF(MY_DONT_SORT | MY_WANT_STAT))))
|
||||
if (!(dir_info= my_dir(dirname, MYF(MY_DONT_SORT | MY_WANT_STAT | MY_WME))))
|
||||
{
|
||||
error= 1;
|
||||
sys_errno= my_errno;
|
||||
goto end;
|
||||
}
|
||||
init_dynamic_string(&ds_file_to_remove, dirname, 1024, 1024);
|
||||
@ -2995,14 +3002,15 @@ void do_remove_files_wildcard(struct st_command *command)
|
||||
ds_file_to_remove.str[ds_directory.length + 1]= 0;
|
||||
dynstr_append(&ds_file_to_remove, file->name);
|
||||
DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
|
||||
error= my_delete(ds_file_to_remove.str, MYF(0)) != 0;
|
||||
if ((error= (my_delete(ds_file_to_remove.str, MYF(MY_WME)) != 0)))
|
||||
sys_errno= my_errno;
|
||||
if (error)
|
||||
break;
|
||||
}
|
||||
my_dirend(dir_info);
|
||||
|
||||
end:
|
||||
handle_command_error(command, error);
|
||||
handle_command_error(command, error, sys_errno);
|
||||
dynstr_free(&ds_directory);
|
||||
dynstr_free(&ds_wild);
|
||||
dynstr_free(&ds_file_to_remove);
|
||||
@ -3040,8 +3048,8 @@ void do_copy_file(struct st_command *command)
|
||||
|
||||
DBUG_PRINT("info", ("Copy %s to %s", ds_from_file.str, ds_to_file.str));
|
||||
error= (my_copy(ds_from_file.str, ds_to_file.str,
|
||||
MYF(MY_DONT_OVERWRITE_FILE)) != 0);
|
||||
handle_command_error(command, error);
|
||||
MYF(MY_DONT_OVERWRITE_FILE | MY_WME)) != 0);
|
||||
handle_command_error(command, error, my_errno);
|
||||
dynstr_free(&ds_from_file);
|
||||
dynstr_free(&ds_to_file);
|
||||
DBUG_VOID_RETURN;
|
||||
@ -3076,8 +3084,8 @@ void do_move_file(struct st_command *command)
|
||||
|
||||
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);
|
||||
MYF(disable_warnings ? 0 : MY_WME)) != 0);
|
||||
handle_command_error(command, error, my_errno);
|
||||
dynstr_free(&ds_from_file);
|
||||
dynstr_free(&ds_to_file);
|
||||
DBUG_VOID_RETURN;
|
||||
@ -3097,6 +3105,7 @@ void do_move_file(struct st_command *command)
|
||||
|
||||
void do_chmod_file(struct st_command *command)
|
||||
{
|
||||
int error;
|
||||
long mode= 0;
|
||||
static DYNAMIC_STRING ds_mode;
|
||||
static DYNAMIC_STRING ds_file;
|
||||
@ -3117,7 +3126,10 @@ void do_chmod_file(struct st_command *command)
|
||||
die("You must write a 4 digit octal number for mode");
|
||||
|
||||
DBUG_PRINT("info", ("chmod %o %s", (uint)mode, ds_file.str));
|
||||
handle_command_error(command, chmod(ds_file.str, mode));
|
||||
error= 0;
|
||||
if (chmod(ds_file.str, mode))
|
||||
error= 1;
|
||||
handle_command_error(command, error, errno);
|
||||
dynstr_free(&ds_mode);
|
||||
dynstr_free(&ds_file);
|
||||
DBUG_VOID_RETURN;
|
||||
@ -3150,7 +3162,7 @@ void do_file_exist(struct st_command *command)
|
||||
|
||||
DBUG_PRINT("info", ("Checking for existence of file: %s", ds_filename.str));
|
||||
error= (access(ds_filename.str, F_OK) != 0);
|
||||
handle_command_error(command, error);
|
||||
handle_command_error(command, error, errno);
|
||||
dynstr_free(&ds_filename);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -3180,8 +3192,8 @@ void do_mkdir(struct st_command *command)
|
||||
' ');
|
||||
|
||||
DBUG_PRINT("info", ("creating directory: %s", ds_dirname.str));
|
||||
error= my_mkdir(ds_dirname.str, 0777, MYF(0)) != 0;
|
||||
handle_command_error(command, error);
|
||||
error= my_mkdir(ds_dirname.str, 0777, MYF(MY_WME)) != 0;
|
||||
handle_command_error(command, error, my_errno);
|
||||
dynstr_free(&ds_dirname);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -3211,7 +3223,7 @@ void do_rmdir(struct st_command *command)
|
||||
|
||||
DBUG_PRINT("info", ("removing directory: %s", ds_dirname.str));
|
||||
error= rmdir(ds_dirname.str) != 0;
|
||||
handle_command_error(command, error);
|
||||
handle_command_error(command, error, errno);
|
||||
dynstr_free(&ds_dirname);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
@ -3285,7 +3297,7 @@ static void do_list_files(struct st_command *command)
|
||||
sizeof(list_files_args)/sizeof(struct command_arg), ' ');
|
||||
|
||||
error= get_list_files(&ds_res, &ds_dirname, &ds_wild);
|
||||
handle_command_error(command, error);
|
||||
handle_command_error(command, error, my_errno);
|
||||
dynstr_free(&ds_dirname);
|
||||
dynstr_free(&ds_wild);
|
||||
DBUG_VOID_RETURN;
|
||||
@ -3327,7 +3339,7 @@ static void do_list_files_write_file_command(struct st_command *command,
|
||||
|
||||
init_dynamic_string(&ds_content, "", 1024, 1024);
|
||||
error= get_list_files(&ds_content, &ds_dirname, &ds_wild);
|
||||
handle_command_error(command, error);
|
||||
handle_command_error(command, error, my_errno);
|
||||
str_to_file2(ds_filename.str, ds_content.str, ds_content.length, append);
|
||||
dynstr_free(&ds_content);
|
||||
dynstr_free(&ds_filename);
|
||||
@ -3609,7 +3621,7 @@ void do_diff_files(struct st_command *command)
|
||||
|
||||
dynstr_free(&ds_filename);
|
||||
dynstr_free(&ds_filename2);
|
||||
handle_command_error(command, error);
|
||||
handle_command_error(command, error, -1);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
@ -3817,9 +3829,9 @@ void do_perl(struct st_command *command)
|
||||
error= pclose(res_file);
|
||||
|
||||
/* Remove the temporary file */
|
||||
my_delete(temp_file_path, MYF(0));
|
||||
my_delete(temp_file_path, MYF(MY_WME));
|
||||
|
||||
handle_command_error(command, WEXITSTATUS(error));
|
||||
handle_command_error(command, WEXITSTATUS(error), my_errno);
|
||||
}
|
||||
dynstr_free(&ds_delimiter);
|
||||
DBUG_VOID_RETURN;
|
||||
@ -4723,11 +4735,11 @@ char *get_string(char **to_ptr, char **from_ptr,
|
||||
}
|
||||
|
||||
|
||||
void set_reconnect(MYSQL* mysql, int val)
|
||||
void set_reconnect(MYSQL* mysql, my_bool val)
|
||||
{
|
||||
my_bool reconnect= val;
|
||||
DBUG_ENTER("set_reconnect");
|
||||
DBUG_PRINT("info", ("val: %d", val));
|
||||
DBUG_PRINT("info", ("val: %d", (int) val));
|
||||
#if MYSQL_VERSION_ID < 50000
|
||||
mysql->reconnect= reconnect;
|
||||
#else
|
||||
@ -5824,7 +5836,7 @@ int read_command(struct st_command** command_ptr)
|
||||
(struct st_command*) my_malloc(sizeof(*command),
|
||||
MYF(MY_WME|MY_ZEROFILL))) ||
|
||||
insert_dynamic(&q_lines, (uchar*) &command))
|
||||
die(NullS);
|
||||
die("Out of memory");
|
||||
command->type= Q_UNKNOWN;
|
||||
|
||||
read_command_buf[0]= 0;
|
||||
@ -5880,18 +5892,18 @@ static struct my_option my_long_options[] =
|
||||
{
|
||||
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"basedir", 'b', "Basedir for tests.", (uchar**) &opt_basedir,
|
||||
(uchar**) &opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"basedir", 'b', "Basedir for tests.", &opt_basedir,
|
||||
&opt_basedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"character-sets-dir", OPT_CHARSETS_DIR,
|
||||
"Directory for character set files.", (uchar**) &opt_charsets_dir,
|
||||
(uchar**) &opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
"Directory for character set files.", &opt_charsets_dir,
|
||||
&opt_charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"compress", 'C', "Use the compressed server/client protocol.",
|
||||
(uchar**) &opt_compress, (uchar**) &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
&opt_compress, &opt_compress, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"cursor-protocol", OPT_CURSOR_PROTOCOL, "Use cursors for prepared statements.",
|
||||
(uchar**) &cursor_protocol, (uchar**) &cursor_protocol, 0,
|
||||
&cursor_protocol, &cursor_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"database", 'D', "Database to use.", (uchar**) &opt_db, (uchar**) &opt_db, 0,
|
||||
{"database", 'D', "Database to use.", &opt_db, &opt_db, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit",
|
||||
@ -5901,33 +5913,33 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 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.",
|
||||
(uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0,
|
||||
&debug_check_flag, &debug_check_flag, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
|
||||
(uchar**) &debug_info_flag, (uchar**) &debug_info_flag,
|
||||
&debug_info_flag, &debug_info_flag,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"global-subst", OPT_GLOBAL_SUBST, "argument should be 'X,Y' ;"
|
||||
" substitute string X with another Y accross the whole test's current"
|
||||
" result before comparing with expected result file",
|
||||
(uchar**) &global_subst, (uchar**) &global_subst, 0,
|
||||
&global_subst, &global_subst, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"host", 'h', "Connect to host.", (uchar**) &opt_host, (uchar**) &opt_host, 0,
|
||||
{"host", 'h', "Connect to host.", &opt_host, &opt_host, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"include", 'i', "Include SQL before each test case.", (uchar**) &opt_include,
|
||||
(uchar**) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"logdir", OPT_LOG_DIR, "Directory for log files", (uchar**) &opt_logdir,
|
||||
(uchar**) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"include", 'i', "Include SQL before each test case.", &opt_include,
|
||||
&opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"logdir", OPT_LOG_DIR, "Directory for log files", &opt_logdir,
|
||||
&opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"mark-progress", OPT_MARK_PROGRESS,
|
||||
"Write line number and elapsed time to <testname>.progress.",
|
||||
(uchar**) &opt_mark_progress, (uchar**) &opt_mark_progress, 0,
|
||||
&opt_mark_progress, &opt_mark_progress, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"max-connect-retries", OPT_MAX_CONNECT_RETRIES,
|
||||
"Maximum number of attempts to connect to server.",
|
||||
(uchar**) &opt_max_connect_retries, (uchar**) &opt_max_connect_retries, 0,
|
||||
&opt_max_connect_retries, &opt_max_connect_retries, 0,
|
||||
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
|
||||
{"max-connections", OPT_MAX_CONNECTIONS,
|
||||
"Max number of open connections to server",
|
||||
(uchar**) &opt_max_connections, (uchar**) &opt_max_connections, 0,
|
||||
&opt_max_connections, &opt_max_connections, 0,
|
||||
GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
|
||||
{"password", 'p', "Password to use when connecting to server.",
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -5937,18 +5949,17 @@ static struct my_option my_long_options[] =
|
||||
"/etc/services, "
|
||||
#endif
|
||||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
(uchar**) &opt_port,
|
||||
(uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&opt_port, &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ps-protocol", OPT_PS_PROTOCOL,
|
||||
"Use prepared-statement protocol for communication.",
|
||||
(uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
|
||||
&ps_protocol, &ps_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"quiet", 's', "Suppress all normal output.", (uchar**) &silent,
|
||||
(uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"quiet", 's', "Suppress all normal output.", &silent,
|
||||
&silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"record", 'r', "Record output of test_file into result file.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"result-file", 'R', "Read/store result from/in this file.",
|
||||
(uchar**) &result_file_name, (uchar**) &result_file_name, 0,
|
||||
&result_file_name, &result_file_name, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"server-arg", 'A', "Send option value to embedded server as a parameter.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -5956,28 +5967,28 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef HAVE_SMEM
|
||||
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
|
||||
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
|
||||
(uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
"Base name of shared memory.", &shared_memory_base_name,
|
||||
&shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
|
||||
(uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
|
||||
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"sleep", 'T', "Always sleep this many seconds on sleep commands.",
|
||||
(uchar**) &opt_sleep, (uchar**) &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
|
||||
&opt_sleep, &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0,
|
||||
0, 0, 0},
|
||||
{"socket", 'S', "The socket file to use for connection.",
|
||||
(uchar**) &unix_sock, (uchar**) &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
&unix_sock, &unix_sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"sp-protocol", OPT_SP_PROTOCOL, "Use stored procedures for select.",
|
||||
(uchar**) &sp_protocol, (uchar**) &sp_protocol, 0,
|
||||
&sp_protocol, &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 result to include in a failure report.",
|
||||
(uchar**) &opt_tail_lines, (uchar**) &opt_tail_lines, 0,
|
||||
&opt_tail_lines, &opt_tail_lines, 0,
|
||||
GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0},
|
||||
{"test-file", 'x', "Read test from/in this file (default stdin).",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@ -5988,14 +5999,14 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"tmpdir", 't', "Temporary directory where sockets are put.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login.", (uchar**) &opt_user, (uchar**) &opt_user, 0,
|
||||
{"user", 'u', "User for login.", &opt_user, &opt_user, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Write more.", (uchar**) &verbose, (uchar**) &verbose, 0,
|
||||
{"verbose", 'v', "Write more.", &verbose, &verbose, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select.",
|
||||
(uchar**) &view_protocol, (uchar**) &view_protocol, 0,
|
||||
&view_protocol, &view_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
@ -6322,7 +6333,7 @@ void init_win_path_patterns()
|
||||
}
|
||||
|
||||
if (insert_dynamic(&patterns, (uchar*) &p))
|
||||
die(NullS);
|
||||
die("Out of memory");
|
||||
|
||||
DBUG_PRINT("info", ("p: %s", p));
|
||||
while (*p)
|
||||
@ -7668,7 +7679,7 @@ void mark_progress(struct st_command* command __attribute__((unused)),
|
||||
die("Out of memory");
|
||||
|
||||
/* Milliseconds since start */
|
||||
end= longlong2str(timer, buf, 10);
|
||||
end= longlong10_to_str(timer, buf, 10);
|
||||
dynstr_append_mem(&ds_progress, buf, (int)(end-buf));
|
||||
dynstr_append_mem(&ds_progress, "\t", 1);
|
||||
|
||||
@ -8199,12 +8210,12 @@ int main(int argc, char **argv)
|
||||
command->last_argument= command->end;
|
||||
break;
|
||||
case Q_PING:
|
||||
handle_command_error(command, mysql_ping(&cur_con->mysql));
|
||||
handle_command_error(command, mysql_ping(&cur_con->mysql), -1);
|
||||
break;
|
||||
case Q_SEND_SHUTDOWN:
|
||||
handle_command_error(command,
|
||||
mysql_shutdown(&cur_con->mysql,
|
||||
SHUTDOWN_DEFAULT));
|
||||
SHUTDOWN_DEFAULT), -1);
|
||||
break;
|
||||
case Q_SHUTDOWN_SERVER:
|
||||
do_shutdown_server(command);
|
||||
@ -8426,7 +8437,7 @@ void timer_output(void)
|
||||
{
|
||||
char buf[32], *end;
|
||||
ulonglong timer= timer_now() - timer_start;
|
||||
end= longlong2str(timer, buf, 10);
|
||||
end= longlong10_to_str(timer, buf, 10);
|
||||
str_to_file(timer_file,buf, (int) (end-buf));
|
||||
/* Timer has been written to the file, don't use it anymore */
|
||||
timer_file= 0;
|
||||
@ -8588,15 +8599,15 @@ void free_replace()
|
||||
|
||||
|
||||
typedef struct st_replace {
|
||||
my_bool found;
|
||||
int found;
|
||||
struct st_replace *next[256];
|
||||
} REPLACE;
|
||||
|
||||
typedef struct st_replace_found {
|
||||
my_bool found;
|
||||
char *replace_string;
|
||||
int found;
|
||||
uint to_offset;
|
||||
int from_offset;
|
||||
char *replace_string;
|
||||
} REPLACE_STRING;
|
||||
|
||||
|
||||
@ -8628,7 +8639,7 @@ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
|
||||
}
|
||||
|
||||
/* Found a string that needs to be replaced */
|
||||
DBUG_PRINT("info", ("found: %d, to_offset: %d, from_offset: %d, string: %s",
|
||||
DBUG_PRINT("info", ("found: %d, to_offset: %u, from_offset: %d, string: %s",
|
||||
rep_str->found, rep_str->to_offset,
|
||||
rep_str->from_offset, rep_str->replace_string));
|
||||
|
||||
@ -9402,8 +9413,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
|
||||
for (i=1 ; i <= found_sets ; i++)
|
||||
{
|
||||
pos=from[found_set[i-1].table_offset];
|
||||
rep_str[i].found= !bcmp((const uchar*) pos,
|
||||
(const uchar*) "\\^", 3) ? 2 : 1;
|
||||
rep_str[i].found= !memcmp(pos, "\\^", 3) ? 2 : 1;
|
||||
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
|
||||
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
|
||||
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
|
||||
@ -9531,8 +9541,8 @@ void copy_bits(REP_SET *to,REP_SET *from)
|
||||
|
||||
int cmp_bits(REP_SET *set1,REP_SET *set2)
|
||||
{
|
||||
return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
return memcmp(set1->bits, set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
}
|
||||
|
||||
|
||||
@ -9601,17 +9611,15 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
|
||||
|
||||
uint start_at_word(char * pos)
|
||||
{
|
||||
return (((!bcmp((const uchar*) pos, (const uchar*) "\\b",2) && pos[2]) ||
|
||||
!bcmp((const uchar*) pos, (const uchar*) "\\^", 2)) ? 1 : 0);
|
||||
return (((!memcmp(pos, "\\b",2) && pos[2]) ||
|
||||
!memcmp(pos, "\\^", 2)) ? 1 : 0);
|
||||
}
|
||||
|
||||
uint end_of_word(char * pos)
|
||||
{
|
||||
char * end=strend(pos);
|
||||
return ((end > pos+2 && !bcmp((const uchar*) end-2,
|
||||
(const uchar*) "\\b", 2)) ||
|
||||
(end >= pos+2 && !bcmp((const uchar*) end-2,
|
||||
(const uchar*) "\\$",2))) ? 1 : 0;
|
||||
return ((end > pos+2 && !memcmp(end-2, "\\b", 2)) ||
|
||||
(end >= pos+2 && !memcmp(end-2, "\\$",2))) ? 1 : 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -9831,3 +9839,18 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
|
||||
delete_dynamic(&lines);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
#ifndef HAVE_SETENV
|
||||
static int setenv(const char *name, const char *value, int overwrite)
|
||||
{
|
||||
size_t buflen= strlen(name) + strlen(value) + 2;
|
||||
char *envvar= (char *)malloc(buflen);
|
||||
if(!envvar)
|
||||
return ENOMEM;
|
||||
strcpy(envvar, name);
|
||||
strcat(envvar, "=");
|
||||
strcat(envvar, value);
|
||||
putenv(envvar);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
@ -19,6 +19,3 @@
|
||||
|
||||
SUBDIRS= @readline_basedir@
|
||||
DIST_SUBDIRS= libedit readline
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -31,7 +31,7 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
|
||||
|
||||
EXTRA_DIST= emacs_keymap.c vi_keymap.c
|
||||
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
|
||||
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -318,7 +318,9 @@ _rl_input_available ()
|
||||
return (_kbhit ());
|
||||
#endif
|
||||
|
||||
#if !defined (HAVE_SELECT)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
|
64
config/ac-macros/maintainer.m4
Normal file
64
config/ac-macros/maintainer.m4
Normal file
@ -0,0 +1,64 @@
|
||||
#
|
||||
# Control aspects of the development environment which are
|
||||
# specific to MySQL maintainers and developers.
|
||||
#
|
||||
AC_DEFUN([MY_MAINTAINER_MODE], [
|
||||
AC_MSG_CHECKING([whether to enable the maintainer-specific development environment])
|
||||
AC_ARG_ENABLE([mysql-maintainer-mode],
|
||||
[AS_HELP_STRING([--enable-mysql-maintainer-mode],
|
||||
[Enable a MySQL maintainer-specific development environment])],
|
||||
[USE_MYSQL_MAINTAINER_MODE=$enableval],
|
||||
[USE_MYSQL_MAINTAINER_MODE=no])
|
||||
AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
|
||||
])
|
||||
|
||||
# Set warning options required under maintainer mode.
|
||||
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
|
||||
# Setup GCC warning options.
|
||||
AS_IF([test "$GCC" = "yes"], [
|
||||
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
|
||||
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
|
||||
])
|
||||
|
||||
# Test whether the warning options work.
|
||||
# Test C options
|
||||
AS_IF([test -n "$C_WARNINGS"], [
|
||||
save_CFLAGS="$CFLAGS"
|
||||
AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}])
|
||||
AC_LANG_PUSH(C)
|
||||
CFLAGS="$CFLAGS ${C_WARNINGS}"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes],
|
||||
[myac_c_warning_flags=no])
|
||||
AC_LANG_POP()
|
||||
AC_MSG_RESULT([$myac_c_warning_flags])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
])
|
||||
|
||||
# Test C++ options
|
||||
AS_IF([test -n "$CXX_WARNINGS"], [
|
||||
save_CXXFLAGS="$CXXFLAGS"
|
||||
AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}])
|
||||
AC_LANG_PUSH(C++)
|
||||
CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes],
|
||||
[myac_cxx_warning_flags=no])
|
||||
AC_LANG_POP()
|
||||
AC_MSG_RESULT([$myac_cxx_warning_flags])
|
||||
CXXFLAGS="$save_CXXFLAGS"
|
||||
])
|
||||
|
||||
# Set compile flag variables.
|
||||
AS_IF([test "$myac_c_warning_flags" = "yes"], [
|
||||
AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}"
|
||||
AC_SUBST([AM_CFLAGS])])
|
||||
AS_IF([test "$myac_cxx_warning_flags" = "yes"], [
|
||||
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}"
|
||||
AC_SUBST([AM_CXXFLAGS])])
|
||||
])
|
||||
|
||||
|
||||
# Set compiler flags required under maintainer mode.
|
||||
AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [
|
||||
AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"],
|
||||
[MY_MAINTAINER_MODE_WARNINGS])
|
||||
])
|
@ -26,7 +26,7 @@ AC_DEFUN([MYSQL_PLUGIN],[
|
||||
[__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__],
|
||||
m4_default([$2], [$1 plugin]),
|
||||
m4_default([$3], [plugin for $1]),
|
||||
m4_default([$4], []),
|
||||
m4_default([[$4]], []),
|
||||
)
|
||||
])
|
||||
|
||||
@ -61,7 +61,7 @@ dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([MYSQL_STORAGE_ENGINE],[
|
||||
MYSQL_PLUGIN([$1], [$3], [$4], [[$5]])
|
||||
MYSQL_PLUGIN([$1], [$3], [$4], [$5])
|
||||
MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE])
|
||||
ifelse([$2],[no],[],[
|
||||
_MYSQL_LEGACY_STORAGE_ENGINE(
|
||||
@ -202,6 +202,30 @@ AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[
|
||||
])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_PLUGIN_WITHOUT
|
||||
dnl
|
||||
dnl SYNOPSIS
|
||||
dnl MYSQL_PLUGIN_WITHOUT([name])
|
||||
dnl
|
||||
dnl DESCRIPTION
|
||||
dnl Exclude the plugin from being built, as if --without-plugin-name
|
||||
dnl was specified.
|
||||
dnl If the plugin was selected manually by --with-plugin-name,
|
||||
dnl excluding it here will abort the configure script with an error,
|
||||
dnl otherwise plugin will be silently disabled.
|
||||
dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([MYSQL_PLUGIN_WITHOUT],[
|
||||
MYSQL_REQUIRE_PLUGIN([$1])
|
||||
if test "X[$with_plugin_]$1" = Xyes; then
|
||||
AC_MSG_ERROR([Plugin $1 cannot be built])
|
||||
else
|
||||
[with_plugin_]$1=no
|
||||
fi
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_PLUGIN_DEPENDS
|
||||
dnl
|
||||
@ -343,7 +367,7 @@ AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
|
||||
AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
m4_ifdef([$5],[
|
||||
AH_TEMPLATE($5, [Include ]$4[ into mysqld])
|
||||
AH_TEMPLATE($5, [Include ]$3[ into mysqld])
|
||||
])
|
||||
AC_MSG_CHECKING([whether to use ]$3)
|
||||
mysql_use_plugin_dir=""
|
||||
@ -351,10 +375,10 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
if test "X[$mysql_plugin_]$2" = Xyes -a \
|
||||
"X[$with_plugin_]$2" != Xno -o \
|
||||
"X[$with_plugin_]$2" = Xyes; then
|
||||
AC_MSG_RESULT([error])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[error])
|
||||
AC_MSG_ERROR([disabled])
|
||||
fi
|
||||
AC_MSG_RESULT([no])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[no])
|
||||
],[
|
||||
|
||||
# Plugin is not disabled, determine if it should be built,
|
||||
@ -365,7 +389,7 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
# Plugin directory was removed after autoconf was run; treat
|
||||
# this as a disabled plugin
|
||||
if test "X[$with_plugin_]$2" = Xyes; then
|
||||
AC_MSG_RESULT([error])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[error])
|
||||
AC_MSG_ERROR([disabled])
|
||||
fi
|
||||
|
||||
@ -376,7 +400,7 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
|
||||
m4_ifdef([$9],[
|
||||
if test "X[$with_plugin_]$2" = Xno; then
|
||||
AC_MSG_RESULT([error])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[error])
|
||||
AC_MSG_ERROR([cannot disable mandatory plugin])
|
||||
fi
|
||||
[mysql_plugin_]$2=yes
|
||||
@ -391,11 +415,19 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# Similarly, disable shared plugins when configured with --disable-shared
|
||||
# as libtool will not be able to produce them
|
||||
if test "X[$enable_shared]" = Xno; then
|
||||
if test "X[$mysql_plugin_]$2" != Xyes -a \
|
||||
"X[$with_plugin_]$2" != Xyes; then
|
||||
[with_plugin_]$2=no
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
if test "X[$with_plugin_]$2" = Xno; then
|
||||
AC_MSG_RESULT([no])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[no])
|
||||
else
|
||||
m4_ifdef([$8],m4_ifdef([$7],[],[[with_plugin_]$2='']))
|
||||
if test "X[$mysql_plugin_]$2" != Xyes -a \
|
||||
@ -408,16 +440,16 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
||||
AC_SUBST([plugin_]$2[_shared_target], "$8")
|
||||
AC_SUBST([plugin_]$2[_static_target], [""])
|
||||
[with_plugin_]$2=yes
|
||||
AC_MSG_RESULT([plugin])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[plugin])
|
||||
m4_ifdef([$6],[
|
||||
else
|
||||
[mysql_plugin_]$2=no
|
||||
AC_MSG_RESULT([no])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[no])
|
||||
fi
|
||||
])
|
||||
],[
|
||||
[with_plugin_]$2=no
|
||||
AC_MSG_RESULT([no])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[no])
|
||||
])
|
||||
else
|
||||
m4_ifdef([$7],[
|
||||
@ -450,7 +482,7 @@ dnl Although this is "pretty", it breaks libmysqld build
|
||||
AC_SUBST([plugin_]$2[_shared_target], [""])
|
||||
],[
|
||||
m4_ifdef([$6],[
|
||||
AC_MSG_RESULT([error])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[error])
|
||||
AC_MSG_ERROR([Plugin $1 does not support static linking])
|
||||
],[
|
||||
m4_ifdef([$5],[
|
||||
@ -462,7 +494,7 @@ dnl Although this is "pretty", it breaks libmysqld build
|
||||
])
|
||||
maria_plugin_defs="$maria_plugin_defs, [builtin_maria_]$2[_plugin]"
|
||||
[with_plugin_]$2=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
__MYSQL_EMIT_CHECK_RESULT($3,[yes])
|
||||
m4_ifdef([$11], [
|
||||
m4_foreach([plugin], [$11], [
|
||||
condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])"
|
||||
@ -518,6 +550,12 @@ dnl
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([__MYSQL_EMIT_CHECK_RESULT],[
|
||||
AC_MSG_RESULT($2)
|
||||
plugin_report="[$plugin_report]
|
||||
m4_format([ * %-32s $2],$1:)"
|
||||
])
|
||||
|
||||
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[
|
||||
ifelse($#, 0, [], $#, 1, [
|
||||
_MYSQL_EMIT_PLUGIN_ACTION([$1])
|
||||
|
@ -38,11 +38,20 @@ AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [
|
||||
esac
|
||||
AC_SUBST([yassl_taocrypt_extra_cxxflags])
|
||||
|
||||
# Thread safe check
|
||||
yassl_thread_cxxflags=""
|
||||
yassl_thread_safe=""
|
||||
if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then
|
||||
yassl_thread_cxxflags="-DYASSL_THREAD_SAFE"
|
||||
yassl_thread_safe="(thread-safe)"
|
||||
fi
|
||||
AC_SUBST([yassl_thread_cxxflags])
|
||||
|
||||
# Link extra/yassl/include/openssl subdir to include/
|
||||
yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl"
|
||||
AC_SUBST(yassl_h_ln_cmd)
|
||||
|
||||
AC_MSG_RESULT([using bundled yaSSL])
|
||||
AC_MSG_RESULT([using bundled yaSSL $yassl_thread_safe])
|
||||
])
|
||||
|
||||
|
||||
|
68
configure.in
68
configure.in
@ -70,6 +70,7 @@ MYSQL_TCP_PORT_DEFAULT=3306
|
||||
MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
|
||||
|
||||
dnl Include m4
|
||||
sinclude(config/ac-macros/maintainer.m4)
|
||||
sinclude(config/ac-macros/alloca.m4)
|
||||
sinclude(config/ac-macros/check_cpu.m4)
|
||||
sinclude(config/ac-macros/character_sets.m4)
|
||||
@ -108,6 +109,8 @@ AC_SUBST(SHARED_LIB_MAJOR_VERSION)
|
||||
AC_SUBST(SHARED_LIB_VERSION)
|
||||
AC_SUBST(AVAILABLE_LANGUAGES)
|
||||
|
||||
# Whether the maintainer mode should be enabled.
|
||||
MY_MAINTAINER_MODE
|
||||
|
||||
# Canonicalize the configuration name.
|
||||
|
||||
@ -834,9 +837,9 @@ AC_TYPE_SIZE_T
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
|
||||
memory.h pwd.h select.h fnmatch.h \
|
||||
stdlib.h stddef.h sys/stat.h valgrind/memcheck.h \
|
||||
AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \
|
||||
ieeefp.h limits.h memory.h pwd.h select.h fnmatch.h \
|
||||
stdlib.h stddef.h sys/stat.h \
|
||||
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
|
||||
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
|
||||
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
|
||||
@ -1728,6 +1731,17 @@ else
|
||||
CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS"
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([valgrind],
|
||||
[AS_HELP_STRING([--with-valgrind],
|
||||
[Valgrind instrumentation @<:@default=no@:>@])],
|
||||
[], [with_valgrind=no])
|
||||
|
||||
if test "$with_valgrind" != "no"
|
||||
then
|
||||
AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h],
|
||||
[AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])])
|
||||
fi
|
||||
|
||||
# Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it.
|
||||
AC_MSG_CHECKING(if Debug Sync Facility should be enabled.)
|
||||
AC_ARG_ENABLE(debug_sync,
|
||||
@ -2897,7 +2911,13 @@ do
|
||||
done
|
||||
AC_SUBST(sql_union_dirs)
|
||||
|
||||
# Some useful subst
|
||||
#
|
||||
# Setup maintainer mode options by the end to not disturb
|
||||
# system and other checks.
|
||||
#
|
||||
MY_MAINTAINER_MODE_SETUP
|
||||
|
||||
# Some usefull subst
|
||||
AC_SUBST(CC)
|
||||
AC_SUBST(GXX)
|
||||
|
||||
@ -2922,7 +2942,8 @@ fi
|
||||
|
||||
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
|
||||
unittest/Makefile unittest/mytap/Makefile unittest/mytap/t/Makefile dnl
|
||||
unittest/mysys/Makefile unittest/examples/Makefile dnl
|
||||
unittest/mysys/Makefile unittest/strings/Makefile dnl
|
||||
unittest/examples/Makefile dnl
|
||||
strings/Makefile regex/Makefile storage/Makefile dnl
|
||||
man/Makefile BUILD/Makefile vio/Makefile dnl
|
||||
libmysql/Makefile libmysql_r/Makefile client/Makefile dnl
|
||||
@ -2946,30 +2967,29 @@ AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' C
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
echo
|
||||
echo "---"
|
||||
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
|
||||
echo "$plugin_report" | sort
|
||||
echo ""
|
||||
echo " * Installation prefix: $prefix"
|
||||
echo " * System type: $SYSTEM_TYPE"
|
||||
echo " * Host CPU: $host_cpu"
|
||||
echo " * C Compiler: $CC_VERSION"
|
||||
echo " * C++ Compiler: $CXX_VERSION"
|
||||
echo " * Debug enabled: $with_debug"
|
||||
echo " * Community Features: $ENABLE_COMMUNITY_FEATURES"
|
||||
echo ""
|
||||
echo "---"
|
||||
echo ""
|
||||
echo "You can find information about MariaDB at"
|
||||
echo http://askmonty.org/wiki/index.php/MariaDB
|
||||
echo
|
||||
echo "http://kb.askmonty.org/"
|
||||
echo ""
|
||||
echo "Remember to check the platform specific part of the reference manual for"
|
||||
echo "hints about installing MariaDB on your platform. Also have a look at the"
|
||||
echo "files in the Docs directory."
|
||||
echo
|
||||
|
||||
echo "---"
|
||||
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
|
||||
echo ""
|
||||
echo " * Installation prefix: $prefix"
|
||||
echo " * System type: $SYSTEM_TYPE"
|
||||
echo " * Host CPU: $host_cpu"
|
||||
echo " * C Compiler: $CC_VERSION"
|
||||
echo " * C++ Compiler: $CXX_VERSION"
|
||||
echo " * Debug enabled: $with_debug"
|
||||
echo " * Community Features: $ENABLE_COMMUNITY_FEATURES"
|
||||
echo ""
|
||||
echo "---"
|
||||
|
||||
# The first line "Thank you ..." is checked in ./Do-compile to verify that configure
|
||||
# ended sucessfully - don't remove it.
|
||||
echo
|
||||
echo ""
|
||||
echo "Thank you for choosing MariaDB!"
|
||||
echo
|
||||
echo ""
|
||||
|
@ -65,6 +65,3 @@ output5.r: factorial
|
||||
# a hack to have executable in builddir, not in srcdir
|
||||
tests-t: tests-t.pl
|
||||
cp -f $(srcdir)/tests-t.pl ./tests-t
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
|
||||
die <<EEE unless @ARGV;
|
||||
Usage: $0 func1 [func2 [ ...] ]
|
||||
|
||||
@ -11,16 +10,16 @@ DBUG_ENTER() and DBUG_POP(); right before DBUG_RETURN in every such a function.
|
||||
EEE
|
||||
|
||||
$re=join('|', @ARGV);
|
||||
$skip='';
|
||||
|
||||
while(<STDIN>) {
|
||||
print unless $skip;
|
||||
($thd) = /^(T@\d+)/;
|
||||
print unless $skip{$thd};
|
||||
next unless /^(?:.*: )*((?:\| )*)([<>])($re)\n/o;
|
||||
if ($2 eq '>') {
|
||||
$skip=$1.$3 unless $skip;
|
||||
$skip{$thd}=$1.$3 unless $skip{$thd};
|
||||
next;
|
||||
}
|
||||
next if $skip ne $1.$3;
|
||||
$skip='';
|
||||
next if $skip{$thd} ne $1.$3;
|
||||
delete $skip{$thd};
|
||||
print;
|
||||
}
|
||||
|
@ -53,3 +53,5 @@ TARGET_LINK_LIBRARIES(replace strings mysys debug dbug wsock32)
|
||||
IF(EMBED_MANIFESTS)
|
||||
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
|
||||
ENDIF(EMBED_MANIFESTS)
|
||||
|
||||
INSTALL(TARGETS comp_err my_print_defaults perror resolveip replace DESTINATION bin COMPONENT runtime)
|
||||
|
@ -55,6 +55,3 @@ EXTRA_DIST = CMakeLists.txt
|
||||
|
||||
perror.o: perror.c
|
||||
$(COMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -99,31 +99,30 @@ static struct my_option my_long_options[]=
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit",
|
||||
0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log", (uchar**) & default_dbug_option,
|
||||
(uchar**) & default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug", '#', "Output debug log", &default_dbug_option,
|
||||
&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"debug-info", 'T', "Print some debug info at exit.", (uchar**) & info_flag,
|
||||
(uchar**) & info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug-info", 'T', "Print some debug info at exit.", &info_flag,
|
||||
&info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Prints version", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"charset", 'C', "Charset dir", (uchar**) & charsets_dir,
|
||||
(uchar**) & charsets_dir,
|
||||
{"charset", 'C', "Charset dir",
|
||||
(char**) &charsets_dir, (char**) &charsets_dir,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"in_file", 'F', "Input file", (uchar**) & TXTFILE, (uchar**) & TXTFILE,
|
||||
{"in_file", 'F', "Input file", &TXTFILE, &TXTFILE,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"out_dir", 'D', "Output base directory", (uchar**) & DATADIRECTORY,
|
||||
(uchar**) & DATADIRECTORY,
|
||||
{"out_dir", 'D', "Output base directory", &DATADIRECTORY, &DATADIRECTORY,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"out_file", 'O', "Output filename (errmsg.sys)", (uchar**) & OUTFILE,
|
||||
(uchar**) & OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"header_file", 'H', "mysqld_error.h file ", (uchar**) & HEADERFILE,
|
||||
(uchar**) & HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"name_file", 'N', "mysqld_ername.h file ", (uchar**) & NAMEFILE,
|
||||
(uchar**) & NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"state_file", 'S', "sql_state.h file", (uchar**) & STATEFILE,
|
||||
(uchar**) & STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"out_file", 'O', "Output filename (errmsg.sys)", &OUTFILE,
|
||||
&OUTFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"header_file", 'H', "mysqld_error.h file ", &HEADERFILE,
|
||||
&HEADERFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"name_file", 'N', "mysqld_ername.h file ", &NAMEFILE,
|
||||
&NAMEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"state_file", 'S', "sql_state.h file", &STATEFILE,
|
||||
&STATEFILE, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@ -641,9 +640,9 @@ static struct message *find_message(struct errors *err, const char *lang,
|
||||
static ha_checksum checksum_format_specifier(const char* msg)
|
||||
{
|
||||
ha_checksum chksum= 0;
|
||||
const char* p= msg;
|
||||
const char* start= 0;
|
||||
int num_format_specifiers= 0;
|
||||
const uchar* p= (const uchar*) msg;
|
||||
const uchar* start= NULL;
|
||||
uint32 num_format_specifiers= 0;
|
||||
while (*p)
|
||||
{
|
||||
|
||||
@ -833,7 +832,6 @@ static struct message *parse_message_string(struct message *new_message,
|
||||
static struct errors *parse_error_string(char *str, int er_count)
|
||||
{
|
||||
struct errors *new_error;
|
||||
char *start;
|
||||
DBUG_ENTER("parse_error_string");
|
||||
DBUG_PRINT("enter", ("str: %s", str));
|
||||
|
||||
@ -844,7 +842,6 @@ static struct errors *parse_error_string(char *str, int er_count)
|
||||
DBUG_RETURN(0); /* OOM: Fatal error */
|
||||
|
||||
/* getting the error name */
|
||||
start= str;
|
||||
str= skip_delimiters(str);
|
||||
|
||||
if (!(new_error->er_name= get_word(&str)))
|
||||
|
@ -75,7 +75,7 @@ bufferevent_add(struct event *ev, int timeout)
|
||||
*/
|
||||
|
||||
void
|
||||
bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
|
||||
bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old __attribute__((unused)), size_t now,
|
||||
void *arg) {
|
||||
struct bufferevent *bufev = arg;
|
||||
/*
|
||||
|
@ -394,7 +394,8 @@ event_base_get_method(struct event_base *base)
|
||||
}
|
||||
|
||||
static void
|
||||
event_loopexit_cb(int fd, short what, void *arg)
|
||||
event_loopexit_cb(int fd __attribute__((unused)),
|
||||
short what __attribute__((unused)), void *arg)
|
||||
{
|
||||
struct event_base *base = arg;
|
||||
base->event_gotterm = 1;
|
||||
|
@ -69,7 +69,7 @@ static void evsignal_handler(int sig);
|
||||
|
||||
/* Callback for when the signal handler write a byte to our signaling socket */
|
||||
static void
|
||||
evsignal_cb(int fd, short what, void *arg)
|
||||
evsignal_cb(int fd, short what __attribute__((unused)), void *arg __attribute__((unused)))
|
||||
{
|
||||
static char signals[100];
|
||||
#ifdef WIN32
|
||||
|
@ -46,31 +46,36 @@ static struct my_option my_long_options[] =
|
||||
searched for a file of this name (and standard filename extensions are
|
||||
added if the file has no extension)
|
||||
*/
|
||||
{"config-file", 'c', "Deprecated, please use --defaults-file instead. Name of config file to read; if no extension is given, default extension (e.g., .ini or .cnf) will be added",
|
||||
(uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
|
||||
{"config-file", 'c', "Deprecated, please use --defaults-file instead. "
|
||||
"Name of config file to read; if no extension is given, default "
|
||||
"extension (e.g., .ini or .cnf) will be added",
|
||||
(char**) &config_file, (char**) &config_file, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit",
|
||||
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log", (uchar**) &default_dbug_option,
|
||||
(uchar**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"debug", '#', "Output debug log", (char**) &default_dbug_option,
|
||||
(char**) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"defaults-file", 'c', "Like --config-file, except: if first option, then read this file only, do not read global or per-user config files; should be the first option",
|
||||
(uchar**) &config_file, (uchar**) &config_file, 0, GET_STR, REQUIRED_ARG,
|
||||
{"defaults-file", 'c', "Like --config-file, except: if first option, "
|
||||
"then read this file only, do not read global or per-user config "
|
||||
"files; should be the first option",
|
||||
(char**) &config_file, (char*) &config_file, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"defaults-extra-file", 'e',
|
||||
"Read this file after the global config file and before the config file in the users home directory; should be the first option",
|
||||
(uchar**) &my_defaults_extra_file, (uchar**) &my_defaults_extra_file, 0,
|
||||
"Read this file after the global config file and before the config "
|
||||
"file in the users home directory; should be the first option",
|
||||
&my_defaults_extra_file, &my_defaults_extra_file, 0,
|
||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"defaults-group-suffix", 'g',
|
||||
"In addition to the given groups, read also groups with this suffix",
|
||||
(uchar**) &my_defaults_group_suffix, (uchar**) &my_defaults_group_suffix,
|
||||
(char**) &my_defaults_group_suffix, (char**) &my_defaults_group_suffix,
|
||||
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"extra-file", 'e',
|
||||
"Deprecated. Synonym for --defaults-extra-file.",
|
||||
(uchar**) &my_defaults_extra_file,
|
||||
(uchar**) &my_defaults_extra_file, 0, GET_STR,
|
||||
&my_defaults_extra_file,
|
||||
&my_defaults_extra_file, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"no-defaults", 'n', "Return an empty string (useful for scripts).",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
@ -38,7 +38,7 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, 0, 0},
|
||||
{"verbose", 'v',
|
||||
"Be more verbose. Give a warning, if kill can't handle signal 0.",
|
||||
(uchar**) &verbose, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
&verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Print version information and exit.", 0, 0, 0,
|
||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
|
@ -60,18 +60,18 @@ static struct my_option my_long_options[] =
|
||||
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
|
||||
{"ndb", 257, "Ndbcluster storage engine specific error codes.", (uchar**) &ndb_code,
|
||||
(uchar**) &ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ndb", 257, "Ndbcluster storage engine specific error codes.", &ndb_code,
|
||||
&ndb_code, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
#ifdef HAVE_SYS_ERRLIST
|
||||
{"all", 'a', "Print all the error messages and the number.",
|
||||
(uchar**) &print_all_codes, (uchar**) &print_all_codes, 0, GET_BOOL, NO_ARG,
|
||||
&print_all_codes, &print_all_codes, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"silent", 's', "Only print the error message.", 0, 0, 0, GET_NO_ARG, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Print error code and message (default).", (uchar**) &verbose,
|
||||
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Print error code and message (default).", &verbose,
|
||||
&verbose, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Displays version information and exits.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
|
@ -649,7 +649,7 @@ static REPLACE *init_replace(char * *from, char * *to,uint count,
|
||||
for (i=1 ; i <= found_sets ; i++)
|
||||
{
|
||||
pos=from[found_set[i-1].table_offset];
|
||||
rep_str[i].found= (my_bool) (!bcmp(pos,"\\^",3) ? 2 : 1);
|
||||
rep_str[i].found= (my_bool) (!memcmp(pos,"\\^",3) ? 2 : 1);
|
||||
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
|
||||
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
|
||||
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
|
||||
@ -777,8 +777,8 @@ static void copy_bits(REP_SET *to,REP_SET *from)
|
||||
|
||||
static int cmp_bits(REP_SET *set1,REP_SET *set2)
|
||||
{
|
||||
return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
return memcmp(set1->bits, set2->bits,
|
||||
sizeof(uint) * set1->size_of_bits);
|
||||
}
|
||||
|
||||
|
||||
@ -850,14 +850,14 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
|
||||
|
||||
static uint start_at_word(char * pos)
|
||||
{
|
||||
return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
|
||||
return (((!memcmp(pos,"\\b",2) && pos[2]) || !memcmp(pos,"\\^",2)) ? 1 : 0);
|
||||
}
|
||||
|
||||
static uint end_of_word(char * pos)
|
||||
{
|
||||
char * end=strend(pos);
|
||||
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
|
||||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
|
||||
return ((end > pos+2 && !memcmp(end-2,"\\b",2)) ||
|
||||
(end >= pos+2 && !memcmp(end-2,"\\$",2))) ?
|
||||
1 : 0;
|
||||
}
|
||||
|
||||
|
@ -53,10 +53,10 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"symbols-file", 's', "Use specified symbols file.", (uchar**) &sym_fname,
|
||||
(uchar**) &sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"symbols-file", 's', "Use specified symbols file.", &sym_fname,
|
||||
&sym_fname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"numeric-dump-file", 'n', "Read the dump from specified file.",
|
||||
(uchar**) &dump_fname, (uchar**) &dump_fname, 0, GET_STR, REQUIRED_ARG,
|
||||
&dump_fname, &dump_fname, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"info", 'I', "Synonym for --help.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"silent", 's', "Be more silent.", (uchar**) &silent, (uchar**) &silent,
|
||||
{"silent", 's', "Be more silent.", &silent, &silent,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Displays version information and exits.",
|
||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/include
|
||||
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
|
||||
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
|
||||
|
||||
ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX")
|
||||
ADD_DEFINITIONS("-D_LIB -DYASSL_PREFIX -DYASSL_THREAD_SAFE")
|
||||
|
||||
SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp
|
||||
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
|
||||
|
@ -5,49 +5,49 @@ Certificate:
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Jan 18 20:12:32 2005 GMT
|
||||
Not After : Oct 15 20:12:32 2007 GMT
|
||||
Not Before: Mar 7 03:10:11 2005 GMT
|
||||
Not After : Apr 1 03:10:11 2046 GMT
|
||||
Subject: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
RSA Public Key: (512 bit)
|
||||
Modulus (512 bit):
|
||||
00:cf:2b:14:00:b0:3c:df:6f:9e:91:40:ec:c8:f6:
|
||||
90:b2:5b:b4:70:80:a5:a4:0a:73:c7:44:f3:2a:26:
|
||||
c4:2f:f1:3a:f1:c3:c4:ac:fc:c3:d2:c3:bf:f5:d7:
|
||||
6a:38:42:ad:22:ab:c8:c4:4b:4c:1d:16:af:05:34:
|
||||
7d:79:97:5e:e1
|
||||
00:ef:c1:e3:9a:3c:6e:6e:cb:26:6f:05:be:e0:cb:
|
||||
57:a0:4b:68:e6:1b:f9:95:db:01:92:aa:6e:a6:b5:
|
||||
2d:b1:2b:50:fd:db:13:f2:c5:d8:b8:4f:75:28:53:
|
||||
72:e8:e5:11:9d:bb:c3:4f:4f:09:fd:4c:e7:46:d5:
|
||||
1d:bb:35:02:af
|
||||
Exponent: 65537 (0x10001)
|
||||
X509v3 extensions:
|
||||
X509v3 Subject Key Identifier:
|
||||
CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84
|
||||
1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD
|
||||
X509v3 Authority Key Identifier:
|
||||
keyid:CB:0F:1F:E9:A2:76:71:C9:E6:E8:23:A6:C1:18:B7:CC:44:CF:B9:84
|
||||
keyid:1D:EF:A1:B8:81:78:12:47:E8:57:06:08:74:18:F7:D3:AA:D8:F7:BD
|
||||
DirName:/C=US/ST=Oregon/L=Portland/O=sawtooth/CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
|
||||
serial:00
|
||||
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
27:f7:3d:fb:39:6f:73:a4:86:f3:a0:48:22:60:84:e9:5c:3d:
|
||||
28:36:05:16:44:98:07:87:e1:5d:b5:f3:a7:bc:33:5f:f4:29:
|
||||
a9:5f:87:33:df:e6:8e:bd:e2:f3:0a:c8:00:69:ae:3d:41:47:
|
||||
03:ea:0b:4c:67:45:4b:ab:f3:39
|
||||
d9:77:e3:07:d9:2e:ec:2f:9b:8e:9e:ca:b4:00:0b:ef:c7:74:
|
||||
cb:f4:f6:44:2f:02:75:17:a5:74:3e:26:b2:26:fd:1f:ab:3a:
|
||||
df:d5:e3:05:14:08:d0:8c:1d:c9:3e:e1:59:6f:b3:38:5d:af:
|
||||
78:60:e3:c5:6a:69:96:80:7d:00
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC7zCCApmgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiTELMAkGA1UEBhMCVVMx
|
||||
DzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxETAPBgNVBAoTCHNh
|
||||
d3Rvb3RoMSQwIgYDVQQDExt3d3cuc2F3dG9vdGgtY29uc3VsdGluZy5jb20xHTAb
|
||||
BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDExODIwMTIzMloXDTA3
|
||||
MTAxNTIwMTIzMlowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP
|
||||
BgkqhkiG9w0BCQEWDmluZm9AeWFzc2wuY29tMB4XDTA1MDMwNzAzMTAxMVoXDTQ2
|
||||
MDQwMTAzMTAxMVowgYkxCzAJBgNVBAYTAlVTMQ8wDQYDVQQIEwZPcmVnb24xETAP
|
||||
BgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290aDEkMCIGA1UEAxMbd3d3
|
||||
LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlh
|
||||
c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDPKxQAsDzfb56RQOzI9pCy
|
||||
W7RwgKWkCnPHRPMqJsQv8Trxw8Ss/MPSw7/112o4Qq0iq8jES0wdFq8FNH15l17h
|
||||
AgMBAAGjgekwgeYwHQYDVR0OBBYEFMsPH+midnHJ5ugjpsEYt8xEz7mEMIG2BgNV
|
||||
HSMEga4wgauAFMsPH+midnHJ5ugjpsEYt8xEz7mEoYGPpIGMMIGJMQswCQYDVQQG
|
||||
c3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDvweOaPG5uyyZvBb7gy1eg
|
||||
S2jmG/mV2wGSqm6mtS2xK1D92xPyxdi4T3UoU3Lo5RGdu8NPTwn9TOdG1R27NQKv
|
||||
AgMBAAGjgekwgeYwHQYDVR0OBBYEFB3vobiBeBJH6FcGCHQY99Oq2Pe9MIG2BgNV
|
||||
HSMEga4wgauAFB3vobiBeBJH6FcGCHQY99Oq2Pe9oYGPpIGMMIGJMQswCQYDVQQG
|
||||
EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDERMA8GA1UE
|
||||
ChMIc2F3dG9vdGgxJDAiBgNVBAMTG3d3dy5zYXd0b290aC1jb25zdWx0aW5nLmNv
|
||||
bTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNzbC5jb22CAQAwDAYDVR0TBAUwAwEB
|
||||
/zANBgkqhkiG9w0BAQQFAANBACf3Pfs5b3OkhvOgSCJghOlcPSg2BRZEmAeH4V21
|
||||
86e8M1/0KalfhzPf5o694vMKyABprj1BRwPqC0xnRUur8zk=
|
||||
/zANBgkqhkiG9w0BAQQFAANBANl34wfZLuwvm46eyrQAC+/HdMv09kQvAnUXpXQ+
|
||||
JrIm/R+rOt/V4wUUCNCMHck+4Vlvszhdr3hg48VqaZaAfQA=
|
||||
-----END CERTIFICATE-----
|
||||
|
Binary file not shown.
@ -5,8 +5,8 @@ Certificate:
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Jan 18 19:33:15 2005 GMT
|
||||
Not After : Oct 15 19:33:15 2007 GMT
|
||||
Not Before: Mar 7 03:00:31 2005 GMT
|
||||
Not After : Apr 1 03:00:31 2046 GMT
|
||||
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, CN=www.yassl.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
@ -29,15 +29,15 @@ Certificate:
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
c5:82:26:0c:1f:61:01:14:b0:ce:18:99:64:91:0e:f1:f8:90:
|
||||
3e:a3:0e:be:38:7c:97:ba:05:c9:2a:dc:dd:62:2d:12:61:79:
|
||||
7a:86:b1:97:5d:1e:e8:f7:e8:32:34:f7:8f:b1:08:3d:13:71:
|
||||
a6:3c:15:91:85:12:35:6e:78:87
|
||||
59:19:ae:1b:4e:65:9e:ca:f1:b8:3d:ff:c7:5e:15:86:10:97:
|
||||
8c:3e:22:32:ab:4e:75:a7:70:83:f2:fb:2f:af:fe:26:28:e9:
|
||||
4f:d4:c9:49:7c:6f:51:7e:2a:ff:a0:5b:25:45:2e:66:d9:0d:
|
||||
92:94:e5:b8:60:c6:67:1a:f3:03
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICtzCCAmGgAwIBAgIBADANBgkqhkiG9w0BAQQFADB4MQswCQYDVQQGEwJVUzEP
|
||||
MA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDEOMAwGA1UEChMFeWFT
|
||||
U0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkqhkiG9w0BCQEWDmluZm9A
|
||||
eWFzc2wuY29tMB4XDTA1MDExODE5MzMxNVoXDTA3MTAxNTE5MzMxNVoweDELMAkG
|
||||
eWFzc2wuY29tMB4XDTA1MDMwNzAzMDAzMVoXDTQ2MDQwMTAzMDAzMVoweDELMAkG
|
||||
A1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxhbmQxDjAM
|
||||
BgNVBAoTBXlhU1NMMRYwFAYDVQQDEw13d3cueWFzc2wuY29tMR0wGwYJKoZIhvcN
|
||||
AQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDNH3hH
|
||||
@ -47,6 +47,6 @@ wP/OtbStMIGiBgNVHSMEgZowgZeAFK4lXvpNo1srh97xKvVCwP/OtbStoXykejB4
|
||||
MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFu
|
||||
ZDEOMAwGA1UEChMFeWFTU0wxFjAUBgNVBAMTDXd3dy55YXNzbC5jb20xHTAbBgkq
|
||||
hkiG9w0BCQEWDmluZm9AeWFzc2wuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZI
|
||||
hvcNAQEEBQADQQDFgiYMH2EBFLDOGJlkkQ7x+JA+ow6+OHyXugXJKtzdYi0SYXl6
|
||||
hrGXXR7o9+gyNPePsQg9E3GmPBWRhRI1bniH
|
||||
hvcNAQEEBQADQQBZGa4bTmWeyvG4Pf/HXhWGEJeMPiIyq051p3CD8vsvr/4mKOlP
|
||||
1MlJfG9Rfir/oFslRS5m2Q2SlOW4YMZnGvMD
|
||||
-----END CERTIFICATE-----
|
||||
|
@ -5,8 +5,8 @@ Certificate:
|
||||
Signature Algorithm: dsaWithSHA1
|
||||
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Jan 23 22:54:51 2005 GMT
|
||||
Not After : Oct 20 22:54:51 2007 GMT
|
||||
Not Before: Mar 7 03:22:00 2005 GMT
|
||||
Not After : Apr 1 03:22:00 2046 GMT
|
||||
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL DSA, CN=yaSSL DSA/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: dsaEncryption
|
||||
@ -43,14 +43,14 @@ Certificate:
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: dsaWithSHA1
|
||||
30:2b:02:14:74:46:9f:91:7b:24:17:3b:ee:0f:10:e3:76:62:
|
||||
f4:dc:81:e6:fd:fe:02:13:08:f4:87:0a:ab:ba:9c:de:3a:69:
|
||||
72:59:b8:ec:e9:57:f4:bf:37
|
||||
30:2c:02:14:7e:5e:94:fc:7f:ca:81:ab:b3:32:f7:21:83:48:
|
||||
48:5f:0a:f1:13:ca:02:14:73:54:32:14:51:22:bf:0b:ec:d7:
|
||||
6a:6a:fa:a7:1d:46:b4:c2:a3:b5
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDMTCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD
|
||||
MIIDMjCCAvKgAwIBAgIBADAJBgcqhkjOOAQDMHgxCzAJBgNVBAYTAlVTMQ8wDQYD
|
||||
VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMRIwEAYDVQQKEwl5YVNTTCBE
|
||||
U0ExEjAQBgNVBAMTCXlhU1NMIERTQTEdMBsGCSqGSIb3DQEJARYOaW5mb0B5YXNz
|
||||
bC5jb20wHhcNMDUwMTIzMjI1NDUxWhcNMDcxMDIwMjI1NDUxWjB4MQswCQYDVQQG
|
||||
bC5jb20wHhcNMDUwMzA3MDMyMjAwWhcNNDYwNDAxMDMyMjAwWjB4MQswCQYDVQQG
|
||||
EwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQHEwhQb3J0bGFuZDESMBAGA1UE
|
||||
ChMJeWFTU0wgRFNBMRIwEAYDVQQDEwl5YVNTTCBEU0ExHTAbBgkqhkiG9w0BCQEW
|
||||
DmluZm9AeWFzc2wuY29tMIHwMIGoBgcqhkjOOAQBMIGcAkEAmSlpgMk8mGhFqYL+
|
||||
@ -63,6 +63,6 @@ IeRhRHPp4jCBogYDVR0jBIGaMIGXgBS++Yxd1hy07oHdNlYKIeRhRHPp4qF8pHow
|
||||
eDELMAkGA1UEBhMCVVMxDzANBgNVBAgTBk9yZWdvbjERMA8GA1UEBxMIUG9ydGxh
|
||||
bmQxEjAQBgNVBAoTCXlhU1NMIERTQTESMBAGA1UEAxMJeWFTU0wgRFNBMR0wGwYJ
|
||||
KoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbYIBADAMBgNVHRMEBTADAQH/MAkGByqG
|
||||
SM44BAMDLgAwKwIUdEafkXskFzvuDxDjdmL03IHm/f4CEwj0hwqrupzeOmlyWbjs
|
||||
6Vf0vzc=
|
||||
SM44BAMDLwAwLAIUfl6U/H/KgauzMvchg0hIXwrxE8oCFHNUMhRRIr8L7Ndqavqn
|
||||
HUa0wqO1
|
||||
-----END CERTIFICATE-----
|
||||
|
@ -5,8 +5,8 @@ Certificate:
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
Issuer: C=US, ST=Oregon, L=Portland, O=sawtooth, CN=www.sawtooth-consulting.com/emailAddress=info@yassl.com
|
||||
Validity
|
||||
Not Before: Jan 18 20:50:59 2005 GMT
|
||||
Not After : Oct 15 20:50:59 2007 GMT
|
||||
Not Before: Mar 8 03:00:47 2005 GMT
|
||||
Not After : Apr 2 03:00:47 2046 GMT
|
||||
Subject: C=US, ST=Oregon, L=Portland, O=taoSoftDev, CN=www.taosoftdev.com/emailAddress=info@yassl.com
|
||||
Subject Public Key Info:
|
||||
Public Key Algorithm: rsaEncryption
|
||||
@ -19,20 +19,20 @@ Certificate:
|
||||
f2:25:93:22:e7
|
||||
Exponent: 65537 (0x10001)
|
||||
Signature Algorithm: md5WithRSAEncryption
|
||||
08:36:07:8c:3a:7f:f9:91:0a:82:d1:6a:c1:34:be:bc:2d:b2:
|
||||
20:98:dc:45:50:53:9c:66:e6:26:71:bd:fa:d2:b4:91:d3:53:
|
||||
c0:20:05:c0:b6:84:9a:5f:3f:61:75:f5:fd:c6:ec:e2:f6:9f:
|
||||
a2:13:17:a9:b7:83:60:cc:cb:eb
|
||||
36:72:12:3b:ac:e4:58:83:09:86:4f:71:2a:3a:0d:8a:05:27:
|
||||
75:f3:3e:62:4f:ab:b8:70:20:cd:ad:70:ab:91:11:68:f8:82:
|
||||
33:e2:78:85:a8:16:f5:66:bd:68:2c:5a:26:15:12:1e:6e:83:
|
||||
c7:6d:62:b9:c3:ff:e1:86:e4:e6
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIB9zCCAaECAQEwDQYJKoZIhvcNAQEEBQAwgYkxCzAJBgNVBAYTAlVTMQ8wDQYD
|
||||
VQQIEwZPcmVnb24xETAPBgNVBAcTCFBvcnRsYW5kMREwDwYDVQQKEwhzYXd0b290
|
||||
aDEkMCIGA1UEAxMbd3d3LnNhd3Rvb3RoLWNvbnN1bHRpbmcuY29tMR0wGwYJKoZI
|
||||
hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAxMTgyMDUwNTlaFw0wNzEwMTUy
|
||||
MDUwNTlaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH
|
||||
hvcNAQkBFg5pbmZvQHlhc3NsLmNvbTAeFw0wNTAzMDgwMzAwNDdaFw00NjA0MDIw
|
||||
MzAwNDdaMIGCMQswCQYDVQQGEwJVUzEPMA0GA1UECBMGT3JlZ29uMREwDwYDVQQH
|
||||
EwhQb3J0bGFuZDETMBEGA1UEChMKdGFvU29mdERldjEbMBkGA1UEAxMSd3d3LnRh
|
||||
b3NvZnRkZXYuY29tMR0wGwYJKoZIhvcNAQkBFg5pbmZvQHlhc3NsLmNvbTBcMA0G
|
||||
CSqGSIb3DQEBAQUAA0sAMEgCQQCkaLu8tydfPPV4xhqvuZX8fmEfqIEKykOImgPg
|
||||
0KZ5cBY0uXx1VMpwGWY4vm4ofqX/azyDLzlCwxXzvfIlkyLnAgMBAAEwDQYJKoZI
|
||||
hvcNAQEEBQADQQAINgeMOn/5kQqC0WrBNL68LbIgmNxFUFOcZuYmcb360rSR01PA
|
||||
IAXAtoSaXz9hdfX9xuzi9p+iExept4NgzMvr
|
||||
hvcNAQEEBQADQQA2chI7rORYgwmGT3EqOg2KBSd18z5iT6u4cCDNrXCrkRFo+IIz
|
||||
4niFqBb1Zr1oLFomFRIeboPHbWK5w//hhuTm
|
||||
-----END CERTIFICATE-----
|
||||
|
@ -23,13 +23,21 @@
|
||||
#ifndef yaSSL_LOCK_HPP
|
||||
#define yaSSL_LOCK_HPP
|
||||
|
||||
/*
|
||||
Visual Studio Source Annotations header (sourceannotations.h) fails
|
||||
to compile if outside of the global namespace.
|
||||
*/
|
||||
#ifdef YASSL_THREAD_SAFE
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace yaSSL {
|
||||
|
||||
|
||||
#ifdef MULTI_THREADED
|
||||
#ifdef YASSL_THREAD_SAFE
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
class Mutex {
|
||||
CRITICAL_SECTION cs_;
|
||||
@ -69,7 +77,7 @@ namespace yaSSL {
|
||||
};
|
||||
|
||||
#endif // _WIN32
|
||||
#else // MULTI_THREADED (WE'RE SINGLE)
|
||||
#else // YASSL_THREAD_SAFE (WE'RE SINGLE)
|
||||
|
||||
class Mutex {
|
||||
public:
|
||||
@ -79,7 +87,7 @@ namespace yaSSL {
|
||||
};
|
||||
};
|
||||
|
||||
#endif // MULTI_THREADED
|
||||
#endif // YASSL_THREAD_SAFE
|
||||
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
|
||||
handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \
|
||||
template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp
|
||||
EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h)
|
||||
AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX
|
||||
AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -26,7 +26,7 @@
|
||||
namespace yaSSL {
|
||||
|
||||
|
||||
#ifdef MULTI_THREADED
|
||||
#ifdef YASSL_THREAD_SAFE
|
||||
#ifdef _WIN32
|
||||
|
||||
Mutex::Mutex()
|
||||
@ -79,7 +79,7 @@ namespace yaSSL {
|
||||
|
||||
|
||||
#endif // _WIN32
|
||||
#endif // MULTI_THREADED
|
||||
#endif // YASSL_THREAD_SAFE
|
||||
|
||||
|
||||
|
||||
|
@ -884,21 +884,19 @@ void Alert::Process(input_buffer& input, SSL& ssl)
|
||||
else
|
||||
hmac(ssl, verify, data, aSz, alert, true);
|
||||
|
||||
// read mac and fill
|
||||
// read mac and skip fill
|
||||
int digestSz = ssl.getCrypto().get_digest().get_digestSize();
|
||||
opaque mac[SHA_LEN];
|
||||
input.read(mac, digestSz);
|
||||
|
||||
if (ssl.getSecurity().get_parms().cipher_type_ == block) {
|
||||
int ivExtra = 0;
|
||||
opaque fill;
|
||||
|
||||
if (ssl.isTLSv1_1())
|
||||
ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
|
||||
int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
|
||||
aSz - digestSz;
|
||||
for (int i = 0; i < padSz; i++)
|
||||
fill = input[AUTO];
|
||||
input.set_current(input.get_current() + padSz);
|
||||
}
|
||||
|
||||
// verify
|
||||
@ -981,17 +979,17 @@ output_buffer& operator<<(output_buffer& output, const Data& data)
|
||||
void Data::Process(input_buffer& input, SSL& ssl)
|
||||
{
|
||||
int msgSz = ssl.getSecurity().get_parms().encrypt_size_;
|
||||
int pad = 0, padByte = 0;
|
||||
int pad = 0, padSz = 0;
|
||||
int ivExtra = 0;
|
||||
|
||||
if (ssl.getSecurity().get_parms().cipher_type_ == block) {
|
||||
if (ssl.isTLSv1_1()) // IV
|
||||
ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
|
||||
pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1);
|
||||
padByte = 1;
|
||||
padSz = 1;
|
||||
}
|
||||
int digestSz = ssl.getCrypto().get_digest().get_digestSize();
|
||||
int dataSz = msgSz - ivExtra - digestSz - pad - padByte;
|
||||
int dataSz = msgSz - ivExtra - digestSz - pad - padSz;
|
||||
opaque verify[SHA_LEN];
|
||||
|
||||
const byte* rawData = input.get_buffer() + input.get_current();
|
||||
@ -1020,14 +1018,10 @@ void Data::Process(input_buffer& input, SSL& ssl)
|
||||
hmac(ssl, verify, rawData, dataSz, application_data, true);
|
||||
}
|
||||
|
||||
// read mac and fill
|
||||
// read mac and skip fill
|
||||
opaque mac[SHA_LEN];
|
||||
opaque fill;
|
||||
input.read(mac, digestSz);
|
||||
for (int i = 0; i < pad; i++)
|
||||
fill = input[AUTO];
|
||||
if (padByte)
|
||||
fill = input[AUTO];
|
||||
input.set_current(input.get_current() + pad + padSz);
|
||||
|
||||
// verify
|
||||
if (dataSz) {
|
||||
@ -2072,11 +2066,9 @@ void Finished::Process(input_buffer& input, SSL& ssl)
|
||||
if (ssl.isTLSv1_1())
|
||||
ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
|
||||
|
||||
opaque fill;
|
||||
int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
|
||||
HANDSHAKE_HEADER - finishedSz - digestSz;
|
||||
for (int i = 0; i < padSz; i++)
|
||||
fill = input[AUTO];
|
||||
input.set_current(input.get_current() + padSz);
|
||||
|
||||
// verify mac
|
||||
if (memcmp(mac, verifyMAC, digestSz)) {
|
||||
|
@ -16,6 +16,8 @@
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
|
||||
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
|
||||
|
||||
ADD_DEFINITIONS("-DYASSL_THREAD_SAFE")
|
||||
|
||||
SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp src/asn.cpp src/coding.cpp
|
||||
src/des.cpp src/dh.cpp src/dsa.cpp src/file.cpp src/hash.cpp src/integer.cpp src/md2.cpp
|
||||
src/md4.cpp src/md5.cpp src/misc.cpp src/random.cpp src/ripemd.cpp src/rsa.cpp src/sha.cpp
|
||||
|
@ -2,7 +2,7 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
|
||||
noinst_PROGRAMS = benchmark
|
||||
benchmark_SOURCES = benchmark.cpp
|
||||
benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
benchmark_CXXFLAGS = -DYASSL_PURE_C
|
||||
benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
|
||||
EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 };
|
||||
|
||||
Blowfish(CipherDir DIR, Mode MODE)
|
||||
: Mode_BASE(BLOCK_SIZE, DIR, MODE) {}
|
||||
: Mode_BASE(BLOCK_SIZE, DIR, MODE), sbox_(pbox_ + ROUNDS + 2) {}
|
||||
|
||||
#ifdef DO_BLOWFISH_ASM
|
||||
void Process(byte*, const byte*, word32);
|
||||
@ -62,8 +62,8 @@ private:
|
||||
static const word32 p_init_[ROUNDS + 2];
|
||||
static const word32 s_init_[4 * 256];
|
||||
|
||||
word32 pbox_[ROUNDS + 2];
|
||||
word32 sbox_[4 * 256];
|
||||
word32 pbox_[ROUNDS + 2 + 4 * 256];
|
||||
word32* sbox_;
|
||||
|
||||
void crypt_block(const word32 in[2], word32 out[2]) const;
|
||||
void AsmProcess(const byte* in, byte* out) const;
|
||||
|
@ -35,10 +35,7 @@
|
||||
|
||||
// Handler for pure virtual functions
|
||||
namespace __Crun {
|
||||
static void pure_error(void)
|
||||
{
|
||||
assert("Pure virtual method called." == "Aborted");
|
||||
}
|
||||
void pure_error(void);
|
||||
} // namespace __Crun
|
||||
|
||||
#endif // __sun
|
||||
@ -54,16 +51,7 @@ extern "C" {
|
||||
#else
|
||||
#include "kernelc.hpp"
|
||||
#endif
|
||||
|
||||
/* Disallow inline __cxa_pure_virtual() */
|
||||
static int __cxa_pure_virtual() __attribute__((noinline, used));
|
||||
static int __cxa_pure_virtual()
|
||||
{
|
||||
// oops, pure virtual called!
|
||||
assert("Pure virtual method called." == "Aborted");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __cxa_pure_virtual () __attribute__ ((weak));
|
||||
} // extern "C"
|
||||
|
||||
#endif // __GNUC__ > 2
|
||||
|
@ -8,7 +8,8 @@ libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp \
|
||||
random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \
|
||||
tftables.cpp twofish.cpp
|
||||
|
||||
libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C
|
||||
libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \
|
||||
@yassl_thread_cxxflags@
|
||||
|
||||
EXTRA_DIST = $(wildcard ../include/*.hpp)
|
||||
|
||||
|
@ -185,10 +185,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x,
|
||||
|
||||
struct WindowSlider
|
||||
{
|
||||
WindowSlider(const Integer &exp, bool fastNegate,
|
||||
WindowSlider(const Integer &expIn, bool fastNegateIn,
|
||||
unsigned int windowSizeIn=0)
|
||||
: exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn),
|
||||
windowBegin(0), fastNegate(fastNegate), firstTime(true),
|
||||
: exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn),
|
||||
windowBegin(0), fastNegate(fastNegateIn), firstTime(true),
|
||||
finished(false)
|
||||
{
|
||||
if (windowSize == 0)
|
||||
|
@ -185,7 +185,7 @@ void Base64Decoder::Decode()
|
||||
{
|
||||
word32 bytes = coded_.size();
|
||||
word32 plainSz = bytes - ((bytes + (pemLineSz - 1)) / pemLineSz);
|
||||
plainSz = (plainSz * 3 + 3) / 4;
|
||||
plainSz = ((plainSz * 3) / 4) + 3;
|
||||
decoded_.New(plainSz);
|
||||
|
||||
word32 i = 0;
|
||||
|
@ -283,21 +283,23 @@ DWord() {}
|
||||
word GetHighHalfAsBorrow() const {return 0-halfs_.high;}
|
||||
|
||||
private:
|
||||
struct dword_struct
|
||||
{
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
word low;
|
||||
word high;
|
||||
#else
|
||||
word high;
|
||||
word low;
|
||||
#endif
|
||||
};
|
||||
|
||||
union
|
||||
{
|
||||
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
|
||||
dword whole_;
|
||||
#endif
|
||||
struct
|
||||
{
|
||||
#ifdef LITTLE_ENDIAN_ORDER
|
||||
word low;
|
||||
word high;
|
||||
#else
|
||||
word high;
|
||||
word low;
|
||||
#endif
|
||||
} halfs_;
|
||||
struct dword_struct halfs_;
|
||||
};
|
||||
};
|
||||
|
||||
@ -1214,20 +1216,24 @@ public:
|
||||
#define AS1(x) #x ";"
|
||||
#define AS2(x, y) #x ", " #y ";"
|
||||
#define AddPrologue \
|
||||
word res; \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
"push %%ebx;" /* save this manually, in case of -fPIC */ \
|
||||
"mov %2, %%ebx;" \
|
||||
"mov %3, %%ebx;" \
|
||||
".intel_syntax noprefix;" \
|
||||
"push ebp;"
|
||||
#define AddEpilogue \
|
||||
"pop ebp;" \
|
||||
".att_syntax prefix;" \
|
||||
"pop %%ebx;" \
|
||||
: \
|
||||
"mov %%eax, %0;" \
|
||||
: "=g" (res) \
|
||||
: "c" (C), "d" (A), "m" (B), "S" (N) \
|
||||
: "%edi", "memory", "cc" \
|
||||
);
|
||||
); \
|
||||
return res;
|
||||
|
||||
#define MulPrologue \
|
||||
__asm__ __volatile__ \
|
||||
( \
|
||||
|
@ -84,12 +84,23 @@ namespace STL = STL_NAMESPACE;
|
||||
|
||||
}
|
||||
|
||||
#if defined(__ICC) || defined(__INTEL_COMPILER)
|
||||
#ifdef __sun
|
||||
|
||||
// Handler for pure virtual functions
|
||||
namespace __Crun {
|
||||
void pure_error() {
|
||||
assert(!"Aborted: pure virtual method called.");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2)
|
||||
|
||||
extern "C" {
|
||||
|
||||
int __cxa_pure_virtual() {
|
||||
assert("Pure virtual method called." == "Aborted");
|
||||
assert(!"Aborted: pure virtual method called.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -176,7 +187,6 @@ word Crop(word value, unsigned int size)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
bool HaveCpuId()
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
|
@ -2,7 +2,7 @@ INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
|
||||
noinst_PROGRAMS = test
|
||||
test_SOURCES = test.cpp
|
||||
test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
test_CXXFLAGS = -DYASSL_PURE_C
|
||||
test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@
|
||||
EXTRA_DIST = make.bat
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
|
@ -13,7 +13,7 @@
|
||||
To use MemoryTracker merely add this file to your project
|
||||
No need to instantiate anything
|
||||
|
||||
If your app is multi threaded define MULTI_THREADED
|
||||
If your app is multi threaded define YASSL_THREAD_SAFE
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
|
@ -4,7 +4,7 @@ testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \
|
||||
../examples/client/client.cpp ../examples/server/server.cpp \
|
||||
../examples/echoclient/echoclient.cpp \
|
||||
../examples/echoserver/echoserver.cpp
|
||||
testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER
|
||||
testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_thread_cxxflags@
|
||||
testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \
|
||||
$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat
|
||||
|
@ -160,6 +160,11 @@ inline void err_sys(const char* msg)
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
static int PasswordCallBack(char*, int, int, void*);
|
||||
}
|
||||
|
||||
|
||||
static int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
|
||||
{
|
||||
strncpy(passwd, "12345678", sz);
|
||||
|
@ -43,8 +43,9 @@ noinst_HEADERS = config-win.h config-netware.h lf.h my_bit.h \
|
||||
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
|
||||
atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \
|
||||
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \
|
||||
wqueue.h waiting_threads.h
|
||||
EXTRA_DIST = mysql.h.pp mysql/plugin_auth.h.pp mysql/client_plugin.h.pp
|
||||
wqueue.h waiting_threads.h my_compiler.h
|
||||
|
||||
EXTRA_DIST = mysql.h.pp mysql/plugin_auth.h.pp mysql/client_plugin.h.pp
|
||||
|
||||
# Remove built files and the symlinked directories
|
||||
CLEANFILES = $(BUILT_SOURCES) readline openssl
|
||||
@ -71,6 +72,3 @@ my_config.h: config.h
|
||||
# generated by configure from the .h.in files
|
||||
dist-hook:
|
||||
$(RM) -f $(distdir)/mysql_version.h $(distdir)/my_config.h
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -33,10 +33,6 @@
|
||||
/* need by my_vsnprintf */
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef _AIX
|
||||
#undef HAVE_BCMP
|
||||
#endif
|
||||
|
||||
/* This is needed for the definitions of bzero... on solaris */
|
||||
#if defined(HAVE_STRINGS_H)
|
||||
#include <strings.h>
|
||||
@ -114,7 +110,7 @@ extern void bfill(uchar *dst,size_t len,pchar fill);
|
||||
#endif
|
||||
|
||||
#if !defined(bzero) && !defined(HAVE_BZERO)
|
||||
extern void bzero(uchar * dst,size_t len);
|
||||
extern void bzero(void * dst,size_t len);
|
||||
#endif
|
||||
|
||||
#if !defined(bcmp) && !defined(HAVE_BCMP)
|
||||
@ -124,9 +120,6 @@ extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
|
||||
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
|
||||
#undef bcmp
|
||||
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
|
||||
#define bzero_if_valgrind(A,B) bzero(A,B)
|
||||
#else
|
||||
#define bzero_if_valgrind(A,B)
|
||||
#endif /* HAVE_valgrind */
|
||||
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
|
||||
@ -213,7 +206,7 @@ extern char *str2int(const char *src,int radix,long lower,long upper,
|
||||
long *val);
|
||||
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
|
||||
#if SIZEOF_LONG == SIZEOF_LONG_LONG
|
||||
#define longlong2str(A,B,C) int2str((A),(B),(C),1)
|
||||
#define longlong2str(A,B,C,D) int2str((A),(B),(C),(D))
|
||||
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
|
||||
#undef strtoll
|
||||
#define strtoll(A,B,C) strtol((A),(B),(C))
|
||||
@ -226,7 +219,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error);
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_LONG_LONG
|
||||
extern char *longlong2str(longlong val,char *dst,int radix);
|
||||
extern char *longlong2str(longlong val,char *dst,int radix, int upcase);
|
||||
extern char *longlong10_to_str(longlong val,char *dst,int radix);
|
||||
#if (!defined(HAVE_STRTOULL) || defined(NO_STRTOLL_PROTO))
|
||||
extern longlong strtoll(const char *str, char **ptr, int base);
|
||||
|
@ -21,12 +21,9 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef _my_base_h
|
||||
#include <my_base.h>
|
||||
#endif
|
||||
#ifndef _m_ctype_h
|
||||
#include <my_sys.h>
|
||||
#include <m_ctype.h>
|
||||
#endif
|
||||
#include "../storage/maria/ma_pagecache.h"
|
||||
#include "my_handler.h"
|
||||
#include "ft_global.h"
|
||||
@ -286,6 +283,7 @@ extern int (*maria_test_invalid_symlink)(const char *filename);
|
||||
|
||||
extern int maria_init(void);
|
||||
extern void maria_end(void);
|
||||
extern my_bool maria_upgrade(void);
|
||||
extern int maria_close(MARIA_HA *file);
|
||||
extern int maria_delete(MARIA_HA *file, const uchar *buff);
|
||||
extern MARIA_HA *maria_open(const char *name, int mode,
|
||||
@ -334,6 +332,12 @@ extern int maria_begin(MARIA_HA *info);
|
||||
extern void maria_disable_logging(MARIA_HA *info);
|
||||
extern void maria_enable_logging(MARIA_HA *info);
|
||||
|
||||
#define HA_RECOVER_NONE 0 /* No automatic recover */
|
||||
#define HA_RECOVER_DEFAULT 1 /* Automatic recover active */
|
||||
#define HA_RECOVER_BACKUP 2 /* Make a backupfile on recover */
|
||||
#define HA_RECOVER_FORCE 4 /* Recover even if we loose rows */
|
||||
#define HA_RECOVER_QUICK 8 /* Don't check rows in data file */
|
||||
|
||||
/* this is used to pass to mysql_mariachk_table */
|
||||
|
||||
#define MARIA_CHK_REPAIR 1 /* equivalent to mariachk -r */
|
||||
@ -452,7 +456,7 @@ my_bool maria_test_if_sort_rep(MARIA_HA *info, ha_rows rows, ulonglong key_map,
|
||||
|
||||
int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows);
|
||||
void maria_flush_bulk_insert(MARIA_HA *info, uint inx);
|
||||
void maria_end_bulk_insert(MARIA_HA *info, my_bool table_will_be_deleted);
|
||||
void maria_end_bulk_insert(MARIA_HA *info);
|
||||
int maria_assign_to_pagecache(MARIA_HA *info, ulonglong key_map,
|
||||
PAGECACHE *key_cache);
|
||||
void maria_change_pagecache(PAGECACHE *old_key_cache,
|
||||
|
@ -36,14 +36,14 @@ extern ulong my_time_to_wait_for_lock;
|
||||
#define ALARM_END VOID(signal(SIGALRM,alarm_signal)); \
|
||||
VOID(alarm(alarm_old));
|
||||
#define ALARM_TEST my_have_got_alarm
|
||||
#ifdef DONT_REMEMBER_SIGNAL
|
||||
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
|
||||
#define ALARM_REINIT VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \
|
||||
VOID(signal(SIGALRM,my_set_alarm_variable));\
|
||||
my_have_got_alarm=0;
|
||||
#else
|
||||
#define ALARM_REINIT VOID(alarm((uint) MY_HOW_OFTEN_TO_ALARM)); \
|
||||
my_have_got_alarm=0;
|
||||
#endif /* DONT_REMEMBER_SIGNAL */
|
||||
#endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */
|
||||
#else
|
||||
#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
|
||||
#define ALARM_INIT
|
||||
|
@ -272,17 +272,6 @@ enum ha_base_keytype {
|
||||
#define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */
|
||||
#define HA_USES_BLOCK_SIZE ((uint) 32768)
|
||||
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
|
||||
#if MYSQL_VERSION_ID < 0x50200
|
||||
/*
|
||||
Key has a part that can have end space. If this is an unique key
|
||||
we have to handle it differently from other unique keys as we can find
|
||||
many matching rows for one key (because end space are not compared)
|
||||
*/
|
||||
#define HA_END_SPACE_KEY 0 /* was: 4096 */
|
||||
#else
|
||||
#error HA_END_SPACE_KEY is obsolete, please remove it
|
||||
#endif
|
||||
|
||||
|
||||
/* These flags can be added to key-seg-flag */
|
||||
|
||||
|
@ -25,8 +25,6 @@ typedef uint32 my_bitmap_map;
|
||||
typedef struct st_bitmap
|
||||
{
|
||||
my_bitmap_map *bitmap;
|
||||
uint n_bits; /* number of bits occupied by the above */
|
||||
my_bitmap_map last_word_mask;
|
||||
my_bitmap_map *last_word_ptr;
|
||||
/*
|
||||
mutex will be acquired for the duration of each bitmap operation if
|
||||
@ -36,6 +34,8 @@ typedef struct st_bitmap
|
||||
#ifdef THREAD
|
||||
pthread_mutex_t *mutex;
|
||||
#endif
|
||||
my_bitmap_map last_word_mask;
|
||||
uint32 n_bits; /* number of bits occupied by the above */
|
||||
} MY_BITMAP;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -53,6 +53,8 @@ extern my_bool bitmap_is_overlapping(const MY_BITMAP *map1,
|
||||
extern my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit);
|
||||
extern my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit);
|
||||
extern my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit);
|
||||
extern my_bool bitmap_union_is_set_all(const MY_BITMAP *map1,
|
||||
const MY_BITMAP *map2);
|
||||
extern uint bitmap_set_next(MY_BITMAP *map);
|
||||
extern uint bitmap_get_first(const MY_BITMAP *map);
|
||||
extern uint bitmap_get_first_set(const MY_BITMAP *map);
|
||||
@ -159,22 +161,6 @@ static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
|
||||
#define bitmap_set_all(MAP) \
|
||||
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
|
||||
|
||||
/**
|
||||
check, set and clear a bit of interest of an integer.
|
||||
|
||||
If the bit is out of range @retval -1. Otherwise
|
||||
bit_is_set @return 0 or 1 reflecting the bit is set or not;
|
||||
bit_do_set @return 1 (bit is set 1)
|
||||
bit_do_clear @return 0 (bit is cleared to 0)
|
||||
*/
|
||||
|
||||
#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
(((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
|
||||
#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
((I) |= (ULL(1) << (B)), 1) : -1)
|
||||
#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
|
||||
((I) &= ~(ULL(1) << (B)), 0) : -1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
129
include/my_compiler.h
Normal file
129
include/my_compiler.h
Normal file
@ -0,0 +1,129 @@
|
||||
#ifndef MY_COMPILER_INCLUDED
|
||||
#define MY_COMPILER_INCLUDED
|
||||
|
||||
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
||||
|
||||
/**
|
||||
Header for compiler-dependent features.
|
||||
|
||||
Intended to contain a set of reusable wrappers for preprocessor
|
||||
macros, attributes, pragmas, and any other features that are
|
||||
specific to a target compiler.
|
||||
*/
|
||||
|
||||
#include <my_global.h> /* stddef.h offsetof */
|
||||
|
||||
/**
|
||||
Compiler-dependent internal convenience macros.
|
||||
*/
|
||||
|
||||
/* GNU C/C++ */
|
||||
#if defined __GNUC__
|
||||
/* Any after 2.95... */
|
||||
# define MY_ALIGN_EXT
|
||||
|
||||
/* Microsoft Visual C++ */
|
||||
#elif defined _MSC_VER
|
||||
# define MY_ALIGNOF(type) __alignof(type)
|
||||
# define MY_ALIGNED(n) __declspec(align(n))
|
||||
|
||||
/* Oracle Solaris Studio */
|
||||
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# if __SUNPRO_C >= 0x590
|
||||
# define MY_ALIGN_EXT
|
||||
# endif
|
||||
|
||||
/* IBM XL C/C++ */
|
||||
#elif defined __xlC__
|
||||
# if __xlC__ >= 0x0600
|
||||
# define MY_ALIGN_EXT
|
||||
# endif
|
||||
|
||||
/* HP aCC */
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
# if (__HP_aCC >= 60000) || (__HP_cc >= 60000)
|
||||
# define MY_ALIGN_EXT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef MY_ALIGN_EXT
|
||||
/** Specifies the minimum alignment of a type. */
|
||||
# define MY_ALIGNOF(type) __alignof__(type)
|
||||
/** Determine the alignment requirement of a type. */
|
||||
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
|
||||
#endif
|
||||
|
||||
/**
|
||||
Generic compiler-dependent features.
|
||||
*/
|
||||
#ifndef MY_ALIGNOF
|
||||
# ifdef __cplusplus
|
||||
template<typename type> struct my_alignof_helper { char m1; type m2; };
|
||||
/* Invalid for non-POD types, but most compilers give the right answer. */
|
||||
# define MY_ALIGNOF(type) offsetof(my_alignof_helper<type>, m2)
|
||||
# else
|
||||
# define MY_ALIGNOF(type) offsetof(struct { char m1; type m2; }, m2)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
C++ Type Traits
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/**
|
||||
Opaque storage with a particular alignment.
|
||||
*/
|
||||
# if defined(MY_ALIGNED)
|
||||
/* Partial specialization used due to MSVC++. */
|
||||
template<size_t alignment> struct my_alignment_imp;
|
||||
template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
|
||||
template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
|
||||
template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
|
||||
template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
|
||||
template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
|
||||
/* ... expand as necessary. */
|
||||
# else
|
||||
template<size_t alignment>
|
||||
struct my_alignment_imp { double m1; };
|
||||
# endif
|
||||
|
||||
/**
|
||||
A POD type with a given size and alignment.
|
||||
|
||||
@remark If the compiler does not support a alignment attribute
|
||||
(MY_ALIGN macro), the default alignment of a double is
|
||||
used instead.
|
||||
|
||||
@tparam size The minimum size.
|
||||
@tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
|
||||
*/
|
||||
template <size_t size, size_t alignment>
|
||||
struct my_aligned_storage
|
||||
{
|
||||
union
|
||||
{
|
||||
char data[size];
|
||||
my_alignment_imp<alignment> align;
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <my_attribute.h>
|
||||
|
||||
#endif /* MY_COMPILER_INCLUDED */
|
@ -45,10 +45,10 @@ struct my_option
|
||||
const char *name; /* Name of the option */
|
||||
int id; /* unique id or short option */
|
||||
const char *comment; /* option comment, for autom. --help */
|
||||
uchar **value; /* The variable value */
|
||||
uchar **u_max_value; /* The user def. max variable value */
|
||||
void *value; /* The variable value */
|
||||
void *u_max_value; /* The user def. max variable value */
|
||||
struct st_typelib *typelib; /* Pointer to possible values */
|
||||
ulong var_type;
|
||||
ulong var_type; /* Must match the variable type */
|
||||
enum get_opt_arg_type arg_type;
|
||||
longlong def_value; /* Default value */
|
||||
longlong min_value; /* Min allowed value */
|
||||
@ -58,8 +58,16 @@ struct my_option
|
||||
void *app_type; /* To be used by an application */
|
||||
};
|
||||
|
||||
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
|
||||
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
|
||||
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
|
||||
typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...);
|
||||
/**
|
||||
Used to retrieve a reference to the object (variable) that holds the value
|
||||
for the given option. For example, if var_type is GET_UINT, the function
|
||||
must return a pointer to a variable of type uint. A argument is stored in
|
||||
the location pointed to by the returned pointer.
|
||||
*/
|
||||
typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *,
|
||||
int *);
|
||||
|
||||
extern char *disabled_my_option;
|
||||
extern my_bool my_getopt_print_errors;
|
||||
@ -71,8 +79,7 @@ extern int handle_options (int *argc, char ***argv,
|
||||
extern void my_cleanup_options(const struct my_option *options);
|
||||
extern void my_print_help(const struct my_option *options);
|
||||
extern void my_print_variables(const struct my_option *options);
|
||||
extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
|
||||
const struct my_option *, int *));
|
||||
extern void my_getopt_register_get_addr(my_getopt_value);
|
||||
|
||||
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
|
||||
my_bool *fix);
|
||||
|
@ -55,6 +55,10 @@
|
||||
#define USE_PRAGMA_INTERFACE
|
||||
#endif
|
||||
|
||||
#if defined(__OpenBSD__) && (OpenBSD >= 200411)
|
||||
#define HAVE_ERRNO_AS_DEFINE
|
||||
#endif
|
||||
|
||||
#if defined(i386) && !defined(__i386__)
|
||||
#define __i386__
|
||||
#endif
|
||||
@ -90,6 +94,9 @@
|
||||
#define IF_WIN(A,B) (B)
|
||||
#endif
|
||||
|
||||
/* Make it easier to print null strings */
|
||||
#define val_or_null(A) ((A) ? (const char*) (A) : "(null)")
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
#ifdef WITH_NDB_BINLOG
|
||||
#define HAVE_NDB_BINLOG 1
|
||||
@ -545,8 +552,8 @@ extern "C" int madvise(void *addr, size_t len, int behav);
|
||||
#endif
|
||||
|
||||
/* Does the system remember a signal handler after a signal ? */
|
||||
#ifndef HAVE_BSD_SIGNALS
|
||||
#define DONT_REMEMBER_SIGNAL
|
||||
#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
|
||||
#define SIGNAL_HANDLER_RESET_ON_DELIVERY
|
||||
#endif
|
||||
|
||||
/* Define void to stop lint from generating "null effekt" comments */
|
||||
@ -560,20 +567,19 @@ int __void__;
|
||||
#endif
|
||||
#endif /* DONT_DEFINE_VOID */
|
||||
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
|
||||
#define LINT_INIT(var) var=0 /* No uninitialize-warning */
|
||||
/*
|
||||
Deprecated workaround for false-positive uninitialized variables
|
||||
warnings. Those should be silenced using tool-specific heuristics.
|
||||
|
||||
Enabled by default for g++ due to the bug referenced below.
|
||||
*/
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
|
||||
(defined(__GNUC__) && defined(__cplusplus))
|
||||
#define LINT_INIT(var) var= 0
|
||||
#else
|
||||
#define LINT_INIT(var)
|
||||
#endif
|
||||
|
||||
#include <my_valgrind.h>
|
||||
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_valgrind)
|
||||
#define VALGRIND_OR_LINT_INIT(var) var=0
|
||||
#else
|
||||
#define VALGRIND_OR_LINT_INIT(var)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define SO_EXT ".dll"
|
||||
#elif defined(__APPLE__)
|
||||
@ -582,19 +588,22 @@ int __void__;
|
||||
#define SO_EXT ".so"
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
Suppress uninitialized variable warning without generating code.
|
||||
|
||||
The _cplusplus is a temporary workaround for C++ code pending a fix
|
||||
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
|
||||
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
|
||||
*/
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) || \
|
||||
!defined(__GNUC__)
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
|
||||
defined(__cplusplus) || !defined(__GNUC__)
|
||||
#define UNINIT_VAR(x) x= 0
|
||||
#else
|
||||
/* GCC specific self-initialization which inhibits the warning. */
|
||||
#define UNINIT_VAR(x) x= x
|
||||
#endif
|
||||
|
||||
#include <my_valgrind.h>
|
||||
|
||||
/* Define some useful general macros */
|
||||
#if !defined(max)
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
@ -610,12 +619,12 @@ typedef unsigned short ushort;
|
||||
|
||||
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
|
||||
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
|
||||
#define swap_variables(t, a, b) { t swap_dummy; swap_dummy= a; a= b; b= swap_dummy; }
|
||||
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
|
||||
#define test(a) ((a) ? 1 : 0)
|
||||
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
|
||||
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
|
||||
#define test_all_bits(a,b) (((a) & (b)) == (b))
|
||||
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
|
||||
#define test_all_bits(a,b) (((a) & (b)) == (b))
|
||||
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
|
||||
|
||||
/* Define some general constants */
|
||||
@ -636,7 +645,7 @@ typedef unsigned short ushort;
|
||||
#define my_const_cast(A) (A)
|
||||
#endif
|
||||
|
||||
#include <my_attribute.h>
|
||||
#include <my_compiler.h>
|
||||
|
||||
/*
|
||||
Wen using the embedded library, users might run into link problems,
|
||||
@ -672,7 +681,7 @@ C_MODE_END
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef char my_bool; /* Small bool */
|
||||
typedef char my_bool; /* Small bool; Needed by my_dbug.h */
|
||||
#include <my_dbug.h>
|
||||
|
||||
#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
|
||||
@ -800,10 +809,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
|
||||
#endif
|
||||
/* get memory in huncs */
|
||||
#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD)
|
||||
/* Typical record cash */
|
||||
#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD)
|
||||
/* Typical key cash */
|
||||
#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD)
|
||||
/* Typical record cache */
|
||||
#define RECORD_CACHE_SIZE (uint) (128*1024-MALLOC_OVERHEAD)
|
||||
/* Typical key cache */
|
||||
#define KEY_CACHE_SIZE (uint) (128L*1024L*1024L-MALLOC_OVERHEAD)
|
||||
/* Default size of a key cache block */
|
||||
#define KEY_CACHE_BLOCK_SIZE (uint) 1024
|
||||
|
||||
@ -951,13 +960,11 @@ typedef long long my_ptrdiff_t;
|
||||
#define ALIGN_MAX_UNIT (sizeof(double))
|
||||
/* Size to make adressable obj. */
|
||||
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A), sizeof(double)))
|
||||
/* Offset of field f in structure t */
|
||||
#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
|
||||
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
|
||||
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
|
||||
|
||||
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
|
||||
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
|
||||
|
||||
/*
|
||||
Custom version of standard offsetof() macro which can be used to get
|
||||
offsets of members in class for non-POD types (according to the current
|
||||
|
@ -128,7 +128,9 @@ struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
|
||||
|
||||
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
|
||||
|
||||
#define ETIMEDOUT 145 /* Win32 doesn't have this */
|
||||
#ifndef ETIMEDOUT
|
||||
#define ETIMEDOUT 145
|
||||
#endif
|
||||
#define getpid() GetCurrentThreadId()
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
#define _REENTRANT 1
|
||||
@ -274,13 +276,14 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
|
||||
we want to make sure that no such flags are set.
|
||||
*/
|
||||
#if defined(HAVE_SIGACTION) && !defined(my_sigset)
|
||||
#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \
|
||||
#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; \
|
||||
IF_DBUG(int l_rc); \
|
||||
DBUG_ASSERT((A) != 0); \
|
||||
sigemptyset(&l_set); \
|
||||
l_s.sa_handler = (B); \
|
||||
l_s.sa_mask = l_set; \
|
||||
l_s.sa_flags = 0; \
|
||||
l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\
|
||||
IF_DBUG(l_rc=) sigaction((A), &l_s, NULL); \
|
||||
DBUG_ASSERT(l_rc == 0); \
|
||||
} while (0)
|
||||
#elif defined(HAVE_SIGSET) && !defined(my_sigset)
|
||||
@ -755,7 +758,7 @@ extern uint thd_lib_detected;
|
||||
The implementation is guaranteed to be thread safe, on all platforms.
|
||||
Note that the calling code should *not* assume the counter is protected
|
||||
by the mutex given, as the implementation of these helpers may change
|
||||
to use my_atomic operations instead.
|
||||
to use atomic operations instead.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -37,7 +37,7 @@ extern int NEAR my_errno; /* Last error in mysys */
|
||||
|
||||
#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
|
||||
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
|
||||
#define MY_INIT(name); { my_progname= name; my_init(); }
|
||||
#define MY_INIT(name) { my_progname= name; my_init(); }
|
||||
|
||||
#define MY_FILE_ERROR ((size_t) -1)
|
||||
|
||||
@ -270,6 +270,7 @@ extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
|
||||
extern ulong my_default_record_cache_size;
|
||||
extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io,
|
||||
NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks;
|
||||
extern my_bool my_disable_sync;
|
||||
extern char wild_many,wild_one,wild_prefix;
|
||||
extern const char *charsets_dir;
|
||||
/* from default.c */
|
||||
|
@ -24,15 +24,19 @@
|
||||
|
||||
#if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H)
|
||||
#include <valgrind/memcheck.h>
|
||||
#else
|
||||
#define VALGRIND_MAKE_MEM_DEFINED(addr, size) do { } while(0)
|
||||
#define VALGRIND_MAKE_MEM_NOACCESS(addr, size) do { } while(0)
|
||||
#ifdef SAFEMALLOC
|
||||
#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) bfill(addr, size, 0x8F)
|
||||
#else
|
||||
#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) do { } while(0)
|
||||
#endif /* SAFEMALLOC */
|
||||
#endif /* HAVE_valgrind */
|
||||
#define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
|
||||
#define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
|
||||
#define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
|
||||
#define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
|
||||
#else /* HAVE_VALGRIND */
|
||||
# define MEM_UNDEFINED(a,len) ((void) 0)
|
||||
# define MEM_NOACCESS(a,len) ((void) 0)
|
||||
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
|
||||
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
|
||||
#endif /* HAVE_VALGRIND */
|
||||
|
||||
/* Compatibility with old source */
|
||||
#define TRASH(A,B) VALGRIND_MAKE_MEM_UNDEFINED(A, B)
|
||||
#ifdef SAFEMALLOC
|
||||
#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0)
|
||||
#else
|
||||
#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0)
|
||||
#endif
|
||||
|
@ -48,8 +48,6 @@ extern "C" {
|
||||
|
||||
#define MI_NAME_IEXT ".MYI"
|
||||
#define MI_NAME_DEXT ".MYD"
|
||||
/* Max extra space to use when sorting keys */
|
||||
#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
|
||||
|
||||
/* Possible values for myisam_block_size (must be power of 2) */
|
||||
#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */
|
||||
|
@ -44,7 +44,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _global_h /* If not standard header */
|
||||
#ifndef MYSQL_ABI_CHECK
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef __LCC__
|
||||
#include <winsock2.h> /* For windows */
|
||||
#endif
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <sys/types.h>
|
||||
typedef char my_bool;
|
||||
typedef int my_socket;
|
||||
#include "mysql_version.h"
|
||||
|
@ -23,8 +23,10 @@
|
||||
*/
|
||||
#define MYSQL_CLIENT_PLUGIN_INCLUDED
|
||||
|
||||
#ifndef MYSQL_ABI_CHECK
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* known plugin types */
|
||||
#define MYSQL_CLIENT_reserved1 0
|
||||
|
@ -1,5 +1,3 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
struct st_mysql_client_plugin
|
||||
{
|
||||
int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; int (*init)(char *, size_t, int, va_list); int (*deinit)();
|
||||
|
@ -257,7 +257,7 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd,
|
||||
#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \
|
||||
MYSQL_PLUGIN_VAR_HEADER; \
|
||||
type *value; \
|
||||
const type def_val; \
|
||||
const type def_val; \
|
||||
} MYSQL_SYSVAR_NAME(name)
|
||||
|
||||
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
|
||||
@ -294,7 +294,7 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd,
|
||||
#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \
|
||||
MYSQL_PLUGIN_VAR_HEADER; \
|
||||
int offset; \
|
||||
type def_val; \
|
||||
const type def_val; \
|
||||
DECLARE_THDVAR_FUNC(type); \
|
||||
TYPELIB *typelib; \
|
||||
} MYSQL_SYSVAR_NAME(name)
|
||||
@ -455,7 +455,7 @@ struct st_maria_plugin
|
||||
struct st_mysql_show_var *status_vars;
|
||||
struct st_mysql_sys_var **system_vars;
|
||||
const char *version_info; /* plugin version string */
|
||||
int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
|
||||
unsigned int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
|
||||
};
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -1,8 +1,6 @@
|
||||
#include <mysql/plugin.h>
|
||||
#include <mysql/services.h>
|
||||
#include <mysql/service_my_snprintf.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
extern struct my_snprintf_service_st {
|
||||
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
|
||||
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
|
||||
@ -10,7 +8,6 @@ extern struct my_snprintf_service_st {
|
||||
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
|
||||
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
|
||||
#include <mysql/service_thd_alloc.h>
|
||||
#include <stdlib.h>
|
||||
struct st_mysql_lex_string
|
||||
{
|
||||
char *str;
|
||||
@ -91,7 +88,7 @@ struct st_maria_plugin
|
||||
struct st_mysql_show_var *status_vars;
|
||||
struct st_mysql_sys_var **system_vars;
|
||||
const char *version_info;
|
||||
int maturity;
|
||||
unsigned int maturity;
|
||||
};
|
||||
enum enum_ftparser_mode
|
||||
{
|
||||
|
@ -70,8 +70,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MYSQL_ABI_CHECK
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
extern struct my_snprintf_service_st {
|
||||
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
|
||||
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
|
||||
|
@ -27,7 +27,9 @@
|
||||
allocations - they are better served with my_malloc.
|
||||
*/
|
||||
|
||||
#ifndef MYSQL_ABI_CHECK
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -27,6 +27,10 @@
|
||||
#define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN)
|
||||
#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN)
|
||||
|
||||
#define MYSQL50_TABLE_NAME_PREFIX "#mysql50#"
|
||||
#define MYSQL50_TABLE_NAME_PREFIX_LENGTH (sizeof(MYSQL50_TABLE_NAME_PREFIX)-1)
|
||||
#define SAFE_NAME_LEN (NAME_LEN + MYSQL50_TABLE_NAME_PREFIX_LENGTH)
|
||||
|
||||
#define SERVER_VERSION_LENGTH 60
|
||||
#define SQLSTATE_LENGTH 5
|
||||
#define LIST_PROCESS_HOST_LEN 64
|
||||
|
@ -62,10 +62,12 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
|
||||
#define EE_UNKNOWN_COLLATION 28
|
||||
#define EE_FILENOTFOUND 29
|
||||
#define EE_FILE_NOT_CLOSED 30
|
||||
#define EE_CANT_CHMOD 31
|
||||
#define EE_CANT_SEEK 32
|
||||
#define EE_CANT_COPY_OWNERSHIP 33
|
||||
#define EE_ERROR_LAST 33 /* Copy last error nr */
|
||||
#define EE_CHANGE_OWNERSHIP 31
|
||||
#define EE_CHANGE_PERMISSIONS 32
|
||||
#define EE_CANT_CHMOD 33
|
||||
#define EE_CANT_SEEK 34
|
||||
#define EE_CANT_COPY_OWNERSHIP 35
|
||||
#define EE_ERROR_LAST 35 /* Copy last error nr */
|
||||
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
|
||||
|
||||
/* exit codes for all MySQL programs */
|
||||
|
@ -16,30 +16,31 @@
|
||||
#ifdef HAVE_OPENSSL
|
||||
|
||||
{"ssl", OPT_SSL_SSL,
|
||||
"Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl.",
|
||||
(uchar **) &opt_use_ssl, (uchar **) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
"Enable SSL for connection (automatically enabled with other flags)."
|
||||
"Disable with --skip-ssl.", &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL,
|
||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"ssl-ca", OPT_SSL_CA,
|
||||
"CA file in PEM format (check OpenSSL docs, implies --ssl).",
|
||||
(uchar **) &opt_ssl_ca, (uchar **) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
|
||||
&opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"ssl-capath", OPT_SSL_CAPATH,
|
||||
"CA directory (check OpenSSL docs, implies --ssl).",
|
||||
(uchar **) &opt_ssl_capath, (uchar **) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
|
||||
&opt_ssl_capath, &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl).",
|
||||
(uchar **) &opt_ssl_cert, (uchar **) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
|
||||
&opt_ssl_cert, &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"ssl-cipher", OPT_SSL_CIPHER, "SSL cipher to use (implies --ssl).",
|
||||
(uchar **) &opt_ssl_cipher, (uchar **) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
|
||||
&opt_ssl_cipher, &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl).",
|
||||
(uchar **) &opt_ssl_key, (uchar **) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
|
||||
&opt_ssl_key, &opt_ssl_key, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#ifdef MYSQL_CLIENT
|
||||
{"ssl-verify-server-cert", OPT_SSL_VERIFY_SERVER_CERT,
|
||||
"Verify server's \"Common Name\" in its cert against hostname used when connecting. This option is disabled by default.",
|
||||
(uchar **) &opt_ssl_verify_server_cert, (uchar **) &opt_ssl_verify_server_cert,
|
||||
"Verify server's \"Common Name\" in its cert against hostname used "
|
||||
"when connecting. This option is disabled by default.",
|
||||
&opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
#endif /* HAVE_OPENSSL */
|
||||
|
@ -130,3 +130,11 @@ ADD_DEFINITIONS(-DHAVE_DLOPEN)
|
||||
IF(EMBED_MANIFESTS)
|
||||
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
|
||||
ENDIF(EMBED_MANIFESTS)
|
||||
|
||||
# TODO: Install mysqlclient_notls?
|
||||
# TODO: Which component should these be part of, development?
|
||||
INSTALL(TARGETS mysqlclient DESTINATION lib/opt COMPONENT runtime)
|
||||
INSTALL(TARGETS libmysql DESTINATION lib/opt COMPONENT runtime)
|
||||
|
||||
# Also install libmysql.dll to the bin dir
|
||||
INSTALL(TARGETS libmysql DESTINATION bin COMPONENT runtime)
|
||||
|
@ -111,6 +111,3 @@ do-lib-dist:
|
||||
echo ' $$(AR) r $$@ $$?' >>$$dir/Makefile; \
|
||||
gtar cvzf $$dir.tar.gz $$dir; \
|
||||
cd $$dir; gmake
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@ -332,7 +332,7 @@ sig_handler
|
||||
my_pipe_sig_handler(int sig __attribute__((unused)))
|
||||
{
|
||||
DBUG_PRINT("info",("Hit by signal %d",sig));
|
||||
#ifdef DONT_REMEMBER_SIGNAL
|
||||
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
|
||||
(void) signal(SIGPIPE, my_pipe_sig_handler);
|
||||
#endif
|
||||
}
|
||||
@ -2447,7 +2447,12 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
|
||||
stmt->insert_id= mysql->insert_id;
|
||||
if (res)
|
||||
{
|
||||
set_stmt_errmsg(stmt, net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, net);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
@ -2658,7 +2663,12 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
|
||||
buff, sizeof(buff), (uchar*) 0, 0,
|
||||
1, stmt))
|
||||
{
|
||||
set_stmt_errmsg(stmt, net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, net);
|
||||
return 1;
|
||||
}
|
||||
if ((*mysql->methods->read_rows_from_cursor)(stmt))
|
||||
@ -3339,7 +3349,12 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
buff, sizeof(buff), (uchar*) data,
|
||||
length, 1, stmt))
|
||||
{
|
||||
set_stmt_errmsg(stmt, &mysql->net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, &mysql->net);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
@ -4358,6 +4373,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
|
||||
case MYSQL_TYPE_TIME:
|
||||
field->max_length= 15; /* 19:23:48.123456 */
|
||||
param->skip_result= skip_result_with_length;
|
||||
break;
|
||||
case MYSQL_TYPE_DATE:
|
||||
field->max_length= 10; /* 2003-11-11 */
|
||||
param->skip_result= skip_result_with_length;
|
||||
@ -4774,7 +4790,12 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
||||
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
|
||||
(uchar*) 0, 0, 1, stmt))
|
||||
{
|
||||
set_stmt_errmsg(stmt, net);
|
||||
/*
|
||||
Don't set stmt error if stmt->mysql is NULL, as the error in this case
|
||||
has already been set by mysql_prune_stmt_list().
|
||||
*/
|
||||
if (stmt->mysql)
|
||||
set_stmt_errmsg(stmt, net);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,3 @@ link_sources:
|
||||
done; \
|
||||
done
|
||||
echo timestamp > link_sources
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user