mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
merge with 5.3
sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
This commit is contained in:
commit
76f0b94bb0
1705 changed files with 166414 additions and 39720 deletions
29
.bzrignore
29
.bzrignore
|
@ -117,6 +117,7 @@ client/rpl_tblmap.cc
|
|||
client/rpl_tblmap.h
|
||||
client/rpl_utility.cc
|
||||
client/rpl_utility.h
|
||||
client/rpl_utility.cc
|
||||
client/select_test
|
||||
client/sql_const.h
|
||||
client/sql_list.cc
|
||||
|
@ -456,6 +457,11 @@ libmysqld/transaction.cc
|
|||
libmysqld/tztime.cc
|
||||
libmysqld/uniques.cc
|
||||
libmysqld/unireg.cc
|
||||
libmysqld/discover_xt.cc
|
||||
libmysqld/ha_pbxt.cc
|
||||
libmysqld/myxt_xt.cc
|
||||
libmysqld/rpl_reporting.cc
|
||||
libmysqld/rpl_utility.cc
|
||||
libmysqltest/*.ds?
|
||||
libmysqltest/mytest.c
|
||||
libtool
|
||||
|
@ -1100,3 +1106,26 @@ Testing
|
|||
info_macros.cmake
|
||||
VERSION.dep
|
||||
configure
|
||||
libmysqld/examples/mysqltest.cc
|
||||
extra/libevent/event-config.h
|
||||
libmysqld/opt_table_elimination.cc
|
||||
libmysqld/ha_federatedx.cc
|
||||
libmysqld/multi_range_read.cc
|
||||
libmysqld/opt_index_cond_pushdown.cc
|
||||
libmysqld/opt_subselect.cc
|
||||
libmysqld/sql_join_cache.cc
|
||||
client/rpl_filter.cc
|
||||
client/rpl_filter.h
|
||||
client/sql_list.cc
|
||||
client/sql_list.h
|
||||
libmysqld/create_options.cc
|
||||
storage/pbxt/bin/xtstat
|
||||
libmysqld/sql_expression_cache.cc
|
||||
mysql-test/mtr_command
|
||||
scripts/convert-debug-for-diff
|
||||
plugin/handler_socket/client/hsclient
|
||||
client/strings_def.h
|
||||
libmysql/strings_def.h
|
||||
libmysql_r/strings_def.h
|
||||
storage/maria/aria_log_control
|
||||
scripts/mytop
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
# MA 02111-1307, USA
|
||||
|
||||
########################################################################
|
||||
|
||||
get_key_value()
|
||||
|
@ -130,7 +129,7 @@ elif [ "x$warning_mode" = "xmaintainer" ]; then
|
|||
debug_extra_cflags="-g3"
|
||||
else
|
||||
# Both C and C++ warnings
|
||||
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
|
||||
warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized"
|
||||
|
||||
# For more warnings, uncomment the following line
|
||||
# warnings="$warnings -Wshadow"
|
||||
|
@ -149,13 +148,14 @@ fi
|
|||
# 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="-UFORCE_INIT_OF_VARS -DHAVE_purify -DHAVE_valgrind "
|
||||
valgrind_flags="-DHAVE_valgrind -DHAVE_purify -USAFEMALLOC"
|
||||
valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
|
||||
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 "
|
||||
debug_cflags="$debug_cflags -DSAFE_MUTEX"
|
||||
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
|
||||
debug_cflags="$debug_cflags -DSAFE_MUTEX -DSAFEMALLOC"
|
||||
error_inject="--with-error-inject "
|
||||
#
|
||||
# Base C++ flags for all builds
|
||||
|
@ -171,9 +171,6 @@ then
|
|||
debug_cflags="$debug_cflags $debug_extra_cflags"
|
||||
fi
|
||||
|
||||
|
||||
static_link="--with-mysqld-ldflags=-all-static "
|
||||
static_link="$static_link --with-client-ldflags=-all-static"
|
||||
# we need local-infile in all binaries for rpl000001
|
||||
# if you need to disable local-infile in the client, write a build script
|
||||
# and unset local_infile_configs
|
||||
|
@ -187,8 +184,6 @@ base_configs="$base_configs --with-extra-charsets=complex "
|
|||
base_configs="$base_configs --enable-thread-safe-client "
|
||||
base_configs="$base_configs --with-big-tables $maintainer_mode"
|
||||
base_configs="$base_configs --with-plugin-aria --with-aria-tmp-tables"
|
||||
# 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"
|
||||
|
||||
if test -d "$path/../cmd-line-utils/readline"
|
||||
then
|
||||
|
@ -230,6 +225,24 @@ if test -z "$CXX" ; then
|
|||
CXX=g++
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# Set -Wuninitialized to debug flags for gcc 4.4 and above
|
||||
# because it is allowed there without -O
|
||||
#
|
||||
if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then
|
||||
GCCVERSION=`$CC -v 2>&1 | tail -1 | \
|
||||
sed 's/^[a-zA-Z][a-zA-Z]* [a-zA-Z][a-zA-Z]* //' | sed 's/ .*$//'`
|
||||
GCCV1=`echo $GCCVERSION | sed 's/\..*$//'`
|
||||
GCCV2=`echo $GCCVERSION | sed 's/[0-9][0-9]*\.//'|sed 's/\..*$//'`
|
||||
if test '(' "$GCCV1" -gt '4' ')' -o \
|
||||
'(' '(' "$GCCV1" -eq '4' ')' -a '(' "$GCCV2" -ge '4' ')' ')'
|
||||
then
|
||||
debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# If ccache (a compiler cache which reduces build time)
|
||||
# (http://samba.org/ccache) is installed, use it.
|
||||
# We use 'grep' and hope 'grep' will work as expected
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2008, 2010, Oracle.
|
||||
# Copyright (c) 2009-2011 Monty Program Ab
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
|
@ -30,23 +31,18 @@ get_key_value()
|
|||
developer_usage()
|
||||
{
|
||||
cat <<EOF
|
||||
This script can be used by developers of MariaDB wanting to try out
|
||||
early versions before binary versions are available, anyone needing
|
||||
a version with a special patch included that needs to be built from
|
||||
source code, or anyone else wanting to exercise full control over
|
||||
the build process.
|
||||
|
||||
This script can be used by developers of MySQL, early adopters wanting
|
||||
to try out early versions of MySQL before binary versions are
|
||||
available, anyone needing a version with a special patch included that
|
||||
needs to be built from source code, or anyone else wanting to exercise
|
||||
full control over the MySQL build process.
|
||||
|
||||
This help text is targeted towards those that want to debug and test
|
||||
MySQL using source code releases. If you have downloaded a source code
|
||||
release and simply want to build a usable binary, you should read the
|
||||
This help text is targeted towards those that want to debug and test
|
||||
source code releases. If you have downloaded a source code release
|
||||
and simply want to build a usable binary, you should read the
|
||||
--sysadmin-help instead.
|
||||
|
||||
The script is also designed to be used by anyone receiving a source
|
||||
code release of MySQL Cluster Carrier Grade Edition. The default
|
||||
behaviour is to build the standard MySQL Cluster Carrier Grade Edition
|
||||
package. Three environment variables can be used to change the
|
||||
default behaviour:
|
||||
Three environment variables can be used to define the default behaviour:
|
||||
|
||||
MYSQL_DEVELOPER
|
||||
Defining this variable is similar to setting the --developer flag
|
||||
|
@ -57,9 +53,6 @@ cat <<EOF
|
|||
Defining this variable sets the --with-debug flag
|
||||
|
||||
Options used with this script always override any default behaviour.
|
||||
The default package is MySQL Cluster Carrier Grade (standard) Edition.
|
||||
For developers, the default package is MySQL Cluster Carrier Grade
|
||||
Extended Edition.
|
||||
|
||||
More information for developers can be found in --help,
|
||||
--sysadmin-help, and --extended-help.
|
||||
|
@ -77,17 +70,12 @@ sysadmin_usage()
|
|||
{
|
||||
cat <<EOF
|
||||
|
||||
This script can be used to build MySQL Cluster Carrier Grade Edition
|
||||
based on a source code release you received from MySQL. It can also
|
||||
be used to build many variants other variants of MySQL, in particular
|
||||
various performance-optimised versions of MySQL.
|
||||
|
||||
It is assumed that you are building on a computer which is of the
|
||||
same type as that on which you intend to run MySQL/MySQL Cluster.
|
||||
same type as that on which you intend to run the program.
|
||||
|
||||
The simplest possible way to run this script is to allow it to use the
|
||||
built-in defaults everywhere, invoking it simply as (from top-level
|
||||
MySQL directory):
|
||||
MariaDB source directory):
|
||||
|
||||
shell> BUILD/build_mccge.sh
|
||||
|
||||
|
@ -99,21 +87,15 @@ cat <<EOF
|
|||
with GCC, and x86 + SPARC for Solaris using the Forte compiler and
|
||||
finally x86 on Linux using the Intel compiler.
|
||||
3) Invokes the GCC compiler.
|
||||
4) Builds a set of MySQL/MySQL Cluster binaries; for
|
||||
more information about these, see --extended-help.
|
||||
4) Builds a set of of binaries ; for more information about these,
|
||||
see --extended-help.
|
||||
5) Default compiler is always gcc.
|
||||
|
||||
The default version assumes that you have a source code tarball from
|
||||
which you are building, and thus autoconf and automake do not need to
|
||||
be run. If you have downloaded a BitKeeper tree then you should read
|
||||
be run. If you have downloaded a launchpad tree then you should read
|
||||
--developer-help.
|
||||
|
||||
If you are building MySQL/MySQL Cluster for commercial
|
||||
use then you need to set the --commercial flag to ensure that the
|
||||
commercial libraries are compiled in, rather than the GPL-only
|
||||
libraries. The default is to build a GPL version of MySQL Cluster
|
||||
Carrier Grade Edition.
|
||||
|
||||
If your building on a Solaris SPARC machine and you want to compile
|
||||
using SunStudio you must set
|
||||
--compiler=forte; if you want to build using the Intel compiler on
|
||||
|
@ -133,20 +115,16 @@ cat <<EOF
|
|||
want the binaries installed.
|
||||
|
||||
Using a data directory other than the default (PREFIX/data) can be
|
||||
done when starting the MySQL Server, or by invoking this script with
|
||||
done when starting the server, or by invoking this script with
|
||||
the --datadir option.
|
||||
|
||||
If you want your binaries stripped of surplus debug or other
|
||||
information, use the --strip option.
|
||||
|
||||
If you want debug information in the binary (for example, to be
|
||||
able to send gdb core dumps to MySQL Support), then you should add the
|
||||
able to send gdb core dumps to support), then you should add the
|
||||
flag --with-debug; if you want a production build with only debugging
|
||||
information in the binary then use --debug.
|
||||
|
||||
If your aim is not to build MySQL Cluster Carrier Grade Edition, you
|
||||
can also use this script to build MySQL Classic and MySQL Enterprise Pro
|
||||
versions; see the --extended-help for descriptions of these packages.
|
||||
EOF
|
||||
}
|
||||
|
||||
|
@ -157,9 +135,8 @@ cat <<EOF
|
|||
Usage: $0 [options]
|
||||
--help Show this help message.
|
||||
--sysadmin-help Show help for system administrators wishing
|
||||
to build MySQL Cluster Carrier Grade Edition
|
||||
or other MySQL versions.
|
||||
--developer-help Show help for developers trying to build MySQL
|
||||
to build MariaDB
|
||||
--developer-help Show help for developers trying to build MariaDB
|
||||
--with-help Show extended help on --with-xxx options to
|
||||
configure
|
||||
--extended-help Show extended help message
|
||||
|
@ -199,11 +176,9 @@ Usage: $0 [options]
|
|||
'path'
|
||||
--debug Build normal version, but add debug
|
||||
information to binary
|
||||
--developer Use extensions that most MySQL developers use
|
||||
--developer Use extensions that most MariaDB developers use
|
||||
--no-developer Do not use extensions that most developers of
|
||||
MySQL use
|
||||
--commercial Use commercial libraries
|
||||
--gpl Use gpl libraries
|
||||
MariaDB use
|
||||
--compiler=[gcc|icc|forte|SunStudio|open64] Select compiler
|
||||
--cpu=[x86|x86_64|sparc|itanium] Select CPU type
|
||||
x86 => x86 and 32-bit binary
|
||||
|
@ -213,10 +188,10 @@ Usage: $0 [options]
|
|||
--32 Build a 32-bit binary even if CPU is 64-bit
|
||||
--64 Build a 64-bit binary even if not sure a
|
||||
64-bit CPU is being used
|
||||
--package=[cge|extended|pro|classic] Select package to build
|
||||
--package=[pro|classic] Select package to build
|
||||
--parallelism=number Define parallelism in make
|
||||
--strip Strip binaries
|
||||
--error-inject Enable error injection into MySQL Server and
|
||||
--error-inject Enable error injection into MariaDB Server and
|
||||
data nodes
|
||||
--valgrind Build with valgrind
|
||||
--fast Optimise for CPU architecture built on
|
||||
|
@ -234,12 +209,12 @@ extended_usage()
|
|||
cat <<EOF
|
||||
|
||||
Extended help text for this script:
|
||||
-----------------------------------
|
||||
This script is intended to make it easier for customers using MySQL
|
||||
Cluster Carrier Grade Edition, customers using performance-optimised
|
||||
MySQL versions and developers to build the product from source on
|
||||
these platforms/compilers: Linux/x86 (32-bit and 64-bit) (either using
|
||||
gcc or icc), Linux Itanium, Solaris 8,9,10 and 11 x86 and SPARC using
|
||||
-----------------------------------
|
||||
|
||||
This script is intended to make it easier to build
|
||||
performance-optimised MariaDB versions from source on these
|
||||
platforms/compilers: Linux/x86 (32-bit and 64-bit) (either using gcc
|
||||
or icc), Linux Itanium, Solaris 8,9,10 and 11 x86 and SPARC using
|
||||
gcc or SunStudio and MacOSX/x86/gcc.
|
||||
|
||||
The script automatically detects CPU type and operating system; The
|
||||
|
@ -247,49 +222,28 @@ extended_usage()
|
|||
|
||||
To build on other platforms you can use the --print-only option on a
|
||||
supported platform and edit the output for a proper set of commands on
|
||||
the specific platform you are using. MySQL also provides custom builds
|
||||
for any type of platform that is officially supported for MySQL
|
||||
Cluster. For a list of supported platforms, see
|
||||
http://www.mysql.com/support/supportedplatforms/cluster.html.
|
||||
the specific platform you are using.
|
||||
|
||||
Using the --package option, it is also possible to build a "classic"
|
||||
version of MySQL having only the MyISAM storage engine, a "Pro"
|
||||
package including all storage engines and other features except MySQL
|
||||
Cluster, and an "extended" package including these features plus MySQL
|
||||
version of MariaDB having only the MyISAM storage engine, a "Pro"
|
||||
package including all storage engines and other features except MariaDB
|
||||
Cluster, and an "extended" package including these features plus MariaDB
|
||||
Cluster (this is the default if the --developer option is used).
|
||||
|
||||
Different MySQL storage engines are included in the build, depending
|
||||
Different MariaDB storage engines are included in the build, depending
|
||||
on which --package option is used. The comment and version strong
|
||||
suffix are also set according to the package selected.
|
||||
|
||||
--package=cge
|
||||
storage engines:
|
||||
ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, NDB
|
||||
(All storage engines except InnoDB)
|
||||
comment: MySQL Cluster Carrier Grade Edition GPL/Commercial version
|
||||
built from source
|
||||
version string suffix: -cge
|
||||
|
||||
--package=extended
|
||||
storage engines:
|
||||
ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, INNODB, NDB
|
||||
(All storage engines)
|
||||
comment: MySQL Cluster Carrier Grade Extended Edition GPL/Commercial
|
||||
version built from source
|
||||
version string suffix: -cge-extended
|
||||
|
||||
--package=pro
|
||||
storage engines:
|
||||
ARCHIVE, BLACKHOLE, CSV, FEDERATED, INNODB, MYISAM
|
||||
(All storage engines except NDB)
|
||||
comment: MySQL Pro GPL/Commercial version built from
|
||||
source
|
||||
comment: Pro versions
|
||||
version string suffix: [none]
|
||||
|
||||
--package=classic
|
||||
storage engines: CSV, MYISAM
|
||||
comment: MySQL Classic GPL/Commercial version built
|
||||
from source
|
||||
comment: Version without InnoDB and Maria
|
||||
version string suffix: [none]
|
||||
|
||||
All packages except Classic include support for user-defined
|
||||
|
@ -299,9 +253,9 @@ extended_usage()
|
|||
If --with-debug is used, an additional "-debug" is appended to the
|
||||
version string.
|
||||
|
||||
--commercial
|
||||
This flag prevents the use of GPL libraries which cannot be used
|
||||
under a commercial license, such as the readline library.
|
||||
--with-debug[=full]
|
||||
This option will ensure that the version is built with debug
|
||||
information enabled; the optimisation level is decreased to -O.
|
||||
|
||||
--developer
|
||||
This option changes a number of things to make the version built
|
||||
|
@ -387,8 +341,7 @@ extended_usage()
|
|||
Package-specific options:
|
||||
-------------------------
|
||||
--with-innodb
|
||||
Specifically included in the "pro" and "extended" packages, and not
|
||||
in any of the others.
|
||||
Specifically included in the "pro" package.
|
||||
|
||||
--with-comment
|
||||
Sets the comment for the MySQL version, by package, as described
|
||||
|
@ -401,12 +354,10 @@ extended_usage()
|
|||
Other options used:
|
||||
-------------------
|
||||
--with-readline
|
||||
Use the GPL readline library for command editing functions; not
|
||||
available with commercial packages.
|
||||
Use the GPL readline library for command editing functions.
|
||||
|
||||
--with-libedit
|
||||
Use the BSD licensed library for command editing functions; used for
|
||||
commercial packages.
|
||||
Use the BSD licensed library for command editing functions.
|
||||
|
||||
--with-zlib-dir=bundled
|
||||
Use the zlib package bundled with MySQL.
|
||||
|
@ -651,9 +602,6 @@ parse_package()
|
|||
extended )
|
||||
package="extended"
|
||||
;;
|
||||
cge )
|
||||
package="cge"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown package '$package'"
|
||||
exit 1
|
||||
|
@ -795,12 +743,6 @@ parse_options()
|
|||
--developer)
|
||||
developer_flag="yes"
|
||||
;;
|
||||
--commercial)
|
||||
gpl="no"
|
||||
;;
|
||||
--gpl)
|
||||
gpl="yes"
|
||||
;;
|
||||
--compiler=*)
|
||||
compiler=`get_key_value "$1"`
|
||||
parse_compiler
|
||||
|
@ -850,7 +792,7 @@ parse_options()
|
|||
--configure-only)
|
||||
just_configure="yes"
|
||||
;;
|
||||
--print-only)
|
||||
--print-only|--just-print)
|
||||
just_print="yes"
|
||||
;;
|
||||
--static-linking)
|
||||
|
@ -1151,7 +1093,7 @@ set_warning_flags()
|
|||
warnings="$warnings -Wcomment -W"
|
||||
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
|
||||
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label"
|
||||
warnings="$warnings -Wunused-value -Wunused-variable"
|
||||
warnings="$warnings -Wunused-value -Wunused-variable -Wno-uninitialized"
|
||||
|
||||
if test "x$warning_mode" = "extra" ; then
|
||||
warnings="$warnings -Wshadow"
|
||||
|
@ -1179,7 +1121,9 @@ set_with_debug_flags()
|
|||
{
|
||||
if test "x$with_debug_flag" = "xyes" ; then
|
||||
if test "x$developer_flag" = "xyes" ; then
|
||||
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
|
||||
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
|
||||
loc_debug_flags="$loc_debug_flags -Wuninitialized -DFORCE_INIT_OF_VARS"
|
||||
loc_debug_flags="$loc_debug_flags -DSAFEMALLOC"
|
||||
compiler_flags="$compiler_flags $loc_debug_flags"
|
||||
fi
|
||||
compiler_flags="$compiler_flags $extra_debug_flags"
|
||||
|
@ -1254,28 +1198,19 @@ set_base_configs()
|
|||
if test "x$with_perfschema" != "xno" ; then
|
||||
base_configs="$base_configs --with-perfschema"
|
||||
fi
|
||||
base_configs="$base_configs --with-libevent"
|
||||
}
|
||||
|
||||
#
|
||||
# Add all standard engines and partitioning (included as part of MySQL
|
||||
# Cluster storage engine as well) as part of MySQL Server. These are
|
||||
# added in all packages except the classic package.
|
||||
# Add all standard engines and partitioning
|
||||
#
|
||||
set_base_engines()
|
||||
set_max_engines()
|
||||
{
|
||||
engine_configs="--with-archive-storage-engine"
|
||||
engine_configs="$engine_configs --with-blackhole-storage-engine"
|
||||
engine_configs="$engine_configs --without-example-storage-engine"
|
||||
engine_configs="$engine_configs --with-federated-storage-engine"
|
||||
engine_configs="$engine_configs --with-partition"
|
||||
engine_configs="--with-plugins=max --with-plugin-maria --with-maria-tmp-tables"
|
||||
engine_configs="$engine_configs --without-plugin-innodb_plugin"
|
||||
base_configs="$base_configs $engine_configs"
|
||||
}
|
||||
|
||||
set_innodb_engine()
|
||||
{
|
||||
base_configs="$base_configs --with-innodb"
|
||||
}
|
||||
|
||||
set_ndb_engine()
|
||||
{
|
||||
base_configs="$base_configs --with-ndbcluster"
|
||||
|
@ -1285,41 +1220,17 @@ set_ndb_engine()
|
|||
set_pro_package()
|
||||
{
|
||||
if test "x$without_comment" != "xyes" ; then
|
||||
base_configs="$base_configs --with-comment=\"MySQL Enterprise Pro $version_text built from source\""
|
||||
base_configs="$base_configs --with-comment=\"Pro $version_text built from source\""
|
||||
fi
|
||||
if test "x$with_debug_flag" = "xyes" ; then
|
||||
base_configs="$base_configs --with-server-suffix=\"-debug\""
|
||||
fi
|
||||
}
|
||||
|
||||
set_cge_extended_package()
|
||||
{
|
||||
if test "x$without_comment" != "xyes" ; then
|
||||
base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Extended Edition $version_text built from source\""
|
||||
fi
|
||||
if test "x$with_debug_flag" = "xyes" ; then
|
||||
base_configs="$base_configs --with-server-suffix=\"-cge-extended-debug\""
|
||||
else
|
||||
base_configs="$base_configs --with-server-suffix=\"-cge-extended\""
|
||||
fi
|
||||
}
|
||||
|
||||
set_cge_package()
|
||||
{
|
||||
if test "x$without_comment" != "xyes" ; then
|
||||
base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Edition $version_text built from source\""
|
||||
fi
|
||||
if test "x$with_debug_flag" = "xyes" ; then
|
||||
base_configs="$base_configs --with-server-suffix=\"-cge-debug\""
|
||||
else
|
||||
base_configs="$base_configs --with-server-suffix=\"-cge\""
|
||||
fi
|
||||
}
|
||||
|
||||
set_classic_package()
|
||||
{
|
||||
if test "x$without_comment" != "xyes" ; then
|
||||
base_configs="$base_configs --with-comment=\"MySQL Classic $version_text built from source\""
|
||||
base_configs="$base_configs --with-comment=\"Classic $version_text built from source\""
|
||||
fi
|
||||
if test "x$with_debug_flag" = "xyes" ; then
|
||||
base_configs="$base_configs --with-server-suffix=\"-debug\""
|
||||
|
@ -1786,11 +1697,7 @@ set_error_inject_configs()
|
|||
set_default_package()
|
||||
{
|
||||
if test "x$package" = "x" ; then
|
||||
if test "x$developer_flag" = "xyes" ; then
|
||||
package="extended"
|
||||
else
|
||||
package="cge"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -1908,28 +1815,13 @@ set_icc_special_options
|
|||
|
||||
#
|
||||
# Definitions of various packages possible to compile. The default is to
|
||||
# build a source variant of MySQL Cluster Carrier Grade Edition
|
||||
# including all storage engines except InnoDB, and to use GPL libraries.
|
||||
# build a source variant including all storage engines except InnoDB.
|
||||
#
|
||||
set_base_configs
|
||||
if test "x$gpl" = "xyes" ; then
|
||||
version_text="GPL version"
|
||||
else
|
||||
version_text="Commercial version"
|
||||
fi
|
||||
if test "x$package" = "xpro" ; then
|
||||
set_base_engines
|
||||
set_innodb_engine
|
||||
set_max_engines
|
||||
set_pro_package
|
||||
elif test "x$package" = "xextended" ; then
|
||||
set_base_engines
|
||||
set_ndb_engine
|
||||
set_innodb_engine
|
||||
set_cge_extended_package
|
||||
elif test "x$package" = "xcge" ; then
|
||||
set_base_engines
|
||||
set_ndb_engine
|
||||
set_cge_package
|
||||
elif test "x$package" = "xclassic" ; then
|
||||
set_classic_package
|
||||
else
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2005, 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#
|
||||
# Check cpu of current machine and find the
|
||||
# best compiler optimization flags for gcc
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2000, 2005 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
/bin/rm -f */.deps/*.P */*.o
|
||||
make -k maintainer-clean
|
||||
/bin/rm -f */.deps/*.P */*.o
|
||||
|
@ -23,5 +8,5 @@ make -k maintainer-clean
|
|||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS=-O1 CC=gcc CXX=gcc CXXFLAGS="-O1 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-debug --with-extra-charsets=complex --without-extra-tools
|
||||
CFLAGS=-O1 CC=gcc CXX=g++ CXXFLAGS="-O1 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-debug --with-extra-charsets=complex --without-extra-tools
|
||||
make
|
||||
|
|
|
@ -1,20 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2004, 2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#
|
||||
# This script's purpose is to update the automake/autoconf helper scripts and
|
||||
# to run a plain "configure" without any special compile flags. Only features
|
||||
|
@ -44,7 +28,7 @@ fi
|
|||
# Default to gcc for CC and CXX
|
||||
if test -z "$CXX" ; then
|
||||
export CXX
|
||||
CXX=gcc
|
||||
CXX=g++
|
||||
# Set some required compile options
|
||||
if test -z "$CXXFLAGS" ; then
|
||||
export CXXFLAGS
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2000, 2005 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
AM_MAKEFLAGS="-j 2"
|
||||
gmake -k maintainer-clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
@ -23,7 +8,7 @@ path=`dirname $0`
|
|||
. "$path/autorun.sh"
|
||||
|
||||
export PATH=/usr/local/pgcc/bin:$PATH
|
||||
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
|
||||
CFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O6 -mpentiumpro -fomit-frame-pointer -mstack-align-double" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O6 -fomit-frame-pointer -mpentiumpro -mstack-align-double" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
|
||||
|
||||
gmake -j 4
|
||||
|
||||
|
|
|
@ -1,27 +1,13 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2006, 2007 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library 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
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
# MA 02111-1307, USA
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium64_cflags $fast_cflags"
|
||||
extra_configs="$pentium_configs $static_link"
|
||||
# On CentOS/Fedora Core 10 amd64, there is system libz.so but not
|
||||
# libz.a, so need to use bundled zlib when building static
|
||||
# binary. Hence we use --with-zlib-dir=bundled
|
||||
extra_configs="$pentium_configs $static_link --with-zlib-dir=bundled"
|
||||
CC="$CC --pipe"
|
||||
strip=yes
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ gmake -k maintainer-clean || true
|
|||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="-m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3"
|
||||
extra_flags="-m64 -fast -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3"
|
||||
extra_configs="$max_configs --with-libevent"
|
||||
|
||||
warnings=""
|
||||
|
|
31
BUILD/compile-solaris-amd64-forte-debug
Executable file
31
BUILD/compile-solaris-amd64-forte-debug
Executable file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/sh
|
||||
|
||||
# See file compile-solaris-amd64 for basic pre-requisites.
|
||||
|
||||
# This build uses the Sun Studio compilers (cc, CC), available from:
|
||||
# http://developers.sun.com/sunstudio/downloads/index.jsp
|
||||
# Note that you may want to apply current patches, as the downloaded version
|
||||
# is typically out of date. Download the PKG version if you intend to patch!
|
||||
|
||||
# After installing, add /opt/SUNWspro/bin to your $PATH
|
||||
|
||||
|
||||
gmake -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="-g -m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3"
|
||||
extra_configs="$max_configs --with-libevent"
|
||||
|
||||
warnings=""
|
||||
c_warnings=""
|
||||
cxx_warnings=""
|
||||
base_cxxflags="-noex"
|
||||
|
||||
CC=cc
|
||||
CFLAGS="-xstrconst"
|
||||
CXX=CC
|
||||
LDFLAGS="-lmtmalloc"
|
||||
|
||||
. "$path/FINISH.sh"
|
|
@ -1,20 +1,5 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2000, 2005 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
make -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
|
@ -24,6 +9,6 @@ PATH=$PATH:/usr/ccs/bin:/usr/local/bin
|
|||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa $EXTRA_FLAGS $EXTRA_CFLAGS" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g $EXTRA_FLAGS $EXTRA_CXXFLAGS" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
|
||||
|
||||
make -j 4
|
||||
|
|
|
@ -1,26 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2001, 2005 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
make -k clean || true
|
||||
/bin/rm -f */.deps/*.P config.cache
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
|
||||
|
||||
make -j 4
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Copyright (C) 2000, 2005 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
mode=""
|
||||
cxxfilt=""
|
||||
|
||||
|
@ -52,7 +37,7 @@ make -k maintainer-clean || true
|
|||
path=`dirname $0`
|
||||
. "$path/autorun.sh"
|
||||
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_valgrind -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_valgrind -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
|
||||
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_valgrind -DEXTRA_DEBUG -O2" CXX=g++ CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_valgrind -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
|
||||
|
||||
make -j 4
|
||||
|
||||
|
|
|
@ -223,7 +223,7 @@ ENDIF()
|
|||
|
||||
# Set commonly used variables
|
||||
IF(WIN32)
|
||||
SET(DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}" )
|
||||
SET(DEFAULT_MYSQL_HOME "C:/MariaDB${MYSQL_BASE_VERSION}")
|
||||
SET(SHAREDIR share)
|
||||
ELSE()
|
||||
SET(DEFAULT_MYSQL_HOME ${CMAKE_INSTALL_PREFIX})
|
||||
|
|
|
@ -1,289 +1,2 @@
|
|||
Up-to-date instructions on MariaDB building on Windows can be found in http://kb.askmonty.org/en/building-mariadb-on-windows.
|
||||
|
||||
2.5.10. Installing MySQL from Source on Windows
|
||||
|
||||
These instructions describe how to build binaries from source for
|
||||
MySQL 5.1 on Windows. Instructions are provided for building
|
||||
binaries from a standard source distribution or from the Bazaar
|
||||
tree that contains the latest development source.
|
||||
|
||||
Note
|
||||
|
||||
The instructions here are strictly for users who want to test
|
||||
MySQL on Microsoft Windows from the latest source distribution or
|
||||
from the Bazaar tree. For production use, we do not advise using a
|
||||
MySQL server built by yourself from source. Normally, it is best
|
||||
to use precompiled binary distributions of MySQL that are built
|
||||
specifically for optimal performance on Windows by Oracle
|
||||
Corporation. Instructions for installing binary distributions are
|
||||
available in Section 2.5, "Installing MySQL on Windows."
|
||||
|
||||
To build MySQL on Windows from source, you must satisfy the
|
||||
following system, compiler, and resource requirements:
|
||||
|
||||
* Windows 2000, Windows XP, or newer version.
|
||||
Windows Vista is supported when using Visual Studio 2005
|
||||
provided you have installed the following updates:
|
||||
|
||||
+ Microsoft Visual Studio 2005 Professional Edition - ENU
|
||||
Service Pack 1 (KB926601)
|
||||
(http://support.microsoft.com/?kbid=926601)
|
||||
|
||||
+ Security Update for Microsoft Visual Studio 2005
|
||||
Professional Edition - ENU (KB937061)
|
||||
(http://support.microsoft.com/?kbid=937061)
|
||||
|
||||
+ Update for Microsoft Visual Studio 2005 Professional
|
||||
Edition - ENU (KB932232)
|
||||
(http://support.microsoft.com/?kbid=932232)
|
||||
|
||||
* CMake, which can be downloaded from http://www.cmake.org.
|
||||
After installing, modify your path to include the cmake
|
||||
binary.
|
||||
|
||||
* Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net
|
||||
2003 (7.1), or Visual Studio 2005 (8.0) compiler system.
|
||||
|
||||
* If you are using Visual C++ 2005 Express Edition, you must
|
||||
also install an appropriate Platform SDK. More information and
|
||||
links to downloads for various Windows platforms is available
|
||||
from
|
||||
http://www.microsoft.com/downloads/details.aspx?familyid=0baf2
|
||||
b35-c656-4969-ace8-e4c0c0716adb.
|
||||
|
||||
* If you are compiling from a Bazaar tree or making changes to
|
||||
the parser, you need bison for Windows, which can be
|
||||
downloaded from
|
||||
http://gnuwin32.sourceforge.net/packages/bison.htm. Download
|
||||
the package labeled "Complete package, excluding sources".
|
||||
After installing the package, modify your path to include the
|
||||
bison binary and ensure that this binary is accessible from
|
||||
Visual Studio.
|
||||
|
||||
* Cygwin might be necessary if you want to run the test script
|
||||
or package the compiled binaries and support files into a Zip
|
||||
archive. (Cygwin is needed only to test or package the
|
||||
distribution, not to build it.) Cygwin is available from
|
||||
http://cygwin.com.
|
||||
|
||||
* 3GB to 5GB of disk space.
|
||||
|
||||
The exact system requirements for Visual Studio can be found here:
|
||||
http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as
|
||||
px and
|
||||
http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx
|
||||
|
||||
You also need a MySQL source distribution for Windows, which can
|
||||
be obtained two ways:
|
||||
|
||||
* Obtain a source distribution packaged by Oracle Corporation.
|
||||
These are available from http://dev.mysql.com/downloads/.
|
||||
|
||||
* Package a source distribution yourself from the latest Bazaar
|
||||
developer source tree. For instructions on pulling the latest
|
||||
source files, see Section 2.3.3, "Installing from the
|
||||
Development Source Tree."
|
||||
|
||||
If you find something not working as expected, or you have
|
||||
suggestions about ways to improve the current build process on
|
||||
Windows, please send a message to the win32 mailing list. See
|
||||
Section 1.6.1, "MySQL Mailing Lists."
|
||||
|
||||
2.5.10.1. Building MySQL from Source Using CMake and Visual Studio
|
||||
|
||||
You can build MySQL on Windows by using a combination of cmake and
|
||||
Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio
|
||||
2005 (8.0), Microsoft Visual Studio 2008 (9.0) or Microsoft Visual
|
||||
C++ 2005 Express Edition. You must have the appropriate Microsoft
|
||||
Platform SDK installed.
|
||||
|
||||
Note
|
||||
|
||||
To compile from the source code on Windows you must use the
|
||||
standard source distribution (for example, mysql-5.1.46.tar.gz).
|
||||
You build from the same distribution as used to build MySQL on
|
||||
Unix, Linux and other platforms. Do not use the Windows Source
|
||||
distributions as they do not contain the necessary configuration
|
||||
script and other files.
|
||||
|
||||
Follow this procedure to build MySQL:
|
||||
|
||||
1. If you are installing from a packaged source distribution,
|
||||
create a work directory (for example, C:\workdir), and unpack
|
||||
the source distribution there using WinZip or another Windows
|
||||
tool that can read .zip files. This directory is the work
|
||||
directory in the following instructions.
|
||||
|
||||
Note
|
||||
You must run the commands in the win directory from the
|
||||
top-level source directory. Do not change into the win
|
||||
directory, as the commands will not be executed correctly.
|
||||
|
||||
2. Start a command shell. If you have not configured the PATH and
|
||||
other environment variables for all command shells, you may be
|
||||
able to start a command shell from the Start Menu within the
|
||||
Windows Visual Studio menu that contains the necessary
|
||||
environment changes.
|
||||
|
||||
3. Within the command shell, navigate to the work directory and
|
||||
run the following command:
|
||||
C:\workdir>win\configure.js options
|
||||
If you have associated the .js file extension with an
|
||||
application such as a text editor, then you may need to use
|
||||
the following command to force configure.js to be executed as
|
||||
a script:
|
||||
C:\workdir>cscript win\configure.js options
|
||||
These options are available for configure.js:
|
||||
|
||||
+ WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage
|
||||
engine.
|
||||
|
||||
+ WITH_PARTITION_STORAGE_ENGINE: Enable user-defined
|
||||
partitioning.
|
||||
|
||||
+ WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage
|
||||
engine.
|
||||
|
||||
+ WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE
|
||||
storage engine.
|
||||
|
||||
+ WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage
|
||||
engine.
|
||||
|
||||
+ WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED
|
||||
storage engine.
|
||||
|
||||
+ WITH_NDBCLUSTER_STORAGE_ENGINE (experimental): Enable the
|
||||
NDBCLUSTER storage engine in the MySQL server; cause
|
||||
binaries for the MySQL Cluster management and data node,
|
||||
management client, and other programs to be built.
|
||||
This option is supported only in MySQL Cluster NDB 7.0
|
||||
(NDBCLUSTER storage engine versions 6.4.0 and later)
|
||||
using the MySQL Cluster sources. It cannot be used to
|
||||
enable clustering support in other MySQL source trees or
|
||||
distributions.
|
||||
|
||||
+ MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none.
|
||||
|
||||
+ COMPILATION_COMMENT=comment: Server comment, default
|
||||
"Source distribution".
|
||||
|
||||
+ MYSQL_TCP_PORT=port: Server port, default 3306.
|
||||
|
||||
+ DISABLE_GRANT_OPTIONS: Disables the --bootstrap,
|
||||
--skip-grant-tables, and --init-file options for mysqld.
|
||||
This option is available as of MySQL 5.1.15.
|
||||
For example (type the command on one line):
|
||||
C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE
|
||||
WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
|
||||
|
||||
4. From the work directory, execute the win\build-vs9.bat
|
||||
(Windows Visual Studio 2008), win\build-vs8.bat (Windows
|
||||
Visual Studio 2005), or win\build-vs71.bat (Windows Visual
|
||||
Stidion 2003) script, depending on the version of Visual
|
||||
Studio you have installed. The script invokes CMake, which
|
||||
generates the mysql.sln solution file.
|
||||
You can also use the corresponding 64-bit file (for example
|
||||
win\build-vs8_x64.bat or win\build-vs9_x64.bat) to build the
|
||||
64-bit version of MySQL. However, you cannot build the 64-bit
|
||||
version with Visual Studio Express Edition. You must use
|
||||
Visual Studio 2005 (8.0) or higher.
|
||||
|
||||
5. From the work directory, open the generated mysql.sln file
|
||||
with Visual Studio and select the proper configuration using
|
||||
the Configuration menu. The menu provides Debug, Release,
|
||||
RelwithDebInfo, MinRelInfo options. Then select Solution >
|
||||
Build to build the solution.
|
||||
Remember the configuration that you use in this step. It is
|
||||
important later when you run the test script because that
|
||||
script needs to know which configuration you used.
|
||||
|
||||
6. Test the server. The server built using the preceding
|
||||
instructions expects that the MySQL base directory and data
|
||||
directory are C:\mysql and C:\mysql\data by default. If you
|
||||
want to test your server using the source tree root directory
|
||||
and its data directory as the base directory and data
|
||||
directory, you need to tell the server their path names. You
|
||||
can either do this on the command line with the --basedir and
|
||||
--datadir options, or by placing appropriate options in an
|
||||
option file. (See Section 4.2.3.3, "Using Option Files.") If
|
||||
you have an existing data directory elsewhere that you want to
|
||||
use, you can specify its path name instead.
|
||||
When the server is running in standalone fashion or as a
|
||||
service based on your configuration, try to connect to it from
|
||||
the mysql interactive command-line utility.
|
||||
You can also run the standard test script, mysql-test-run.pl.
|
||||
This script is written in Perl, so you'll need either Cygwin
|
||||
or ActiveState Perl to run it. You may also need to install
|
||||
the modules required by the script. To run the test script,
|
||||
change location into the mysql-test directory under the work
|
||||
directory, set the MTR_VS_CONFIG environment variable to the
|
||||
configuration you selected earlier (or use the --vs-config
|
||||
option), and invoke mysql-test-run.pl. For example (using
|
||||
Cygwin and the bash shell):
|
||||
shell> cd mysql-test
|
||||
shell> export MTR_VS_CONFIG=debug
|
||||
shell> ./mysql-test-run.pl --force --timer
|
||||
shell> ./mysql-test-run.pl --force --timer --ps-protocol
|
||||
|
||||
When you are satisfied that the programs you have built are
|
||||
working correctly, stop the server. Now you can install the
|
||||
distribution. One way to do this is to use the make_win_bin_dist
|
||||
script in the scripts directory of the MySQL source distribution
|
||||
(see Section 4.4.2, "make_win_bin_dist --- Package MySQL
|
||||
Distribution as ZIP Archive"). This is a shell script, so you must
|
||||
have Cygwin installed if you want to use it. It creates a Zip
|
||||
archive of the built executables and support files that you can
|
||||
unpack in the location at which you want to install MySQL.
|
||||
|
||||
It is also possible to install MySQL by copying directories and
|
||||
files directly:
|
||||
|
||||
1. Create the directories where you want to install MySQL. For
|
||||
example, to install into C:\mysql, use these commands:
|
||||
C:\> mkdir C:\mysql
|
||||
C:\> mkdir C:\mysql\bin
|
||||
C:\> mkdir C:\mysql\data
|
||||
C:\> mkdir C:\mysql\share
|
||||
C:\> mkdir C:\mysql\scripts
|
||||
If you want to compile other clients and link them to MySQL,
|
||||
you should also create several additional directories:
|
||||
C:\> mkdir C:\mysql\include
|
||||
C:\> mkdir C:\mysql\lib
|
||||
C:\> mkdir C:\mysql\lib\debug
|
||||
C:\> mkdir C:\mysql\lib\opt
|
||||
If you want to benchmark MySQL, create this directory:
|
||||
C:\> mkdir C:\mysql\sql-bench
|
||||
Benchmarking requires Perl support. See Section 2.15, "Perl
|
||||
Installation Notes."
|
||||
|
||||
2. From the work directory, copy into the C:\mysql directory the
|
||||
following files and directories:
|
||||
C:\> cd \workdir
|
||||
C:\workdir> mkdir C:\mysql
|
||||
C:\workdir> mkdir C:\mysql\bin
|
||||
C:\workdir> copy client\Release\*.exe C:\mysql\bin
|
||||
C:\workdir> copy sql\Release\mysqld.exe C:\mysql\bin\mysqld.exe
|
||||
C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E
|
||||
C:\workdir> xcopy share\*.* C:\mysql\share /E
|
||||
If you want to compile other clients and link them to MySQL,
|
||||
you should also copy several libraries and header files:
|
||||
C:\workdir> copy lib\Release\mysqlclient.lib C:\mysql\lib\debug
|
||||
C:\workdir> copy lib\Release\libmysql.* C:\mysql\lib\debug
|
||||
C:\workdir> copy lib\Release\zlib.* C:\mysql\lib\debug
|
||||
C:\workdir> copy lib\Release\mysqlclient.lib C:\mysql\lib\opt
|
||||
C:\workdir> copy lib\Release\libmysql.* C:\mysql\lib\opt
|
||||
C:\workdir> copy lib\Release\zlib.* C:\mysql\lib\opt
|
||||
C:\workdir> copy include\*.h C:\mysql\include
|
||||
C:\workdir> copy libmysql\libmysql.def C:\mysql\include
|
||||
|
||||
Note
|
||||
If you have compiled a Debug, rather than Release solution,
|
||||
you can replace Release with Debug in the source file names
|
||||
shown above.
|
||||
If you want to benchmark MySQL, you should also do this:
|
||||
C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E
|
||||
|
||||
After installation, set up and start the server in the same way as
|
||||
for binary Windows distributions. This includes creating the
|
||||
system tables by running mysql_install_db. For more information,
|
||||
see Section 2.5, "Installing MySQL on Windows."
|
||||
|
|
578
README
578
README
|
@ -7,8 +7,8 @@ MariaDB is brought to you by many of the original developers of MySQL
|
|||
who now work for Monty Program Ab, and by many people in the
|
||||
community.
|
||||
|
||||
MySQL, which is the base of MariaDB, is a product and trademark of Sun
|
||||
Microsystems, Inc. For a list of developers and other contributors,
|
||||
MySQL, which is the base of MariaDB, is a product and trademark of Oracle
|
||||
Corporation, Inc. For a list of developers and other contributors,
|
||||
see the Credits appendix. You can also do 'SHOW authors' to get a
|
||||
list of active contributors.
|
||||
|
||||
|
@ -24,7 +24,7 @@ More help is available from the Maria Discuss mailing list
|
|||
https://launchpad.net/~maria-discuss
|
||||
and the #maria IRC channel on Freenode.
|
||||
|
||||
***********************************************************
|
||||
***************************************************************************
|
||||
|
||||
NOTE:
|
||||
|
||||
|
@ -36,7 +36,7 @@ the MySQL distribution for more information.
|
|||
License information can be found in the COPYING file and the
|
||||
EXCEPTIONS-CLIENT file.
|
||||
|
||||
************************************************************
|
||||
***************************************************************************
|
||||
|
||||
IMPORTANT:
|
||||
|
||||
|
@ -45,9 +45,7 @@ https://bugs.launchpad.net/maria
|
|||
|
||||
Bugs in the MySQL code can also be submitted at http://bugs.mysql.com
|
||||
|
||||
************************************************************
|
||||
THIRD-PARTY SOFTWARE
|
||||
************************************************************
|
||||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
FindGTest.cmake (part of CMake 2.8.0)
|
||||
|
@ -65,7 +63,6 @@ Use of any of this software is governed by the terms of the license below:
|
|||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#===========================================================================
|
||||
==
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
#
|
||||
|
@ -119,27 +116,30 @@ CMake is distributed under BSD License
|
|||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Kitware, Inc. nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Kitware, Inc. nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
|
||||
SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
||||
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
|
||||
OF SUCH DAMAGE.
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Additional License(s)
|
||||
|
||||
|
@ -185,14 +185,14 @@ cmake-2.4.8/Utilities/cmtar/compat/gethostname.c:
|
|||
|
||||
* Author : Per Foreby, perf@efd.lth.se
|
||||
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net
|
||||
*
|
||||
*
|
||||
|
||||
**************************************************************************
|
||||
|
||||
----------------------------------------
|
||||
|
||||
Copyright (c) 2002 Insight Consortium. All rights reserved.
|
||||
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
|
||||
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for
|
||||
details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
|
@ -201,7 +201,8 @@ cmake-2.4.8/Utilities/cmtar/compat/gethostname.c:
|
|||
--------------------------------------------
|
||||
|
||||
Skeleton parser for Yacc-like parsing with Bison,
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
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
|
||||
|
@ -243,27 +244,28 @@ cmake-2.4.8/Utilities/cmzlib/zlib.h:
|
|||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
2. Altered source versions must be plainly marked as such, and must
|
||||
not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
|
||||
----------------------------------------------
|
||||
|
||||
This source code was modified by Martin Hedenfalk for use in Curl. His latest
|
||||
changes were done 2000-09-18.
|
||||
This source code was modified by Martin Hedenfalk for use in Curl. His
|
||||
latest changes were done 2000-09-18.
|
||||
|
||||
It has since been patched away like a madman by Daniel Stenberg to make it
|
||||
better applied to curl conditions, and to make it not use globals, pollute
|
||||
name space and more. This source code awaits a rewrite to work around the
|
||||
paragraph 2 in the BSD licenses as explained below.
|
||||
|
||||
Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan It has
|
||||
since been patched and modified a lot by Daniel Stenberg to make it better
|
||||
applied to curl conditions, and to make it not use globals, pollute name space
|
||||
and more. This source code awaits a rewrite to work around the paragraph 2 in
|
||||
the BSD licenses as explained below.
|
||||
Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan
|
||||
It has since been patched and modified a lot by Daniel Stenberg to make it
|
||||
better applied to curl conditions, and to make it not use globals, pollute
|
||||
name space and more. This source code awaits a rewrite to work around the
|
||||
paragraph 2 in the BSD licenses as explained below.
|
||||
|
||||
Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan
|
||||
(Royal Institute of Technology, Stockholm, Sweden).
|
||||
|
@ -289,9 +291,9 @@ cmake-2.4.8/Utilities/cmzlib/zlib.h:
|
|||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
@ -319,14 +321,14 @@ cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
|
|||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
|
||||
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
|
||||
CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
||||
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
|
||||
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
|
||||
INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
|
||||
OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
||||
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
-------------------------------------------------------
|
||||
|
||||
|
@ -345,14 +347,14 @@ cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
|
|||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
|
@ -402,8 +404,8 @@ cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
|
|||
documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the University of
|
||||
California, Berkeley and its contributors.
|
||||
This product includes software developed by the University of
|
||||
California, Berkeley and its contributors.
|
||||
4. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
@ -413,9 +415,9 @@ cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
|
|||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
@ -444,35 +446,35 @@ cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
|
|||
|
||||
------------------------------------------------------------
|
||||
|
||||
****************************************************************************
|
||||
Copyright (c) 1998 Free Software Foundation, Inc. *
|
||||
Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
*
|
||||
Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
copy of this software and associated documentation files (the *
|
||||
"Software"), to deal in the Software without restriction, including *
|
||||
without limitation the rights to use, copy, modify, merge, publish, *
|
||||
distribute, distribute with modifications, sublicense, and/or sell *
|
||||
copies of the Software, and to permit persons to whom the Software is *
|
||||
furnished to do so, subject to the following conditions: *
|
||||
*
|
||||
The above copyright notice and this permission notice shall be included *
|
||||
in all copies or substantial portions of the Software. *
|
||||
*
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
*
|
||||
*
|
||||
Except as contained in this notice, the name(s) of the above copyright *
|
||||
holders shall not be used in advertising or otherwise to promote the *
|
||||
sale, use or other dealings in this Software without prior written *
|
||||
authorization. *
|
||||
***************************************************************************
|
||||
***************************************************************************
|
||||
Copyright (c) 1998 Free Software Foundation, Inc.
|
||||
Copyright (c) 1998,2000 Free Software Foundation, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, distribute with modifications, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Except as contained in this notice, the name(s) of the above copyright
|
||||
holders shall not be used in advertising or otherwise to promote the sale,
|
||||
use or other dealings in this Software without prior written
|
||||
authorization.
|
||||
***************************************************************************
|
||||
|
||||
------------------------------------------------------
|
||||
|
||||
|
@ -495,26 +497,29 @@ cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
|
|||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
***************************************************************************
|
||||
|
||||
|
||||
|
||||
***************************************************************************
|
||||
%%The following software may be included in this product:
|
||||
Fred Fish's Dbug Library
|
||||
|
||||
|
@ -548,6 +553,35 @@ Use of any of this software is governed by the terms of the license below:
|
|||
|
||||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
dbug_analyze.c (part of Fred Fish's Dbug Library)
|
||||
|
||||
Use of any of this software is governed by the terms of the license below:
|
||||
|
||||
* Copyright Abandoned, 1987, Fred Fish *
|
||||
* *
|
||||
* *
|
||||
* This previously copyrighted work has been placed into the public *
|
||||
* domain by the author and may be freely used for any purpose, *
|
||||
* private or commercial. *
|
||||
* *
|
||||
* Because of the number of inquiries I was receiving about the use *
|
||||
* of this product in commercially developed works I have decided to *
|
||||
* simply make it public domain to further its unrestricted use. I *
|
||||
* specifically would be most happy to see this material become a *
|
||||
* part of the standard Unix distributions by AT&T and the Berkeley *
|
||||
* Computer Science Research Group, and a standard part of the GNU *
|
||||
* system from the Free Software Foundation. *
|
||||
* *
|
||||
* I would appreciate it, as a courtesy, if this notice is left in *
|
||||
* all copies and derivative works. Thank you. *
|
||||
* *
|
||||
* The author makes no warranty of any kind with respect to this *
|
||||
* product and explicitly disclaims any implied warranties of mer- *
|
||||
* chantability or fitness for any particular purpose. *
|
||||
|
||||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
GNU Libtool, only ltmain.sh, libtool, auto-gen fil
|
||||
|
||||
|
@ -1449,104 +1483,121 @@ Use of any of this software is governed by the terms of the license below:
|
|||
|
||||
Unicode Terms of Use
|
||||
|
||||
For the general privacy policy governing access to this site, see the
|
||||
Unicode Privacy Policy. For trademark usage, see the Unicode Consortium®
|
||||
Trademarks and Logo Policy.
|
||||
For the general privacy policy governing access to this site, see the
|
||||
Unicode Privacy Policy. For trademark usage, see the Unicode
|
||||
Consortium (R) Trademarks and Logo Policy.
|
||||
Notice to End User: Terms of Use
|
||||
Carefully read the following legal agreement ("Agreement"). Use or copying
|
||||
of the software and/or codes provided with this agreement (The "Software")
|
||||
constitutes your acceptance of these terms
|
||||
Carefully read the following legal agreement ("Agreement"). Use or
|
||||
copying of the software and/or codes provided with this agreement (The
|
||||
"Software") constitutes your acceptance of these terms
|
||||
|
||||
1. Unicode Copyright.
|
||||
1. Copyright © 1991-2008 Unicode, Inc. All rights reserved.
|
||||
2. Certain documents and files on this website contain a legend
|
||||
indicating that "Modification is permitted." Any person is hereby authorized,
|
||||
without fee, to modify such documents and files to create derivative works
|
||||
conforming to the Unicode® Standard, subject to Terms and Conditions herein.
|
||||
1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved.
|
||||
2. Certain documents and files on this website contain a
|
||||
legend indicating that "Modification is permitted." Any person
|
||||
is hereby authorized, without fee, to modify such documents
|
||||
and files to create derivative works conforming to the
|
||||
Unicode (R) Standard, subject to Terms and Conditions herein.
|
||||
3. Any person is hereby authorized, without fee, to view, use,
|
||||
reproduce, and distribute all documents and files solely for informational
|
||||
purposes in the creation of products supporting the Unicode Standard, subject to
|
||||
the Terms and Conditions herein.
|
||||
4. Further specifications of rights and restrictions pertaining to
|
||||
the use of the particular set of data files known as the "Unicode Character
|
||||
Database" can be found in Exhibit 1.
|
||||
5. Each version of the Unicode Standard has further specifications
|
||||
of rights and restrictions of use. For the book editions, these are found on the
|
||||
back of the title page. For the online edition, certain files (such as the PDF
|
||||
files for book chapters and code charts) carry specific restrictions. All other
|
||||
files are covered under these general Terms of Use. To request a permission to
|
||||
reproduce any part of the Unicode Standard, please contact the Unicode Consortium.
|
||||
6. No license is granted to "mirror" the Unicode website where a
|
||||
fee is charged for access to the "mirror" site.
|
||||
7. Modification is not permitted with respect to this document. All
|
||||
copies of this document must be verbatim.
|
||||
reproduce, and distribute all documents and files solely for
|
||||
informational purposes in the creation of products supporting
|
||||
the Unicode Standard, subject to the Terms and Conditions
|
||||
herein.
|
||||
4. Further specifications of rights and restrictions
|
||||
pertaining to the use of the particular set of data files
|
||||
known as the "Unicode Character Database" can be found in
|
||||
Exhibit 1.
|
||||
5. Each version of the Unicode Standard has further
|
||||
specifications of rights and restrictions of use. For the book
|
||||
editions, these are found on the back of the title page. For
|
||||
the online edition, certain files (such as the PDF files for
|
||||
book chapters and code charts) carry specific restrictions.
|
||||
All other files are covered under these general Terms of Use.
|
||||
To request a permission to reproduce any part of the Unicode
|
||||
Standard, please contact the Unicode Consortium.
|
||||
6. No license is granted to "mirror" the Unicode website where
|
||||
a fee is charged for access to the "mirror" site.
|
||||
7. Modification is not permitted with respect to this
|
||||
document. All copies of this document must be verbatim.
|
||||
2. Restricted Rights Legend. Any technical data or software which is
|
||||
licensed to the United States of America, its agencies and/or instrumentalities
|
||||
under this Agreement is commercial technical data or commercial computer
|
||||
software developed exclusively at private expense as defined in FAR 2.101, or
|
||||
DFARS 252.227-7014 (June 1995), as applicable. For technical data, use,
|
||||
duplication, or disclosure by the Government is subject to restrictions as set
|
||||
forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and
|
||||
this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202,
|
||||
as applicable, use, duplication or disclosure by the Government is subject to
|
||||
the restrictions set forth in this Agreement.
|
||||
licensed to the United States of America, its agencies and/or
|
||||
instrumentalities under this Agreement is commercial technical data
|
||||
or commercial computer software developed exclusively at private
|
||||
expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995),
|
||||
as applicable. For technical data, use, duplication, or disclosure
|
||||
by the Government is subject to restrictions as set forth in DFARS
|
||||
202.227-7015 Technical Data, Commercial and Items (Nov 1995) and
|
||||
this Agreement. For Software, in accordance with FAR 12-212 or DFARS
|
||||
227-7202, as applicable, use, duplication or disclosure by the
|
||||
Government is subject to the restrictions set forth in this
|
||||
Agreement.
|
||||
3. Warranties and Disclaimers.
|
||||
1. This publication and/or website may include technical or
|
||||
typographical errors or other inaccuracies . Changes are periodically added to
|
||||
the information herein; these changes will be incorporated in new editions of
|
||||
the publication and/or website. Unicode may make improvements and/or changes in
|
||||
the product(s) and/or program(s) described in this publication and/or website at
|
||||
any time.
|
||||
2. If this file has been purchased on magnetic or optical media
|
||||
from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange
|
||||
of the defective media within ninety (90) days of original purchase.
|
||||
typographical errors or other inaccuracies . Changes are
|
||||
periodically added to the information herein; these changes
|
||||
will be incorporated in new editions of the publication and/or
|
||||
website. Unicode may make improvements and/or changes in the
|
||||
product(s) and/or program(s) described in this publication
|
||||
and/or website at any time.
|
||||
2. If this file has been purchased on magnetic or optical
|
||||
media from Unicode, Inc. the sole and exclusive remedy for any
|
||||
claim will be exchange of the defective media within ninety
|
||||
(90) days of original purchase.
|
||||
3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR
|
||||
SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS,
|
||||
IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE
|
||||
AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS
|
||||
PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED
|
||||
TO THIS PUBLICATION OR THE UNICODE WEBSITE.
|
||||
SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
|
||||
EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
|
||||
LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS
|
||||
LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN
|
||||
THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE
|
||||
REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE
|
||||
WEBSITE.
|
||||
4. Waiver of Damages. In no event shall Unicode or its licensors be
|
||||
liable for any special, incidental, indirect or consequential damages of any
|
||||
kind, or any damages whatsoever, whether or not Unicode was advised of the
|
||||
possibility of the damage, including, without limitation, those resulting from
|
||||
the following: loss of use, data or profits, in connection with the use,
|
||||
modification or distribution of this information or its derivatives.
|
||||
liable for any special, incidental, indirect or consequential
|
||||
damages of any kind, or any damages whatsoever, whether or not
|
||||
Unicode was advised of the possibility of the damage, including,
|
||||
without limitation, those resulting from the following: loss of use,
|
||||
data or profits, in connection with the use, modification or
|
||||
distribution of this information or its derivatives.
|
||||
5. Trademarks.
|
||||
1. Unicode and the Unicode logo are registered trademarks of
|
||||
Unicode, Inc.
|
||||
2. This site contains product names and corporate names of other
|
||||
companies. All product names and company names and logos mentioned herein are
|
||||
the trademarks or registered trademarks of their respective owners. Other
|
||||
products and corporate names mentioned herein which are trademarks of a third
|
||||
party are used only for explanation and for the owners' benefit and with no
|
||||
intent to infringe.
|
||||
3. Use of third party products or information referred to herein is
|
||||
at the user's risk.
|
||||
Unicode, Inc.
|
||||
2. This site contains product names and corporate names of
|
||||
other companies. All product names and company names and logos
|
||||
mentioned herein are the trademarks or registered trademarks
|
||||
of their respective owners. Other products and corporate names
|
||||
mentioned herein which are trademarks of a third party are
|
||||
used only for explanation and for the owners' benefit and with
|
||||
no intent to infringe.
|
||||
3. Use of third party products or information referred to
|
||||
herein is at the user's risk.
|
||||
6. Miscellaneous.
|
||||
1. Jurisdiction and Venue. This server is operated from a location
|
||||
in the State of California, United States of America. Unicode makes no
|
||||
representation that the materials are appropriate for use in other locations. If
|
||||
you access this server from other locations, you are responsible for compliance
|
||||
with local laws. This Agreement, all use of this site and any claims and damages
|
||||
resulting from use of this site are governed solely by the laws of the State of
|
||||
California without regard to any principles which would apply the laws of a
|
||||
different jurisdiction. The user agrees that any disputes regarding this site
|
||||
shall be resolved solely in the courts located in Santa Clara County,
|
||||
California. The user agrees said courts have personal jurisdiction and agree to
|
||||
waive any right to transfer the dispute to any other forum.
|
||||
2. Modification by Unicode Unicode shall have the right to modify
|
||||
this Agreement at any time by posting it to this site. The user may not assign
|
||||
any part of this Agreement without Unicode's prior written consent.
|
||||
3. Taxes. The user agrees to pay any taxes arising from access to
|
||||
this website or use of the information herein, except for those based on
|
||||
Unicode's net income.
|
||||
4. Severability. If any provision of this Agreement is declared
|
||||
invalid or unenforceable, the remaining provisions of this Agreement shall
|
||||
remain in effect.
|
||||
1. Jurisdiction and Venue. This server is operated from a
|
||||
location in the State of California, United States of America.
|
||||
Unicode makes no representation that the materials are
|
||||
appropriate for use in other locations. If you access this
|
||||
server from other locations, you are responsible for
|
||||
compliance with local laws. This Agreement, all use of this
|
||||
site and any claims and damages resulting from use of this
|
||||
site are governed solely by the laws of the State of
|
||||
California without regard to any principles which would apply
|
||||
the laws of a different jurisdiction. The user agrees that any
|
||||
disputes regarding this site shall be resolved solely in the
|
||||
courts located in Santa Clara County, California. The user
|
||||
agrees said courts have personal jurisdiction and agree to
|
||||
waive any right to transfer the dispute to any other forum.
|
||||
2. Modification by Unicode Unicode shall have the right to
|
||||
modify this Agreement at any time by posting it to this site.
|
||||
The user may not assign any part of this Agreement without
|
||||
Unicode's prior written consent.
|
||||
3. Taxes. The user agrees to pay any taxes arising from access
|
||||
to this website or use of the information herein, except for
|
||||
those based on Unicode's net income.
|
||||
4. Severability. If any provision of this Agreement is
|
||||
declared invalid or unenforceable, the remaining provisions of
|
||||
this Agreement shall remain in effect.
|
||||
5. Entire Agreement. This Agreement constitutes the entire
|
||||
agreement between the parties.
|
||||
agreement between the parties.
|
||||
|
||||
EXHIBIT 1
|
||||
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
|
||||
|
@ -1567,7 +1618,7 @@ OR SOFTWARE.
|
|||
|
||||
COPYRIGHT AND PERMISSION NOTICE
|
||||
|
||||
Copyright © 1991-2008 Unicode, Inc. All rights reserved. Distributed under
|
||||
Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under
|
||||
the Terms of Use in http://www.unicode.org/copyright.html.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -2109,131 +2160,32 @@ Public License instead of this License.
|
|||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
pstack (part of GNU Binutils)
|
||||
HandlerSocket plugin for MySQL
|
||||
|
||||
Use of any of this software is governed by the terms of the license below:
|
||||
Copyright (c) 2010 DeNA Co.,Ltd.
|
||||
All rights reserved.
|
||||
|
||||
pstack is comprised of various .c and .h files; all begin like this:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
/* bucomm.h -- binutils common include file.
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of DeNA Co.,Ltd. nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
THIS SOFTWARE IS PROVIDED BY DeNA Co.,Ltd. "AS IS" AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL DeNA Co.,Ltd. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
libiberty.h (part of pstack GNU Binutils)
|
||||
|
||||
Use of any of this software is governed by the terms of the license below:
|
||||
|
||||
See
|
||||
http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx
|
||||
|
||||
/* Function declarations for libiberty.
|
||||
Written by Cygnus Support, 1994.
|
||||
|
||||
The libiberty library provides a number of functions which are
|
||||
missing on some operating systems. We do not declare those here,
|
||||
to avoid conflicts with the system header files on operating
|
||||
systems that do support those functions. In this file we only
|
||||
declare those functions which are specific to libiberty. */
|
||||
|
||||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
ieee.h (part of pstack GNU Binutils)
|
||||
|
||||
Use of any of this software is governed by the terms of the license below:
|
||||
|
||||
See
|
||||
http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h
|
||||
|
||||
|
||||
/* IEEE Standard 695-1980 "Universal Format for Object Modules" header file
|
||||
Contributed by Cygnus Support. */
|
||||
|
||||
***************************************************************************
|
||||
|
||||
%%The following software may be included in this product:
|
||||
pstack.c (part of pstack GNU Binutils)
|
||||
|
||||
Use of any of this software is governed by the terms of the license below:
|
||||
|
||||
/*
|
||||
pstack.c -- asynchronous stack trace of a running process
|
||||
Copyright (c) 1999 Ross Thompson
|
||||
Author: Ross Thompson
|
||||
Critical bug fix: Tim Waugh
|
||||
*/
|
||||
|
||||
/*
|
||||
This file 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; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
***************************************************************************
|
||||
MySQL Server 5.5
|
||||
|
||||
This is a release of MySQL, a dual-license SQL database server.
|
||||
For the avoidance of doubt, this particular copy of the software
|
||||
is released under the version 2 of the GNU General Public License.
|
||||
MySQL is brought to you by Oracle.
|
||||
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
License information can be found in the COPYING file.
|
||||
|
||||
MySQL FOSS License Exception
|
||||
We want free and open source software applications under certain
|
||||
licenses to be able to use specified GPL-licensed MySQL client
|
||||
libraries despite the fact that not all such FOSS licenses are
|
||||
compatible with version 2 of the GNU General Public License.
|
||||
Therefore there are special exceptions to the terms and conditions
|
||||
of the GPLv2 as applied to these client libraries, which are
|
||||
identified and described in more detail in the FOSS License
|
||||
Exception at
|
||||
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
|
||||
|
||||
This distribution may include materials developed by third
|
||||
parties. For license and attribution notices for these
|
||||
materials, please refer to the documentation that accompanies
|
||||
this distribution (see the "Licenses for Third-Party Components"
|
||||
appendix) or view the online documentation at
|
||||
<http://dev.mysql.com/doc/>.
|
||||
|
||||
GPLv2 Disclaimer
|
||||
For the avoidance of doubt, except that if any license choice
|
||||
other than GPL or LGPL is available it will apply instead,
|
||||
Oracle elects to use only the General Public License version 2
|
||||
(GPLv2) at this time for any software where a choice of GPL
|
||||
license versions is made available with the language indicating
|
||||
that GPLv2 or any later version may be used, or where a choice
|
||||
of which version of the GPL is applied is otherwise unspecified.
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ enum options_client
|
|||
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG,
|
||||
OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
|
||||
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
|
||||
OPT_FLUSH_TABLES,
|
||||
OPT_TRIGGERS,
|
||||
OPT_MYSQL_ONLY_PRINT,
|
||||
OPT_MYSQL_LOCK_DIRECTORY,
|
||||
|
@ -86,6 +87,8 @@ enum options_client
|
|||
OPT_DEFAULT_AUTH,
|
||||
OPT_ABORT_SOURCE_ON_ERROR,
|
||||
OPT_REWRITE_DB,
|
||||
OPT_REPORT_PROGRESS,
|
||||
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
|
||||
OPT_MAX_CLIENT_OPTION /* should be always the last */
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (C) 2000-2009 MySQL AB
|
||||
Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright 2000, 2010, Oracle and/or its affiliates.
|
||||
Copyright 2000-2010 Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -45,7 +45,7 @@
|
|||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
const char *VER= "14.16";
|
||||
const char *VER= "15.0";
|
||||
|
||||
/* Don't try to make a nice table if the data is too big */
|
||||
#define MAX_COLUMN_LENGTH 1024
|
||||
|
@ -142,7 +142,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
|
|||
default_pager_set= 0, opt_sigint_ignore= 0,
|
||||
auto_vertical_output= 0,
|
||||
show_warnings= 0, executing_query= 0,
|
||||
ignore_spaces= 0;
|
||||
ignore_spaces= 0, opt_progress_reports;
|
||||
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;
|
||||
|
@ -242,6 +242,13 @@ static void init_username();
|
|||
static void add_int_to_prompt(int toadd);
|
||||
static int get_result_width(MYSQL_RES *res);
|
||||
static int get_field_disp_length(MYSQL_FIELD * field);
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
static uint last_progress_report_length= 0;
|
||||
static void report_progress(const MYSQL *mysql, uint stage, uint max_stage,
|
||||
double progress, const char *proc_info,
|
||||
uint proc_info_length);
|
||||
#endif
|
||||
static void report_progress_end();
|
||||
|
||||
/* A structure which contains information on the commands this program
|
||||
can understand. */
|
||||
|
@ -1018,7 +1025,8 @@ static COMMANDS commands[] = {
|
|||
{ (char *)NULL, 0, 0, 0, ""}
|
||||
};
|
||||
|
||||
static const char *load_default_groups[]= { "mysql","client",0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysql", "client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
static int embedded_server_arg_count= 0;
|
||||
static char *embedded_server_args[MAX_SERVER_ARGS];
|
||||
|
@ -1500,6 +1508,10 @@ static struct my_option my_long_options[] =
|
|||
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||
&opt_mysql_port,
|
||||
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"progress-reports", OPT_REPORT_PROGRESS,
|
||||
"Get progress reports for long running commands (like ALTER TABLE)",
|
||||
&opt_progress_reports, &opt_progress_reports, 0, GET_BOOL, NO_ARG, 1, 0,
|
||||
0, 0, 0, 0},
|
||||
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
|
||||
¤t_prompt, ¤t_prompt, 0, GET_STR_ALLOC,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
|
@ -1821,6 +1833,7 @@ static int get_options(int argc, char **argv)
|
|||
opt_outfile= 0;
|
||||
opt_reconnect= 0;
|
||||
connect_flag= 0; /* Not in interactive mode */
|
||||
opt_progress_reports= 0;
|
||||
}
|
||||
|
||||
if (argc > 1)
|
||||
|
@ -1844,6 +1857,9 @@ static int get_options(int argc, char **argv)
|
|||
if (ignore_spaces)
|
||||
connect_flag|= CLIENT_IGNORE_SPACE;
|
||||
|
||||
if (opt_progress_reports)
|
||||
connect_flag|= CLIENT_PROGRESS;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
@ -3005,6 +3021,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
|||
timer=start_timer();
|
||||
executing_query= 1;
|
||||
error= mysql_real_query_for_lazy(buffer->ptr(),buffer->length());
|
||||
report_progress_end();
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
if (status.add_to_history)
|
||||
|
@ -4425,6 +4442,13 @@ sql_real_connect(char *host,char *database,char *user,char *password,
|
|||
connected=1;
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
mysql.reconnect= debug_info_flag; // We want to know if this happens
|
||||
|
||||
/*
|
||||
CLIENT_PROGRESS is set only if we requsted it in mysql_real_connect()
|
||||
and the server also supports it
|
||||
*/
|
||||
if (mysql.client_flag & CLIENT_PROGRESS)
|
||||
mysql_options(&mysql, MYSQL_PROGRESS_CALLBACK, (void*) report_progress);
|
||||
#else
|
||||
mysql.reconnect= 1;
|
||||
#endif
|
||||
|
@ -5056,3 +5080,32 @@ static int com_prompt(String *buffer __attribute__((unused)),
|
|||
tee_fprintf(stdout, "PROMPT set to '%s'\n", current_prompt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
static void report_progress(const MYSQL *mysql, uint stage, uint max_stage,
|
||||
double progress, const char *proc_info,
|
||||
uint proc_info_length)
|
||||
{
|
||||
uint length= printf("Stage: %d of %d '%.*s' %6.3g%% of stage done",
|
||||
stage, max_stage, proc_info_length, proc_info,
|
||||
progress);
|
||||
if (length < last_progress_report_length)
|
||||
printf("%*s", last_progress_report_length - length, "");
|
||||
putc('\r', stdout);
|
||||
fflush(stdout);
|
||||
last_progress_report_length= length;
|
||||
}
|
||||
|
||||
static void report_progress_end()
|
||||
{
|
||||
if (last_progress_report_length)
|
||||
{
|
||||
printf("%*s\r", last_progress_report_length, "");
|
||||
last_progress_report_length= 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void report_progress_end()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -839,8 +839,10 @@ static int run_sql_fix_privilege_tables(void)
|
|||
|
||||
static const char *load_default_groups[]=
|
||||
{
|
||||
"client", /* Read settings how to connect to server */
|
||||
"mysql_upgrade", /* Read special settings for mysql_upgrade*/
|
||||
"client", /* Read settings how to connect to server */
|
||||
"mysql_upgrade", /* Read special settings for mysql_upgrade */
|
||||
"client-server", /* Reads settings common between client & server */
|
||||
"client-mariadb", /* Read mariadb unique client settings */
|
||||
0
|
||||
};
|
||||
|
||||
|
|
|
@ -222,7 +222,8 @@ static struct my_option my_long_options[] =
|
|||
};
|
||||
|
||||
|
||||
static const char *load_default_groups[]= { "mysqladmin","client",0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqladmin", "client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
|
|
|
@ -68,7 +68,8 @@ static FILE *result_file;
|
|||
#ifndef DBUG_OFF
|
||||
static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
|
||||
#endif
|
||||
static const char *load_groups[]= { "mysqlbinlog","client",0 };
|
||||
static const char *load_groups[]=
|
||||
{ "mysqlbinlog", "client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
static void error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
|
||||
|
@ -86,6 +87,7 @@ static char* database= 0;
|
|||
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
|
||||
static my_bool debug_info_flag, debug_check_flag;
|
||||
static my_bool force_if_open_opt= 1;
|
||||
static my_bool opt_verify_binlog_checksum= 1;
|
||||
static ulonglong offset = 0;
|
||||
static char* host = 0;
|
||||
static int port= 0;
|
||||
|
@ -111,7 +113,8 @@ static my_time_t start_datetime= 0, stop_datetime= MY_TIME_T_MAX;
|
|||
static ulonglong rec_count= 0;
|
||||
static short binlog_flags = 0;
|
||||
static MYSQL* mysql = NULL;
|
||||
static char* dirname_for_local_load= 0;
|
||||
static const char* dirname_for_local_load= 0;
|
||||
static bool opt_skip_annotate_rows_events= 0;
|
||||
|
||||
/**
|
||||
Pointer to the Format_description_log_event of the currently active binlog.
|
||||
|
@ -133,6 +136,71 @@ enum Exit_status {
|
|||
OK_STOP
|
||||
};
|
||||
|
||||
/**
|
||||
Pointer to the last read Annotate_rows_log_event. Having read an
|
||||
Annotate_rows event, we should not print it immediatedly because all
|
||||
subsequent rbr events can be filtered away, and have to keep it for a while.
|
||||
Also because of that when reading a remote Annotate event we have to keep
|
||||
its binary log representation in a separately allocated buffer.
|
||||
*/
|
||||
static Annotate_rows_log_event *annotate_event= NULL;
|
||||
|
||||
void free_annotate_event()
|
||||
{
|
||||
if (annotate_event)
|
||||
{
|
||||
delete annotate_event;
|
||||
annotate_event= 0;
|
||||
}
|
||||
}
|
||||
|
||||
Log_event* read_remote_annotate_event(uchar* net_buf, ulong event_len,
|
||||
const char **error_msg)
|
||||
{
|
||||
uchar *event_buf;
|
||||
Log_event* event;
|
||||
|
||||
if (!(event_buf= (uchar*) my_malloc(event_len + 1, MYF(MY_WME))))
|
||||
{
|
||||
error("Out of memory");
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(event_buf, net_buf, event_len);
|
||||
event_buf[event_len]= 0;
|
||||
|
||||
if (!(event= Log_event::read_log_event((const char*) event_buf, event_len,
|
||||
error_msg, glob_description_event,
|
||||
opt_verify_binlog_checksum)))
|
||||
{
|
||||
my_free(event_buf);
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
Ensure the event->temp_buf is pointing to the allocated buffer.
|
||||
(TRUE = free temp_buf on the event deletion)
|
||||
*/
|
||||
event->register_temp_buf((char*)event_buf, TRUE);
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
void keep_annotate_event(Annotate_rows_log_event* event)
|
||||
{
|
||||
free_annotate_event();
|
||||
annotate_event= event;
|
||||
}
|
||||
|
||||
void print_annotate_event(PRINT_EVENT_INFO *print_event_info)
|
||||
{
|
||||
if (annotate_event)
|
||||
{
|
||||
annotate_event->print(result_file, print_event_info);
|
||||
delete annotate_event; // the event should not be printed more than once
|
||||
annotate_event= 0;
|
||||
}
|
||||
}
|
||||
|
||||
static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
const char* logname);
|
||||
static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
||||
|
@ -648,11 +716,16 @@ static bool shall_skip_database(const char *log_dbname)
|
|||
producing USE statements by corresponding log event print-functions.
|
||||
*/
|
||||
|
||||
void print_use_stmt(PRINT_EVENT_INFO* pinfo, const char* db, size_t db_len)
|
||||
static void
|
||||
print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
|
||||
{
|
||||
const char* db= ev->db;
|
||||
const size_t db_len= ev->db_len;
|
||||
|
||||
// pinfo->db is the current db.
|
||||
// If current db is the same as required db, do nothing.
|
||||
if (!db || !memcmp(pinfo->db, db, db_len + 1))
|
||||
if ((ev->flags & LOG_EVENT_SUPPRESS_USE_F) || !db ||
|
||||
!memcmp(pinfo->db, db, db_len + 1))
|
||||
return;
|
||||
|
||||
// Current db and required db are different.
|
||||
|
@ -750,7 +823,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
read them to be able to process the wanted events.
|
||||
*/
|
||||
if (((rec_count >= offset) &&
|
||||
((my_time_t)(ev->when) >= start_datetime)) ||
|
||||
(ev->when >= start_datetime)) ||
|
||||
(ev_type == FORMAT_DESCRIPTION_EVENT))
|
||||
{
|
||||
if (ev_type != FORMAT_DESCRIPTION_EVENT)
|
||||
|
@ -774,7 +847,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
server_id && (server_id != ev->server_id))
|
||||
goto end;
|
||||
}
|
||||
if (((my_time_t)(ev->when) >= stop_datetime)
|
||||
if ((ev->when >= stop_datetime)
|
||||
|| (pos >= stop_position_mot))
|
||||
{
|
||||
/* end the program */
|
||||
|
@ -797,9 +870,20 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
case QUERY_EVENT:
|
||||
{
|
||||
Query_log_event *qe= (Query_log_event*)ev;
|
||||
if (!qe->is_trans_keyword() && shall_skip_database(qe->db))
|
||||
goto end;
|
||||
print_use_stmt(print_event_info, qe->db, qe->db_len);
|
||||
if (!qe->is_trans_keyword())
|
||||
{
|
||||
if (shall_skip_database(qe->db))
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
In case the event for one of these statements is obtained
|
||||
from binary log 5.0, make it compatible with 5.1
|
||||
*/
|
||||
qe->flags|= LOG_EVENT_SUPPRESS_USE_F;
|
||||
}
|
||||
print_use_stmt(print_event_info, qe);
|
||||
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
|
||||
{
|
||||
if ((retval= write_event_header_and_base64(ev, result_file,
|
||||
|
@ -938,7 +1022,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
|
||||
if (!shall_skip_database(exlq->db))
|
||||
{
|
||||
print_use_stmt(print_event_info, exlq->db, exlq->db_len);
|
||||
print_use_stmt(print_event_info, exlq);
|
||||
if (fname)
|
||||
{
|
||||
convert_path_to_forward_slashes(fname);
|
||||
|
@ -953,6 +1037,19 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
my_free(fname);
|
||||
break;
|
||||
}
|
||||
case ANNOTATE_ROWS_EVENT:
|
||||
if (!opt_skip_annotate_rows_events)
|
||||
{
|
||||
/*
|
||||
We don't print Annotate event just now because all subsequent
|
||||
rbr-events can be filtered away. Instead we'll keep the event
|
||||
till it will be printed together with the first not filtered
|
||||
away Table map or the last rbr will be processed.
|
||||
*/
|
||||
keep_annotate_event((Annotate_rows_log_event*) ev);
|
||||
destroy_evt= FALSE;
|
||||
}
|
||||
break;
|
||||
case TABLE_MAP_EVENT:
|
||||
{
|
||||
Table_map_log_event *map= ((Table_map_log_event *)ev);
|
||||
|
@ -962,6 +1059,13 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
destroy_evt= FALSE;
|
||||
goto end;
|
||||
}
|
||||
/*
|
||||
The Table map is to be printed, so it's just the time when we may
|
||||
print the kept Annotate event (if there is any).
|
||||
print_annotate_event() also deletes the kept Annotate event.
|
||||
*/
|
||||
print_annotate_event(print_event_info);
|
||||
|
||||
size_t len_to= 0;
|
||||
const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(), &len_to);
|
||||
if (len_to && map->rewrite_db(db_to, len_to, glob_description_event))
|
||||
|
@ -998,6 +1102,13 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
|
|||
if (print_event_info->m_table_map_ignored.count() > 0)
|
||||
print_event_info->m_table_map_ignored.clear_tables();
|
||||
|
||||
/*
|
||||
If there is a kept Annotate event and all corresponding
|
||||
rbr-events were filtered away, the Annotate event was not
|
||||
freed and it is just the time to do it.
|
||||
*/
|
||||
free_annotate_event();
|
||||
|
||||
/*
|
||||
One needs to take into account an event that gets
|
||||
filtered but was last event in the statement. If this is
|
||||
|
@ -1228,10 +1339,18 @@ that may lead to an endless loop.",
|
|||
"Used to reserve file descriptors for use by this program.",
|
||||
&open_files_limit, &open_files_limit, 0, GET_ULONG,
|
||||
REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
|
||||
{"verify-binlog-checksum", 'c', "Verify checksum binlog events.",
|
||||
(uchar**) &opt_verify_binlog_checksum, (uchar**) &opt_verify_binlog_checksum,
|
||||
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"rewrite-db", OPT_REWRITE_DB,
|
||||
"Updates to a database with a different name than the original. \
|
||||
Example: rewrite-db='from->to'.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"skip-annotate-rows-events", OPT_SKIP_ANNOTATE_ROWS_EVENTS,
|
||||
"Don't print Annotate_rows events stored in the binary log.",
|
||||
(uchar**) &opt_skip_annotate_rows_events,
|
||||
(uchar**) &opt_skip_annotate_rows_events,
|
||||
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}
|
||||
};
|
||||
|
||||
|
@ -1307,7 +1426,7 @@ static void cleanup()
|
|||
my_free(database);
|
||||
my_free(host);
|
||||
my_free(user);
|
||||
my_free(dirname_for_local_load);
|
||||
my_free(const_cast<char*>(dirname_for_local_load));
|
||||
|
||||
delete glob_description_event;
|
||||
if (mysql)
|
||||
|
@ -1339,7 +1458,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
|
|||
int was_cut;
|
||||
MYSQL_TIME l_time;
|
||||
long dummy_my_timezone;
|
||||
my_bool dummy_in_dst_time_gap;
|
||||
uint dummy_in_dst_time_gap;
|
||||
/* We require a total specification (date AND time) */
|
||||
if (str_to_datetime(str, (uint) strlen(str), &l_time, 0, &was_cut) !=
|
||||
MYSQL_TIMESTAMP_DATETIME || was_cut)
|
||||
|
@ -1503,7 +1622,7 @@ static int parse_args(int *argc, char*** argv)
|
|||
*/
|
||||
static Exit_status safe_connect()
|
||||
{
|
||||
/* Close and old connections to MySQL */
|
||||
/* Close any old connections to MySQL */
|
||||
if (mysql)
|
||||
mysql_close(mysql);
|
||||
|
||||
|
@ -1613,7 +1732,18 @@ static Exit_status check_master_version()
|
|||
"Master reported NULL for the version.");
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
Make a notice to the server that this client
|
||||
is checksum-aware. It does not need the first fake Rotate
|
||||
necessary checksummed.
|
||||
That preference is specified below.
|
||||
*/
|
||||
if (mysql_query(mysql, "SET @master_binlog_checksum='NONE'"))
|
||||
{
|
||||
error("Could not notify master about checksum awareness."
|
||||
"Master returned '%s'", mysql_error(mysql));
|
||||
goto err;
|
||||
}
|
||||
delete glob_description_event;
|
||||
switch (*version) {
|
||||
case '3':
|
||||
|
@ -1695,6 +1825,8 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
cast to uint32.
|
||||
*/
|
||||
int4store(buf, (uint32)start_position);
|
||||
if (!opt_skip_annotate_rows_events)
|
||||
binlog_flags|= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
|
||||
int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
|
||||
|
||||
size_t tlen = strlen(logname);
|
||||
|
@ -1727,18 +1859,31 @@ static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
break; // end of data
|
||||
DBUG_PRINT("info",( "len: %lu net->read_pos[5]: %d\n",
|
||||
len, net->read_pos[5]));
|
||||
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
|
||||
len - 1, &error_msg,
|
||||
glob_description_event)))
|
||||
if (net->read_pos[5] == ANNOTATE_ROWS_EVENT)
|
||||
{
|
||||
error("Could not construct log event object: %s", error_msg);
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
}
|
||||
/*
|
||||
If reading from a remote host, ensure the temp_buf for the
|
||||
Log_event class is pointing to the incoming stream.
|
||||
*/
|
||||
ev->register_temp_buf((char *) net->read_pos + 1, FALSE);
|
||||
if (!(ev= read_remote_annotate_event(net->read_pos + 1, len - 1,
|
||||
&error_msg)))
|
||||
{
|
||||
error("Could not construct annotate event object: %s", error_msg);
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
|
||||
len - 1, &error_msg,
|
||||
glob_description_event,
|
||||
opt_verify_binlog_checksum)))
|
||||
{
|
||||
error("Could not construct log event object: %s", error_msg);
|
||||
DBUG_RETURN(ERROR_STOP);
|
||||
}
|
||||
/*
|
||||
If reading from a remote host, ensure the temp_buf for the
|
||||
Log_event class is pointing to the incoming stream.
|
||||
*/
|
||||
ev->register_temp_buf((char *) net->read_pos + 1, FALSE);
|
||||
}
|
||||
|
||||
Log_event_type type= ev->get_type_code();
|
||||
if (glob_description_event->binlog_version >= 3 ||
|
||||
|
@ -1956,7 +2101,8 @@ static Exit_status check_header(IO_CACHE* file,
|
|||
Format_description_log_event *new_description_event;
|
||||
my_b_seek(file, tmp_pos); /* seek back to event's start */
|
||||
if (!(new_description_event= (Format_description_log_event*)
|
||||
Log_event::read_log_event(file, glob_description_event)))
|
||||
Log_event::read_log_event(file, glob_description_event,
|
||||
opt_verify_binlog_checksum)))
|
||||
/* EOF can't be hit here normally, so it's a real error */
|
||||
{
|
||||
error("Could not read a Format_description_log_event event at "
|
||||
|
@ -1989,7 +2135,8 @@ static Exit_status check_header(IO_CACHE* file,
|
|||
{
|
||||
Log_event *ev;
|
||||
my_b_seek(file, tmp_pos); /* seek back to event's start */
|
||||
if (!(ev= Log_event::read_log_event(file, glob_description_event)))
|
||||
if (!(ev= Log_event::read_log_event(file, glob_description_event,
|
||||
opt_verify_binlog_checksum)))
|
||||
{
|
||||
/* EOF can't be hit here normally, so it's a real error */
|
||||
error("Could not read a Rotate_log_event event at offset %llu;"
|
||||
|
@ -2102,7 +2249,8 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
|
|||
char llbuff[21];
|
||||
my_off_t old_off = my_b_tell(file);
|
||||
|
||||
Log_event* ev = Log_event::read_log_event(file, glob_description_event);
|
||||
Log_event* ev = Log_event::read_log_event(file, glob_description_event,
|
||||
opt_verify_binlog_checksum);
|
||||
if (!ev)
|
||||
{
|
||||
/*
|
||||
|
@ -2256,6 +2404,7 @@ int main(int argc, char** argv)
|
|||
if (result_file != stdout)
|
||||
my_fclose(result_file, MYF(0));
|
||||
cleanup();
|
||||
free_annotate_event();
|
||||
delete binlog_filter;
|
||||
free_root(&s_mem_root, MYF(0));
|
||||
free_defaults(defaults_argv);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
|
||||
|
||||
#define CHECK_VERSION "2.6.0"
|
||||
#define CHECK_VERSION "2.7.0"
|
||||
|
||||
#include "client_priv.h"
|
||||
#include <m_ctype.h>
|
||||
|
@ -36,8 +36,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
|
|||
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
|
||||
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
|
||||
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
|
||||
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
|
||||
opt_write_binlog= 1;
|
||||
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0;
|
||||
static my_bool opt_write_binlog= 1, opt_flush_tables= 0;
|
||||
static uint verbose = 0, opt_mysql_port=0;
|
||||
static int my_end_arg;
|
||||
static char * opt_mysql_unix_port = 0;
|
||||
|
@ -123,6 +123,9 @@ static struct my_option my_long_options[] =
|
|||
"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.",
|
||||
&opt_extended, &opt_extended, 0, GET_BOOL, NO_ARG, 0, 0, 0,
|
||||
0, 0, 0},
|
||||
{"flush", OPT_FLUSH_TABLES, "Flush each table after check. This is useful if you don't want to have the checked tables take up space in the caches after the check",
|
||||
&opt_flush_tables, &opt_flush_tables, 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.", ¤t_host,
|
||||
|
@ -192,7 +195,8 @@ static struct my_option my_long_options[] =
|
|||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static const char *load_default_groups[] = { "mysqlcheck", "client", 0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqlcheck", "client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
|
||||
static void print_version(void);
|
||||
|
@ -740,6 +744,7 @@ static int disable_binlog()
|
|||
static int handle_request_for_tables(char *tables, uint length)
|
||||
{
|
||||
char *query, *end, options[100], message[100];
|
||||
char table_name_buff[NAME_CHAR_LEN*2*2+1], *table_name;
|
||||
uint query_length= 0;
|
||||
const char *op = 0;
|
||||
DBUG_ENTER("handle_request_for_tables");
|
||||
|
@ -778,13 +783,17 @@ static int handle_request_for_tables(char *tables, uint length)
|
|||
{
|
||||
/* No backticks here as we added them before */
|
||||
query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
|
||||
table_name= tables;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *ptr;
|
||||
char *ptr, *org;
|
||||
|
||||
ptr= strmov(strmov(query, op), " TABLE ");
|
||||
org= ptr= strmov(strmov(query, op), " TABLE ");
|
||||
ptr= fix_table_name(ptr, tables);
|
||||
strmake(table_name_buff, org, min((int) sizeof(table_name_buff)-1,
|
||||
(int) (ptr - org)));
|
||||
table_name= table_name_buff;
|
||||
ptr= strxmov(ptr, " ", options, NullS);
|
||||
query_length= (uint) (ptr - query);
|
||||
}
|
||||
|
@ -792,9 +801,20 @@ static int handle_request_for_tables(char *tables, uint length)
|
|||
{
|
||||
sprintf(message, "when executing '%s TABLE ... %s'", op, options);
|
||||
DBerror(sock, message);
|
||||
my_free(query);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
print_result();
|
||||
if (opt_flush_tables)
|
||||
{
|
||||
query_length= sprintf(query, "FLUSH TABLES %s", table_name);
|
||||
if (mysql_real_query(sock, query, query_length))
|
||||
{
|
||||
DBerror(sock, query);
|
||||
my_free(query);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
my_free(query);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
|
||||
*/
|
||||
|
||||
#define DUMP_VERSION "10.13"
|
||||
#define DUMP_VERSION "10.14"
|
||||
|
||||
#include <my_global.h>
|
||||
#include <my_sys.h>
|
||||
|
@ -78,6 +78,9 @@
|
|||
#define IGNORE_DATA 0x01 /* don't dump data for this table */
|
||||
#define IGNORE_INSERT_DELAYED 0x02 /* table doesn't support INSERT DELAYED */
|
||||
|
||||
/* Chars needed to store LONGLONG, excluding trailing '\0'. */
|
||||
#define LONGLONG_LEN 20
|
||||
|
||||
static void add_load_option(DYNAMIC_STRING *str, const char *option,
|
||||
const char *option_value);
|
||||
static ulong find_set(TYPELIB *lib, const char *x, uint length,
|
||||
|
@ -368,9 +371,9 @@ static struct my_option my_long_options[] =
|
|||
"This causes the binary log position and filename to be appended to the "
|
||||
"output. If equal to 1, will print it as a CHANGE MASTER command; if equal"
|
||||
" to 2, that command will be prefixed with a comment symbol. "
|
||||
"This option will turn --lock-all-tables on, unless "
|
||||
"--single-transaction is specified too (in which case a "
|
||||
"global read lock is only taken a short time at the beginning of the dump; "
|
||||
"This option will turn --lock-all-tables on, unless --single-transaction "
|
||||
"is specified too (on servers before MariaDB 5.3 this will still take a "
|
||||
"global read lock for a short time at the beginning of the dump; "
|
||||
"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.",
|
||||
|
@ -510,7 +513,8 @@ static struct my_option my_long_options[] =
|
|||
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static const char *load_default_groups[]= { "mysqldump","client",0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqldump", "client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
static void maybe_exit(int error);
|
||||
static void die(int error, const char* reason, ...);
|
||||
|
@ -655,8 +659,13 @@ static void write_header(FILE *sql_file, char *db_name)
|
|||
|
||||
if (!path)
|
||||
{
|
||||
if (!opt_no_create_info)
|
||||
{
|
||||
/* We don't need unique checks as the table is created just before */
|
||||
fprintf(md_result_file,"\
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n");
|
||||
}
|
||||
fprintf(md_result_file,"\
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n\
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n\
|
||||
");
|
||||
}
|
||||
|
@ -686,8 +695,12 @@ static void write_footer(FILE *sql_file)
|
|||
if (!path)
|
||||
{
|
||||
fprintf(md_result_file,"\
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n\
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n");
|
||||
if (!opt_no_create_info)
|
||||
{
|
||||
fprintf(md_result_file,"\
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n");
|
||||
}
|
||||
}
|
||||
if (opt_set_charset)
|
||||
fprintf(sql_file,
|
||||
|
@ -1128,6 +1141,44 @@ static int fetch_db_collation(const char *db_name,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Check if server supports non-blocking binlog position using the
|
||||
binlog_snapshot_file and binlog_snapshot_position status variables. If it
|
||||
does, also return the position obtained if output pointers are non-NULL.
|
||||
Returns 1 if position available, 0 if not.
|
||||
*/
|
||||
static int
|
||||
check_consistent_binlog_pos(char *binlog_pos_file, char *binlog_pos_offset)
|
||||
{
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
int found;
|
||||
|
||||
if (mysql_query_with_error_report(mysql, &res,
|
||||
"SHOW STATUS LIKE 'binlog_snapshot_%'"))
|
||||
return 1;
|
||||
|
||||
found= 0;
|
||||
while ((row= mysql_fetch_row(res)))
|
||||
{
|
||||
if (0 == strcmp(row[0], "binlog_snapshot_file"))
|
||||
{
|
||||
if (binlog_pos_file)
|
||||
strmake(binlog_pos_file, row[1], FN_REFLEN-1);
|
||||
found++;
|
||||
}
|
||||
else if (0 == strcmp(row[0], "binlog_snapshot_position"))
|
||||
{
|
||||
if (binlog_pos_offset)
|
||||
strmake(binlog_pos_offset, row[1], LONGLONG_LEN);
|
||||
found++;
|
||||
}
|
||||
}
|
||||
mysql_free_result(res);
|
||||
|
||||
return (found == 2);
|
||||
}
|
||||
|
||||
static char *my_case_str(const char *str,
|
||||
uint str_len,
|
||||
const char *token,
|
||||
|
@ -4369,42 +4420,65 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||
} /* dump_selected_tables */
|
||||
|
||||
|
||||
static int do_show_master_status(MYSQL *mysql_con)
|
||||
static int do_show_master_status(MYSQL *mysql_con, int consistent_binlog_pos)
|
||||
{
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *master;
|
||||
char binlog_pos_file[FN_REFLEN];
|
||||
char binlog_pos_offset[LONGLONG_LEN+1];
|
||||
char *file, *offset;
|
||||
const char *comment_prefix=
|
||||
(opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : "";
|
||||
if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS"))
|
||||
|
||||
if (consistent_binlog_pos)
|
||||
{
|
||||
return 1;
|
||||
if(!check_consistent_binlog_pos(binlog_pos_file, binlog_pos_offset))
|
||||
return 1;
|
||||
file= binlog_pos_file;
|
||||
offset= binlog_pos_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS"))
|
||||
return 1;
|
||||
|
||||
row= mysql_fetch_row(master);
|
||||
if (row && row[0] && row[1])
|
||||
{
|
||||
/* SHOW MASTER STATUS reports file and position */
|
||||
if (opt_comments)
|
||||
fprintf(md_result_file,
|
||||
"\n--\n-- Position to start replication or point-in-time "
|
||||
"recovery from\n--\n\n");
|
||||
fprintf(md_result_file,
|
||||
"%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n",
|
||||
comment_prefix, row[0], row[1]);
|
||||
check_io(md_result_file);
|
||||
file= row[0];
|
||||
offset= row[1];
|
||||
}
|
||||
else if (!ignore_errors)
|
||||
else
|
||||
{
|
||||
/* SHOW MASTER STATUS reports nothing and --force is not enabled */
|
||||
my_printf_error(0, "Error: Binlogging on server not active",
|
||||
MYF(0));
|
||||
mysql_free_result(master);
|
||||
maybe_exit(EX_MYSQLERR);
|
||||
return 1;
|
||||
if (!ignore_errors)
|
||||
{
|
||||
/* SHOW MASTER STATUS reports nothing and --force is not enabled */
|
||||
my_printf_error(0, "Error: Binlogging on server not active",
|
||||
MYF(0));
|
||||
maybe_exit(EX_MYSQLERR);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
mysql_free_result(master);
|
||||
}
|
||||
|
||||
/* SHOW MASTER STATUS reports file and position */
|
||||
if (opt_comments)
|
||||
fprintf(md_result_file,
|
||||
"\n--\n-- Position to start replication or point-in-time "
|
||||
"recovery from\n--\n\n");
|
||||
fprintf(md_result_file,
|
||||
"%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n",
|
||||
comment_prefix, file, offset);
|
||||
check_io(md_result_file);
|
||||
|
||||
if (!consistent_binlog_pos)
|
||||
mysql_free_result(master);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -5167,6 +5241,7 @@ int main(int argc, char **argv)
|
|||
{
|
||||
char bin_log_name[FN_REFLEN];
|
||||
int exit_code;
|
||||
int consistent_binlog_pos= 0;
|
||||
MY_INIT("mysqldump");
|
||||
|
||||
compatible_mode_normal_str[0]= 0;
|
||||
|
@ -5200,7 +5275,13 @@ int main(int argc, char **argv)
|
|||
if (opt_slave_data && do_stop_slave_sql(mysql))
|
||||
goto err;
|
||||
|
||||
if ((opt_lock_all_tables || opt_master_data) &&
|
||||
if (opt_single_transaction && opt_master_data)
|
||||
{
|
||||
/* See if we can avoid FLUSH TABLES WITH READ LOCK (MariaDB 5.3+). */
|
||||
consistent_binlog_pos= check_consistent_binlog_pos(NULL, NULL);
|
||||
}
|
||||
|
||||
if ((opt_lock_all_tables || (opt_master_data && !consistent_binlog_pos)) &&
|
||||
do_flush_tables_read_lock(mysql))
|
||||
goto err;
|
||||
if (opt_single_transaction && start_transaction(mysql))
|
||||
|
@ -5218,10 +5299,11 @@ int main(int argc, char **argv)
|
|||
goto err;
|
||||
flush_logs= 0; /* not anymore; that would not be sensible */
|
||||
}
|
||||
|
||||
/* Add 'STOP SLAVE to beginning of dump */
|
||||
if (opt_slave_apply && add_stop_slave())
|
||||
goto err;
|
||||
if (opt_master_data && do_show_master_status(mysql))
|
||||
if (opt_master_data && do_show_master_status(mysql, consistent_binlog_pos))
|
||||
goto err;
|
||||
if (opt_slave_data && do_show_slave_status(mysql))
|
||||
goto err;
|
||||
|
|
|
@ -188,7 +188,8 @@ static struct my_option my_long_options[] =
|
|||
};
|
||||
|
||||
|
||||
static const char *load_default_groups[]= { "mysqlimport","client",0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqlimport","client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
|
||||
static void print_version(void)
|
||||
|
|
|
@ -55,7 +55,8 @@ static void print_res_header(MYSQL_RES *result);
|
|||
static void print_res_top(MYSQL_RES *result);
|
||||
static void print_res_row(MYSQL_RES *result,MYSQL_ROW cur);
|
||||
|
||||
static const char *load_default_groups[]= { "mysqlshow","client",0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqlshow","client", "client-server", "client-mariadb", 0 };
|
||||
static char * opt_mysql_unix_port=0;
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
|
|
@ -175,7 +175,8 @@ static uint opt_protocol= 0;
|
|||
static int get_options(int *argc,char ***argv);
|
||||
static uint opt_mysql_port= 0;
|
||||
|
||||
static const char *load_default_groups[]= { "mysqlslap","client",0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqlslap", "client", "client-server", "client-mariadb", 0 };
|
||||
|
||||
typedef struct statement statement;
|
||||
|
||||
|
@ -1384,9 +1385,9 @@ get_options(int *argc,char ***argv)
|
|||
fprintf(stderr,"%s: Could not open create file\n", my_progname);
|
||||
exit(1);
|
||||
}
|
||||
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
|
||||
tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
|
||||
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
|
||||
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
|
||||
my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
|
||||
tmp_string[sbuf.st_size]= '\0';
|
||||
my_close(data_file,MYF(0));
|
||||
parse_delimiter(tmp_string, &create_statements, delimiter[0]);
|
||||
|
@ -1411,9 +1412,9 @@ get_options(int *argc,char ***argv)
|
|||
fprintf(stderr,"%s: Could not open query supplied file\n", my_progname);
|
||||
exit(1);
|
||||
}
|
||||
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
|
||||
tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
|
||||
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
|
||||
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
|
||||
my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
|
||||
tmp_string[sbuf.st_size]= '\0';
|
||||
my_close(data_file,MYF(0));
|
||||
if (user_supplied_query)
|
||||
|
@ -1442,9 +1443,9 @@ get_options(int *argc,char ***argv)
|
|||
fprintf(stderr,"%s: Could not open query supplied file\n", my_progname);
|
||||
exit(1);
|
||||
}
|
||||
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
|
||||
tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
|
||||
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
|
||||
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
|
||||
my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
|
||||
tmp_string[sbuf.st_size]= '\0';
|
||||
my_close(data_file,MYF(0));
|
||||
if (user_supplied_pre_statements)
|
||||
|
@ -1473,9 +1474,9 @@ get_options(int *argc,char ***argv)
|
|||
fprintf(stderr,"%s: Could not open query supplied file\n", my_progname);
|
||||
exit(1);
|
||||
}
|
||||
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
|
||||
tmp_string= (char *)my_malloc((size_t)sbuf.st_size + 1,
|
||||
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
|
||||
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
|
||||
my_read(data_file, (uchar*) tmp_string, (size_t)sbuf.st_size, MYF(0));
|
||||
tmp_string[sbuf.st_size]= '\0';
|
||||
my_close(data_file,MYF(0));
|
||||
if (user_supplied_post_statements)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011 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
|
||||
|
@ -70,7 +71,7 @@
|
|||
#define MAX_COLUMNS 256
|
||||
#define MAX_EMBEDDED_SERVER_ARGS 64
|
||||
#define MAX_DELIMITER_LENGTH 16
|
||||
#define DEFAULT_MAX_CONN 128
|
||||
#define DEFAULT_MAX_CONN 64
|
||||
|
||||
/* Flags controlling send and reap */
|
||||
#define QUERY_SEND_FLAG 1
|
||||
|
@ -117,14 +118,15 @@ static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
|
|||
display_metadata= FALSE, display_result_sorted= FALSE;
|
||||
static my_bool disable_query_log= 0, disable_result_log= 0;
|
||||
static my_bool disable_connect_log= 1;
|
||||
static my_bool disable_warnings= 0;
|
||||
static my_bool disable_warnings= 0, disable_column_names= 0;
|
||||
static my_bool prepare_warnings_enabled= 0;
|
||||
static my_bool disable_info= 1;
|
||||
static my_bool abort_on_error= 1;
|
||||
static my_bool server_initialized= 0;
|
||||
static my_bool is_windows= 0;
|
||||
static char **default_argv;
|
||||
static const char *load_default_groups[]= { "mysqltest", "client", 0 };
|
||||
static const char *load_default_groups[]=
|
||||
{ "mysqltest", "client", "client-server", "client-mariadb", 0 };
|
||||
static char line_buffer[MAX_DELIMITER_LENGTH], *line_buffer_pos= line_buffer;
|
||||
|
||||
static uint start_lineno= 0; /* Start line of current command */
|
||||
|
@ -142,6 +144,7 @@ static char TMPDIR[FN_REFLEN];
|
|||
static char global_subst_from[200];
|
||||
static char global_subst_to[200];
|
||||
static char *global_subst= NULL;
|
||||
static MEM_ROOT require_file_root;
|
||||
|
||||
/* Block stack */
|
||||
enum block_cmd {
|
||||
|
@ -254,7 +257,7 @@ HASH var_hash;
|
|||
|
||||
struct st_connection
|
||||
{
|
||||
MYSQL mysql;
|
||||
MYSQL *mysql;
|
||||
/* Used when creating views and sp, to avoid implicit commit */
|
||||
MYSQL* util_mysql;
|
||||
char *name;
|
||||
|
@ -308,6 +311,7 @@ enum enum_commands {
|
|||
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
|
||||
Q_ENABLE_INFO, Q_DISABLE_INFO,
|
||||
Q_ENABLE_METADATA, Q_DISABLE_METADATA,
|
||||
Q_ENABLE_COLUMN_NAMES, Q_DISABLE_COLUMN_NAMES,
|
||||
Q_EXEC, Q_DELIMITER,
|
||||
Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
|
||||
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
|
||||
|
@ -379,6 +383,8 @@ const char *command_names[]=
|
|||
"disable_info",
|
||||
"enable_metadata",
|
||||
"disable_metadata",
|
||||
"enable_column_names",
|
||||
"disable_column_names",
|
||||
"exec",
|
||||
"delimiter",
|
||||
"disable_abort_on_error",
|
||||
|
@ -472,7 +478,7 @@ struct st_command
|
|||
int first_word_len, query_len;
|
||||
my_bool abort_on_error, used_replace;
|
||||
struct st_expected_errors expected_errors;
|
||||
char require_file[FN_REFLEN];
|
||||
char *require_file;
|
||||
enum enum_commands type;
|
||||
};
|
||||
|
||||
|
@ -611,6 +617,10 @@ public:
|
|||
DBUG_VOID_RETURN;
|
||||
DBUG_ASSERT(ds->str);
|
||||
|
||||
#ifdef EXTRA_DEBUG
|
||||
DBUG_PRINT("QQ", ("str: %*s", (int) ds->length, ds->str));
|
||||
#endif
|
||||
|
||||
if (fwrite(ds->str, 1, ds->length, m_file) != ds->length)
|
||||
die("Failed to write %lu bytes to '%s', errno: %d",
|
||||
(unsigned long)ds->length, m_file_name, errno);
|
||||
|
@ -772,10 +782,10 @@ pthread_handler_t connection_thread(void *arg)
|
|||
case EMB_END_CONNECTION:
|
||||
goto end_thread;
|
||||
case EMB_SEND_QUERY:
|
||||
cn->result= mysql_send_query(&cn->mysql, cn->cur_query, cn->cur_query_len);
|
||||
cn->result= mysql_send_query(cn->mysql, cn->cur_query, cn->cur_query_len);
|
||||
break;
|
||||
case EMB_READ_QUERY_RESULT:
|
||||
cn->result= mysql_read_query_result(&cn->mysql);
|
||||
cn->result= mysql_read_query_result(cn->mysql);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0);
|
||||
|
@ -828,7 +838,7 @@ static void signal_connection_thd(struct st_connection *cn, int command)
|
|||
static int do_send_query(struct st_connection *cn, const char *q, int q_len)
|
||||
{
|
||||
if (!cn->has_thread)
|
||||
return mysql_send_query(&cn->mysql, q, q_len);
|
||||
return mysql_send_query(cn->mysql, q, q_len);
|
||||
cn->cur_query= q;
|
||||
cn->cur_query_len= q_len;
|
||||
signal_connection_thd(cn, EMB_SEND_QUERY);
|
||||
|
@ -876,8 +886,8 @@ static void init_connection_thd(struct st_connection *cn)
|
|||
|
||||
#else /*EMBEDDED_LIBRARY*/
|
||||
|
||||
#define do_send_query(cn,q,q_len) mysql_send_query(&cn->mysql, q, q_len)
|
||||
#define do_read_query_result(cn) mysql_read_query_result(&cn->mysql)
|
||||
#define do_send_query(cn,q,q_len) mysql_send_query(cn->mysql, q, q_len)
|
||||
#define do_read_query_result(cn) mysql_read_query_result(cn->mysql)
|
||||
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
|
||||
|
@ -1189,8 +1199,9 @@ void handle_command_error(struct st_command *command, uint error,
|
|||
int i;
|
||||
|
||||
if (command->abort_on_error)
|
||||
die("command \"%.*s\" failed with error %d. my_errno=%d",
|
||||
command->first_word_len, command->query, error, my_errno);
|
||||
die("command \"%.*s\" failed with error: %u my_errno: %d errno: %d",
|
||||
command->first_word_len, command->query, error, my_errno,
|
||||
sys_errno);
|
||||
|
||||
i= match_expected_error(command, error, NULL);
|
||||
|
||||
|
@ -1202,8 +1213,8 @@ void handle_command_error(struct st_command *command, uint error,
|
|||
DBUG_VOID_RETURN;
|
||||
}
|
||||
if (command->expected_errors.count > 0)
|
||||
die("command \"%.*s\" failed with wrong error: %u, errno: %d",
|
||||
command->first_word_len, command->query, error, sys_errno);
|
||||
die("command \"%.*s\" failed with wrong error: %u my_errno: %d errno: %d",
|
||||
command->first_word_len, command->query, error, my_errno, sys_errno);
|
||||
}
|
||||
else if (command->expected_errors.err[0].type == ERR_ERRNO &&
|
||||
command->expected_errors.err[0].code.errnum != 0)
|
||||
|
@ -1228,7 +1239,8 @@ void close_connections()
|
|||
if (next_con->stmt)
|
||||
mysql_stmt_close(next_con->stmt);
|
||||
next_con->stmt= 0;
|
||||
mysql_close(&next_con->mysql);
|
||||
mysql_close(next_con->mysql);
|
||||
next_con->mysql= 0;
|
||||
if (next_con->util_mysql)
|
||||
mysql_close(next_con->util_mysql);
|
||||
my_free(next_con->name);
|
||||
|
@ -1301,24 +1313,24 @@ void free_used_memory()
|
|||
free_all_replace();
|
||||
my_free(opt_pass);
|
||||
free_defaults(default_argv);
|
||||
free_root(&require_file_root, MYF(0));
|
||||
free_re();
|
||||
#ifdef __WIN__
|
||||
free_tmp_sh_file();
|
||||
free_win_path_patterns();
|
||||
#endif
|
||||
|
||||
/* Only call mysql_server_end if mysql_server_init has been called */
|
||||
if (server_initialized)
|
||||
mysql_server_end();
|
||||
|
||||
/* Don't use DBUG after mysql_server_end() */
|
||||
return;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
static void cleanup_and_exit(int exit_code)
|
||||
{
|
||||
free_used_memory();
|
||||
|
||||
/* Only call mysql_server_end if mysql_server_init has been called */
|
||||
if (server_initialized)
|
||||
mysql_server_end();
|
||||
|
||||
/*
|
||||
mysqltest is fundamentally written in a way that makes impossible
|
||||
to free all memory before exit (consider memory allocated
|
||||
|
@ -1328,6 +1340,7 @@ static void cleanup_and_exit(int exit_code)
|
|||
from polluting the output.
|
||||
*/
|
||||
fclose(stderr);
|
||||
|
||||
my_end(my_end_arg);
|
||||
|
||||
if (!silent) {
|
||||
|
@ -1352,12 +1365,17 @@ static void cleanup_and_exit(int exit_code)
|
|||
|
||||
void print_file_stack()
|
||||
{
|
||||
for (struct st_test_file* err_file= cur_file;
|
||||
err_file != file_stack;
|
||||
err_file--)
|
||||
struct st_test_file* err_file= cur_file;
|
||||
if (err_file == file_stack)
|
||||
return;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
err_file--;
|
||||
fprintf(stderr, "included from %s at line %d:\n",
|
||||
err_file->file_name, err_file->lineno);
|
||||
if (err_file == file_stack)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1368,6 +1386,7 @@ void die(const char *fmt, ...)
|
|||
DBUG_ENTER("die");
|
||||
DBUG_PRINT("enter", ("start_lineno: %d", start_lineno));
|
||||
|
||||
fflush(stdout);
|
||||
/* Print the error message */
|
||||
fprintf(stderr, "mysqltest: ");
|
||||
if (cur_file && cur_file != file_stack)
|
||||
|
@ -1406,7 +1425,7 @@ void die(const char *fmt, ...)
|
|||
been produced prior to the error
|
||||
*/
|
||||
if (cur_con && !cur_con->pending)
|
||||
show_warnings_before_error(&cur_con->mysql);
|
||||
show_warnings_before_error(cur_con->mysql);
|
||||
|
||||
cleanup_and_exit(1);
|
||||
}
|
||||
|
@ -1450,9 +1469,12 @@ void verbose_msg(const char *fmt, ...)
|
|||
{
|
||||
va_list args;
|
||||
DBUG_ENTER("verbose_msg");
|
||||
DBUG_PRINT("enter", ("format: %s", fmt));
|
||||
|
||||
if (!verbose)
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
fflush(stdout);
|
||||
va_start(args, fmt);
|
||||
fprintf(stderr, "mysqltest: ");
|
||||
if (cur_file && cur_file != file_stack)
|
||||
|
@ -1463,6 +1485,7 @@ void verbose_msg(const char *fmt, ...)
|
|||
vfprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
fflush(stderr);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -1547,6 +1570,8 @@ static int run_command(char* cmd,
|
|||
char buf[512]= {0};
|
||||
FILE *res_file;
|
||||
int error;
|
||||
DBUG_ENTER("run_command");
|
||||
DBUG_PRINT("enter", ("cmd: %s", cmd));
|
||||
|
||||
if (!(res_file= popen(cmd, "r")))
|
||||
die("popen(\"%s\", \"r\") failed", cmd);
|
||||
|
@ -1567,7 +1592,7 @@ static int run_command(char* cmd,
|
|||
}
|
||||
|
||||
error= pclose(res_file);
|
||||
return WEXITSTATUS(error);
|
||||
DBUG_RETURN(WEXITSTATUS(error));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2351,7 +2376,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
|
|||
*query_end : query + strlen(query));
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
MYSQL* mysql = &cur_con->mysql;
|
||||
MYSQL* mysql = cur_con->mysql;
|
||||
DYNAMIC_STRING ds_query;
|
||||
DBUG_ENTER("var_query_set");
|
||||
LINT_INIT(res);
|
||||
|
@ -2493,7 +2518,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
|
|||
long row_no;
|
||||
int col_no= -1;
|
||||
MYSQL_RES* res;
|
||||
MYSQL* mysql= &cur_con->mysql;
|
||||
MYSQL* mysql= cur_con->mysql;
|
||||
|
||||
static DYNAMIC_STRING ds_query;
|
||||
static DYNAMIC_STRING ds_col;
|
||||
|
@ -3206,6 +3231,7 @@ void do_remove_files_wildcard(struct st_command *command)
|
|||
{
|
||||
int error= 0, sys_errno= 0;
|
||||
uint i;
|
||||
size_t directory_length;
|
||||
MY_DIR *dir_info;
|
||||
FILEINFO *file;
|
||||
char dir_separator[2];
|
||||
|
@ -3236,8 +3262,8 @@ void do_remove_files_wildcard(struct st_command *command)
|
|||
}
|
||||
init_dynamic_string(&ds_file_to_remove, dirname, 1024, 1024);
|
||||
dir_separator[0]= FN_LIBCHAR;
|
||||
dir_separator[1]= 0;
|
||||
dynstr_append(&ds_file_to_remove, dir_separator);
|
||||
dynstr_append_mem(&ds_file_to_remove, dir_separator, 1);
|
||||
directory_length= ds_file_to_remove.length;
|
||||
|
||||
/* Set default wild chars for wild_compare, is changed in embedded mode */
|
||||
set_wild_chars(1);
|
||||
|
@ -3253,8 +3279,7 @@ void do_remove_files_wildcard(struct st_command *command)
|
|||
if (ds_wild.length &&
|
||||
wild_compare(file->name, ds_wild.str, 0))
|
||||
continue;
|
||||
ds_file_to_remove.length= ds_directory.length + 1;
|
||||
ds_file_to_remove.str[ds_directory.length + 1]= 0;
|
||||
ds_file_to_remove.length= directory_length;
|
||||
dynstr_append(&ds_file_to_remove, file->name);
|
||||
DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
|
||||
if ((error= (my_delete(ds_file_to_remove.str, MYF(MY_WME)) != 0)))
|
||||
|
@ -3932,7 +3957,7 @@ void do_send_quit(struct st_command *command)
|
|||
if (!(con= find_connection_by_name(name)))
|
||||
die("connection '%s' not found in connection pool", name);
|
||||
|
||||
simple_command(&con->mysql,COM_QUIT,0,0,1);
|
||||
simple_command(con->mysql,COM_QUIT,0,0,1);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -3956,7 +3981,8 @@ void do_send_quit(struct st_command *command)
|
|||
|
||||
void do_change_user(struct st_command *command)
|
||||
{
|
||||
MYSQL *mysql = &cur_con->mysql;
|
||||
MYSQL *mysql = cur_con->mysql;
|
||||
/* static keyword to make the NetWare compiler happy. */
|
||||
static DYNAMIC_STRING ds_user, ds_passwd, ds_db;
|
||||
const struct command_arg change_user_args[] = {
|
||||
{ "user", ARG_STRING, FALSE, &ds_user, "User to connect as" },
|
||||
|
@ -4152,7 +4178,7 @@ int do_echo(struct st_command *command)
|
|||
void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
|
||||
{
|
||||
static int SLAVE_POLL_INTERVAL= 300000;
|
||||
MYSQL* mysql = &cur_con->mysql;
|
||||
MYSQL* mysql = cur_con->mysql;
|
||||
for (;;)
|
||||
{
|
||||
MYSQL_RES *UNINIT_VAR(res);
|
||||
|
@ -4182,7 +4208,7 @@ void do_sync_with_master2(struct st_command *command, long offset)
|
|||
{
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
MYSQL *mysql= &cur_con->mysql;
|
||||
MYSQL *mysql= cur_con->mysql;
|
||||
char query_buf[FN_REFLEN+128];
|
||||
int timeout= 300; /* seconds */
|
||||
|
||||
|
@ -4272,7 +4298,7 @@ int do_save_master_pos()
|
|||
{
|
||||
MYSQL_RES *res;
|
||||
MYSQL_ROW row;
|
||||
MYSQL *mysql = &cur_con->mysql;
|
||||
MYSQL *mysql = cur_con->mysql;
|
||||
const char *query;
|
||||
DBUG_ENTER("do_save_master_pos");
|
||||
|
||||
|
@ -4659,7 +4685,7 @@ void do_shutdown_server(struct st_command *command)
|
|||
long timeout=60;
|
||||
int pid;
|
||||
DYNAMIC_STRING ds_pidfile_name;
|
||||
MYSQL* mysql = &cur_con->mysql;
|
||||
MYSQL* mysql = cur_con->mysql;
|
||||
static DYNAMIC_STRING ds_timeout;
|
||||
const struct command_arg shutdown_args[] = {
|
||||
{"timeout", ARG_STRING, FALSE, &ds_timeout, "Timeout before killing server"}
|
||||
|
@ -5002,7 +5028,7 @@ void set_current_connection(struct st_connection *con)
|
|||
cur_con= con;
|
||||
/* Update $mysql_get_server_version to that of current connection */
|
||||
var_set_int("$mysql_get_server_version",
|
||||
mysql_get_server_version(&con->mysql));
|
||||
mysql_get_server_version(con->mysql));
|
||||
/* Update $CURRENT_CONNECTION to the name of the current connection */
|
||||
var_set_string("$CURRENT_CONNECTION", con->name);
|
||||
}
|
||||
|
@ -5075,10 +5101,10 @@ void do_close_connection(struct st_command *command)
|
|||
#ifndef EMBEDDED_LIBRARY
|
||||
if (command->type == Q_DIRTY_CLOSE)
|
||||
{
|
||||
if (con->mysql.net.vio)
|
||||
if (con->mysql->net.vio)
|
||||
{
|
||||
vio_delete(con->mysql.net.vio);
|
||||
con->mysql.net.vio = 0;
|
||||
vio_delete(con->mysql->net.vio);
|
||||
con->mysql->net.vio = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -5093,7 +5119,8 @@ void do_close_connection(struct st_command *command)
|
|||
mysql_stmt_close(con->stmt);
|
||||
con->stmt= 0;
|
||||
|
||||
mysql_close(&con->mysql);
|
||||
mysql_close(con->mysql);
|
||||
con->mysql= 0;
|
||||
|
||||
if (con->util_mysql)
|
||||
mysql_close(con->util_mysql);
|
||||
|
@ -5456,28 +5483,29 @@ void do_connect(struct st_command *command)
|
|||
if (!(con_slot= find_connection_by_name("-closed_connection-")))
|
||||
die("Connection limit exhausted, you can have max %d connections",
|
||||
opt_max_connections);
|
||||
my_free(con_slot->name);
|
||||
con_slot->name= 0;
|
||||
}
|
||||
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
init_connection_thd(con_slot);
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
|
||||
if (!mysql_init(&con_slot->mysql))
|
||||
if (!(con_slot->mysql= mysql_init(0)))
|
||||
die("Failed on mysql_init()");
|
||||
|
||||
if (opt_connect_timeout)
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
(void *) &opt_connect_timeout);
|
||||
|
||||
if (opt_compress || con_compress)
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_NAME,
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
|
||||
charset_info->csname);
|
||||
if (opt_charsets_dir)
|
||||
mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_DIR,
|
||||
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_DIR,
|
||||
opt_charsets_dir);
|
||||
|
||||
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
||||
if (opt_use_ssl)
|
||||
con_ssl= 1;
|
||||
|
@ -5486,12 +5514,12 @@ void do_connect(struct st_command *command)
|
|||
if (con_ssl)
|
||||
{
|
||||
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
||||
mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||
mysql_ssl_set(con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||
opt_ssl_capath, opt_ssl_cipher);
|
||||
#if MYSQL_VERSION_ID >= 50000
|
||||
/* Turn on ssl_verify_server_cert only if host is "localhost" */
|
||||
opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||
&opt_ssl_verify_server_cert);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -5505,7 +5533,7 @@ void do_connect(struct st_command *command)
|
|||
}
|
||||
|
||||
if (opt_protocol)
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
if (con_shm)
|
||||
|
@ -5513,12 +5541,12 @@ void do_connect(struct st_command *command)
|
|||
uint protocol= MYSQL_PROTOCOL_MEMORY;
|
||||
if (!ds_shm.length)
|
||||
die("Missing shared memory base name");
|
||||
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
||||
mysql_options(con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
|
||||
mysql_options(con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
|
||||
}
|
||||
else if (shared_memory_base_name)
|
||||
{
|
||||
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
|
||||
mysql_options(con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
|
||||
shared_memory_base_name);
|
||||
}
|
||||
#endif
|
||||
|
@ -5528,16 +5556,16 @@ void do_connect(struct st_command *command)
|
|||
dynstr_set(&ds_database, opt_db);
|
||||
|
||||
if (opt_plugin_dir && *opt_plugin_dir)
|
||||
mysql_options(&con_slot->mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
|
||||
mysql_options(con_slot->mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
|
||||
|
||||
if (ds_default_auth.length)
|
||||
mysql_options(&con_slot->mysql, MYSQL_DEFAULT_AUTH, ds_default_auth.str);
|
||||
mysql_options(con_slot->mysql, MYSQL_DEFAULT_AUTH, ds_default_auth.str);
|
||||
|
||||
/* Special database to allow one to connect without a database name */
|
||||
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
|
||||
dynstr_set(&ds_database, "");
|
||||
|
||||
if (connect_n_handle_errors(command, &con_slot->mysql,
|
||||
if (connect_n_handle_errors(command, con_slot->mysql,
|
||||
ds_host.str,ds_user.str,
|
||||
ds_password.str, ds_database.str,
|
||||
con_port, ds_sock.str))
|
||||
|
@ -6403,7 +6431,7 @@ static struct my_option my_long_options[] =
|
|||
{"max-connections", OPT_MAX_CONNECTIONS,
|
||||
"Max number of open connections to server",
|
||||
&opt_max_connections, &opt_max_connections, 0,
|
||||
GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
|
||||
GET_INT, REQUIRED_ARG, DEFAULT_MAX_CONN, 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},
|
||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
|
||||
|
@ -6553,6 +6581,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
|
|||
#ifndef DBUG_OFF
|
||||
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace");
|
||||
debug_check_flag= 1;
|
||||
debug_info_flag= 1;
|
||||
#endif
|
||||
break;
|
||||
case 'r':
|
||||
|
@ -6668,7 +6697,7 @@ int parse_args(int argc, char **argv)
|
|||
if (debug_info_flag)
|
||||
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
|
||||
if (debug_check_flag)
|
||||
my_end_arg= MY_CHECK_ERROR;
|
||||
my_end_arg|= MY_CHECK_ERROR;
|
||||
|
||||
if (global_subst != NULL)
|
||||
{
|
||||
|
@ -6973,6 +7002,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
|||
my_bool *is_null;
|
||||
ulong *length;
|
||||
uint i;
|
||||
int error;
|
||||
|
||||
/* Allocate array with bind structs, lengths and NULL flags */
|
||||
my_bind= (MYSQL_BIND*) my_malloc(num_fields * sizeof(MYSQL_BIND),
|
||||
|
@ -7000,7 +7030,7 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
|||
die("mysql_stmt_bind_result failed: %d: %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
|
||||
while (mysql_stmt_fetch(stmt) == 0)
|
||||
while ((error=mysql_stmt_fetch(stmt)) == 0)
|
||||
{
|
||||
for (i= 0; i < num_fields; i++)
|
||||
append_field(ds, i, &fields[i], (char*)my_bind[i].buffer,
|
||||
|
@ -7009,8 +7039,11 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt,
|
|||
dynstr_append_mem(ds, "\n", 1);
|
||||
}
|
||||
|
||||
if (error != MYSQL_NO_DATA)
|
||||
die("mysql_fetch didn't end with MYSQL_NO_DATA from statement: error: %d",
|
||||
error);
|
||||
if (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA)
|
||||
die("fetch didn't end with MYSQL_NO_DATA from statement: %d %s",
|
||||
die("mysql_fetch didn't end with MYSQL_NO_DATA from statement: %d %s",
|
||||
mysql_stmt_errno(stmt), mysql_stmt_error(stmt));
|
||||
|
||||
for (i= 0; i < num_fields; i++)
|
||||
|
@ -7105,6 +7138,8 @@ void append_table_headings(DYNAMIC_STRING *ds,
|
|||
uint num_fields)
|
||||
{
|
||||
uint col_idx;
|
||||
if (disable_column_names)
|
||||
return;
|
||||
for (col_idx= 0; col_idx < num_fields; col_idx++)
|
||||
{
|
||||
if (col_idx)
|
||||
|
@ -7171,12 +7206,22 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||
DYNAMIC_STRING *ds, DYNAMIC_STRING *ds_warnings)
|
||||
{
|
||||
MYSQL_RES *res= 0;
|
||||
MYSQL *mysql= &cn->mysql;
|
||||
MYSQL *mysql= cn->mysql;
|
||||
int err= 0, counter= 0;
|
||||
DBUG_ENTER("run_query_normal");
|
||||
DBUG_PRINT("enter",("flags: %d", flags));
|
||||
DBUG_PRINT("enter", ("query: '%-.60s'", query));
|
||||
|
||||
if (!mysql)
|
||||
{
|
||||
/* Emulate old behaviour of sending something on a closed connection */
|
||||
handle_error(command, 2006, "MySQL server has gone away",
|
||||
"000000", ds);
|
||||
cn->pending= FALSE;
|
||||
var_set_errno(2006);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
if (flags & QUERY_SEND_FLAG)
|
||||
{
|
||||
/*
|
||||
|
@ -7363,7 +7408,7 @@ void handle_error(struct st_command *command,
|
|||
|
||||
DBUG_ENTER("handle_error");
|
||||
|
||||
if (command->require_file[0])
|
||||
if (command->require_file)
|
||||
{
|
||||
/*
|
||||
The query after a "--require" failed. This is fine as long the server
|
||||
|
@ -7726,7 +7771,8 @@ int util_query(MYSQL* org_mysql, const char* query){
|
|||
cur_con->util_mysql= mysql;
|
||||
}
|
||||
|
||||
DBUG_RETURN(mysql_query(mysql, query));
|
||||
int ret= mysql_query(mysql, query);
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7746,7 +7792,7 @@ int util_query(MYSQL* org_mysql, const char* query){
|
|||
|
||||
void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
||||
{
|
||||
MYSQL *mysql= &cn->mysql;
|
||||
MYSQL *mysql= cn->mysql;
|
||||
DYNAMIC_STRING *ds;
|
||||
DYNAMIC_STRING *save_ds= NULL;
|
||||
DYNAMIC_STRING ds_result;
|
||||
|
@ -7791,7 +7837,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
Create a temporary dynamic string to contain the output from
|
||||
this query.
|
||||
*/
|
||||
if (command->require_file[0])
|
||||
if (command->require_file)
|
||||
{
|
||||
init_dynamic_string(&ds_result, "", 1024, 1024);
|
||||
ds= &ds_result;
|
||||
|
@ -7809,6 +7855,15 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
dynstr_append_mem(ds, "\n", 1);
|
||||
}
|
||||
|
||||
/*
|
||||
Write the command to the result file before we execute the query
|
||||
This is needed to be able to analyse the log if something goes
|
||||
wrong
|
||||
*/
|
||||
log_file.write(&ds_res);
|
||||
log_file.flush();
|
||||
dynstr_set(&ds_res, 0);
|
||||
|
||||
if (view_protocol_enabled &&
|
||||
complete_query &&
|
||||
match_re(&view_re, query))
|
||||
|
@ -7950,7 +8005,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
|
|||
mysql_errno(mysql), mysql_error(mysql));
|
||||
}
|
||||
|
||||
if (command->require_file[0])
|
||||
if (command->require_file)
|
||||
{
|
||||
/* A result file was specified for _this_ query
|
||||
and the output should be checked against an already
|
||||
|
@ -8295,6 +8350,7 @@ int main(int argc, char **argv)
|
|||
char save_file[FN_REFLEN];
|
||||
bool empty_result= FALSE;
|
||||
MY_INIT(argv[0]);
|
||||
DBUG_ENTER("main");
|
||||
|
||||
save_file[0]= 0;
|
||||
TMPDIR[0]= 0;
|
||||
|
@ -8326,8 +8382,8 @@ int main(int argc, char **argv)
|
|||
|
||||
my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024);
|
||||
|
||||
if (my_hash_init(&var_hash, charset_info,
|
||||
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
||||
if (my_hash_init2(&var_hash, 64, charset_info,
|
||||
128, 0, 0, get_var_key, var_free, MYF(0)))
|
||||
die("Variable hash initialization failed");
|
||||
|
||||
var_set_string("MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
|
||||
|
@ -8354,6 +8410,7 @@ int main(int argc, char **argv)
|
|||
#endif
|
||||
|
||||
init_dynamic_string(&ds_res, "", 2048, 2048);
|
||||
init_alloc_root(&require_file_root, 1024, 1024);
|
||||
|
||||
parse_args(argc, argv);
|
||||
|
||||
|
@ -8416,33 +8473,33 @@ int main(int argc, char **argv)
|
|||
#ifdef EMBEDDED_LIBRARY
|
||||
init_connection_thd(con);
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
if (!( mysql_init(&con->mysql)))
|
||||
if (! (con->mysql= mysql_init(0)))
|
||||
die("Failed in mysql_init()");
|
||||
if (opt_connect_timeout)
|
||||
mysql_options(&con->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
mysql_options(con->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
(void *) &opt_connect_timeout);
|
||||
if (opt_compress)
|
||||
mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||
mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
mysql_options(&con->mysql, MYSQL_SET_CHARSET_NAME,
|
||||
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||
mysql_options(con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
|
||||
charset_info->csname);
|
||||
if (opt_charsets_dir)
|
||||
mysql_options(&con->mysql, MYSQL_SET_CHARSET_DIR,
|
||||
mysql_options(con->mysql, MYSQL_SET_CHARSET_DIR,
|
||||
opt_charsets_dir);
|
||||
|
||||
if (opt_protocol)
|
||||
mysql_options(&con->mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
|
||||
mysql_options(con->mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
|
||||
|
||||
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
||||
|
||||
if (opt_use_ssl)
|
||||
{
|
||||
mysql_ssl_set(&con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||
mysql_ssl_set(con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||
opt_ssl_capath, opt_ssl_cipher);
|
||||
#if MYSQL_VERSION_ID >= 50000
|
||||
/* Turn on ssl_verify_server_cert only if host is "localhost" */
|
||||
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
|
||||
mysql_options(&con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||
mysql_options(con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||
&opt_ssl_verify_server_cert);
|
||||
#endif
|
||||
}
|
||||
|
@ -8450,13 +8507,13 @@ int main(int argc, char **argv)
|
|||
|
||||
#ifdef HAVE_SMEM
|
||||
if (shared_memory_base_name)
|
||||
mysql_options(&con->mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
|
||||
mysql_options(con->mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
|
||||
#endif
|
||||
|
||||
if (!(con->name = my_strdup("default", MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
|
||||
safe_connect(&con->mysql, con->name, opt_host, opt_user, opt_pass,
|
||||
safe_connect(con->mysql, con->name, opt_host, opt_user, opt_pass,
|
||||
opt_db, opt_port, unix_sock);
|
||||
|
||||
/* Use all time until exit if no explicit 'start_timer' */
|
||||
|
@ -8592,6 +8649,14 @@ int main(int argc, char **argv)
|
|||
display_metadata= 0;
|
||||
var_set_int("$ENABLED_METADATA", 0);
|
||||
break;
|
||||
case Q_ENABLE_COLUMN_NAMES:
|
||||
disable_column_names= 0;
|
||||
var_set_int("$ENABLED_COLUMN_NAMES", 0);
|
||||
break;
|
||||
case Q_DISABLE_COLUMN_NAMES:
|
||||
disable_column_names= 1;
|
||||
var_set_int("$ENABLED_COLUMN_NAMES", 1);
|
||||
break;
|
||||
case Q_SOURCE: do_source(command); break;
|
||||
case Q_SLEEP: do_sleep(command, 0); break;
|
||||
case Q_REAL_SLEEP: do_sleep(command, 1); break;
|
||||
|
@ -8682,7 +8747,9 @@ int main(int argc, char **argv)
|
|||
|
||||
if (save_file[0])
|
||||
{
|
||||
strmake(command->require_file, save_file, sizeof(save_file) - 1);
|
||||
if (!(command->require_file= strdup_root(&require_file_root,
|
||||
save_file)))
|
||||
die("out of memory for require_file");
|
||||
save_file[0]= 0;
|
||||
}
|
||||
run_query(cur_con, command, flags);
|
||||
|
@ -8780,11 +8847,11 @@ int main(int argc, char **argv)
|
|||
dynstr_append(&ds_res, "\n");
|
||||
break;
|
||||
case Q_PING:
|
||||
handle_command_error(command, mysql_ping(&cur_con->mysql), -1);
|
||||
handle_command_error(command, mysql_ping(cur_con->mysql), -1);
|
||||
break;
|
||||
case Q_SEND_SHUTDOWN:
|
||||
handle_command_error(command,
|
||||
mysql_shutdown(&cur_con->mysql,
|
||||
mysql_shutdown(cur_con->mysql,
|
||||
SHUTDOWN_DEFAULT), -1);
|
||||
break;
|
||||
case Q_SHUTDOWN_SERVER:
|
||||
|
@ -8814,10 +8881,10 @@ int main(int argc, char **argv)
|
|||
ps_protocol_enabled= ps_protocol;
|
||||
break;
|
||||
case Q_DISABLE_RECONNECT:
|
||||
set_reconnect(&cur_con->mysql, 0);
|
||||
set_reconnect(cur_con->mysql, 0);
|
||||
break;
|
||||
case Q_ENABLE_RECONNECT:
|
||||
set_reconnect(&cur_con->mysql, 1);
|
||||
set_reconnect(cur_con->mysql, 1);
|
||||
/* Close any open statements - no reconnect, need new prepare */
|
||||
close_statements();
|
||||
break;
|
||||
|
@ -9007,7 +9074,7 @@ void timer_output(void)
|
|||
|
||||
ulonglong timer_now(void)
|
||||
{
|
||||
return my_micro_time() / 1000;
|
||||
return my_interval_timer() / 1000000;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length);
|
|||
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
|
||||
{
|
||||
LINE_BUFFER *line_buff;
|
||||
MY_STAT input_file_stat;
|
||||
|
||||
#ifndef __WIN__
|
||||
MY_STAT input_file_stat;
|
||||
if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
|
||||
MY_S_ISDIR(input_file_stat.st_mode) ||
|
||||
MY_S_ISBLK(input_file_stat.st_mode))
|
||||
|
@ -56,6 +56,7 @@ char *batch_readline(LINE_BUFFER *line_buff)
|
|||
{
|
||||
char *pos;
|
||||
ulong out_length;
|
||||
LINT_INIT(out_length);
|
||||
|
||||
if (!(pos=intern_read_line(line_buff, &out_length)))
|
||||
return 0;
|
||||
|
|
|
@ -481,11 +481,11 @@ uint32 String::numchars()
|
|||
return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
|
||||
}
|
||||
|
||||
int String::charpos(int i,uint32 offset)
|
||||
int String::charpos(longlong i,uint32 offset)
|
||||
{
|
||||
if (i <= 0)
|
||||
return i;
|
||||
return str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,i);
|
||||
return (int)i;
|
||||
return (int)str_charset->cset->charpos(str_charset,Ptr+offset,Ptr+str_length,(size_t)i);
|
||||
}
|
||||
|
||||
int String::strstr(const String &s,uint32 offset)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef CLIENT_SQL_STRING_INCLUDED
|
||||
#define CLIENT_SQL_STRING_INCLUDED
|
||||
#ifndef SQL_STRING_INCLUDED
|
||||
#define SQL_STRING_INCLUDED
|
||||
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
|
@ -268,7 +268,7 @@ public:
|
|||
friend int stringcmp(const String *a,const String *b);
|
||||
friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
|
||||
uint32 numchars();
|
||||
int charpos(int i,uint32 offset=0);
|
||||
int charpos(longlong i,uint32 offset=0);
|
||||
|
||||
int reserve(uint32 space_needed)
|
||||
{
|
||||
|
@ -357,4 +357,4 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
#endif /* CLIENT_SQL_STRING_INCLUDED */
|
||||
#endif /* SQL_STRING_INCLUDED */
|
||||
|
|
|
@ -54,7 +54,7 @@ MACRO(GET_MYSQL_VERSION)
|
|||
ENDIF()
|
||||
|
||||
SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
|
||||
MESSAGE("-- MySQL ${VERSION}")
|
||||
MESSAGE("-- MariaDB ${VERSION}")
|
||||
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
|
||||
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
|
||||
STRING(REPLACE "-" "_" MYSQL_RPM_VERSION "${VERSION}")
|
||||
|
@ -92,15 +92,15 @@ IF(NOT CPACK_PACKAGE_FILE_NAME)
|
|||
ENDIF()
|
||||
|
||||
IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME)
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mysql-${VERSION}")
|
||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mariadb-${VERSION}")
|
||||
ENDIF()
|
||||
SET(CPACK_PACKAGE_CONTACT "MySQL Build Team <build@mysql.com>")
|
||||
SET(CPACK_PACKAGE_VENDOR "Sun Microsystems, Inc")
|
||||
SET(CPACK_PACKAGE_CONTACT "MariaDB team <info@montyprogram.com>")
|
||||
SET(CPACK_PACKAGE_VENDOR "Monty Program AB")
|
||||
SET(CPACK_SOURCE_GENERATOR "TGZ")
|
||||
INCLUDE(cpack_source_ignore_files)
|
||||
|
||||
# Defintions for windows version resources
|
||||
SET(PRODUCTNAME "MySQL Server")
|
||||
SET(PRODUCTNAME "MariaDB Server")
|
||||
SET(COMPANYNAME ${CPACK_PACKAGE_VENDOR})
|
||||
|
||||
# Windows 'date' command has unpredictable output, so cannot rely on it to
|
||||
|
@ -117,6 +117,10 @@ ENDIF()
|
|||
# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx
|
||||
# for more info.
|
||||
IF(MSVC)
|
||||
# Tiny version is used to identify the build, it can be set with cmake -DTINY_VERSION=<number>
|
||||
# to bzr revno for example (in the CI builds)
|
||||
SET(TINY_VERSION "0" CACHE INTERNAL "")
|
||||
|
||||
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
SET(FILETYPE VFT_APP)
|
||||
|
|
|
@ -88,7 +88,7 @@ IF(MSVC)
|
|||
# Fix CMake's predefined huge stack size
|
||||
FOREACH(type EXE SHARED MODULE)
|
||||
STRING(REGEX REPLACE "/STACK:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS "${CMAKE_${type}_LINKER_FLAGS}")
|
||||
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
|
||||
STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "/INCREMENTAL:NO" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}")
|
||||
ENDFOREACH()
|
||||
|
||||
# Mark 32 bit executables large address aware so they can
|
||||
|
|
|
@ -88,6 +88,13 @@ IF(NOT VERSION)
|
|||
SET(DEFAULT_MACHINE "universal")
|
||||
ELSE()
|
||||
SET(DEFAULT_MACHINE "${CMAKE_OSX_ARCHITECTURES}")
|
||||
IF(NOT DEFAULT_MACHINE)
|
||||
IF(CMAKE_SIZEOF_VOIPD EQUAL 4)
|
||||
SET(DEFAULT_MACHINE "i386")
|
||||
ELSE()
|
||||
SET(DEFAULT_MACHINE "x86_64")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(DEFAULT_MACHINE MATCHES "i386")
|
||||
SET(DEFAULT_MACHINE "x86")
|
||||
|
@ -116,7 +123,7 @@ IF(NOT VERSION)
|
|||
SET(PRODUCT_TAG)
|
||||
ENDIF()
|
||||
|
||||
SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
|
||||
SET(package_name "mariadb${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}")
|
||||
|
||||
# Sometimes package suffix is added (something like "-icc-glibc23")
|
||||
IF(PACKAGE_SUFFIX)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <windows.h>
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0
|
||||
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0
|
||||
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
|
||||
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS__WINDOWS32
|
||||
|
@ -12,8 +12,8 @@ BEGIN
|
|||
BEGIN
|
||||
BLOCK "040904E4"
|
||||
BEGIN
|
||||
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"
|
||||
VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0"
|
||||
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
|
||||
VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -673,8 +673,7 @@ fnprint (to_print)
|
|||
w = wcwidth (wc);
|
||||
width = (w >= 0) ? w : 1;
|
||||
}
|
||||
fwrite (s, 1, tlen, rl_outstream);
|
||||
s += tlen;
|
||||
s+= fwrite (s, 1, tlen, rl_outstream);
|
||||
printed_len += width;
|
||||
#else
|
||||
putc (*s, rl_outstream);
|
||||
|
|
|
@ -621,7 +621,8 @@ _rl_output_some_chars (string, count)
|
|||
const char *string;
|
||||
int count;
|
||||
{
|
||||
fwrite (string, 1, count, _rl_out_stream);
|
||||
if (fwrite (string, 1, count, _rl_out_stream) != (size_t)count)
|
||||
fprintf(stderr, "Write failed\n");
|
||||
}
|
||||
|
||||
/* Move the cursor back. */
|
||||
|
|
|
@ -1389,7 +1389,7 @@ next:
|
|||
subdir=0;
|
||||
while (ctlp < end && *ctlp != ',')
|
||||
ctlp++;
|
||||
len=ctlp-start;
|
||||
len= (int) (ctlp-start);
|
||||
if (start[len-1] == '/')
|
||||
{
|
||||
len--;
|
||||
|
@ -2113,7 +2113,7 @@ static void DbugFlush(CODE_STATE *cs)
|
|||
|
||||
void _db_flush_()
|
||||
{
|
||||
CODE_STATE *cs= NULL;
|
||||
CODE_STATE *cs;
|
||||
get_code_state_or_return;
|
||||
(void) fflush(cs->stack->out_file);
|
||||
}
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# Copyright (C) 2002 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
die "No files specified\n" unless $ARGV[0];
|
||||
|
||||
$ctags="exctags -x -f - --c-types=f -u";
|
||||
|
@ -85,4 +70,3 @@ while($src=shift)
|
|||
}
|
||||
|
||||
warn "All done!\n";
|
||||
|
||||
|
|
|
@ -31,24 +31,28 @@ IF(NOT CMAKE_CROSSCOMPILING)
|
|||
TARGET_LINK_LIBRARIES(comp_err mysys)
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h
|
||||
${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys
|
||||
COMMAND comp_err
|
||||
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
|
||||
--out-dir=${PROJECT_BINARY_DIR}/sql/share/
|
||||
--header_file=${PROJECT_BINARY_DIR}/include/mysqld_error.h
|
||||
--name_file=${PROJECT_BINARY_DIR}/include/mysqld_ername.h
|
||||
--state_file=${PROJECT_BINARY_DIR}/include/sql_state.h
|
||||
--in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/comp_err.c)
|
||||
# Generate mysqld_error.h
|
||||
# Try not to change its timestamp if not necessary(as touching
|
||||
# mysqld_error.h results in rebuild of the almost whole server)
|
||||
# To preserve timestamp, first generate a temp header file, then copy it
|
||||
# to mysqld_error.h using cmake -E copy_if_different
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
|
||||
COMMAND comp_err
|
||||
--charset=${PROJECT_SOURCE_DIR}/sql/share/charsets
|
||||
--out-dir=${CMAKE_BINARY_DIR}/sql/share/
|
||||
--header_file=${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp
|
||||
--name_file=${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp
|
||||
--state_file=${CMAKE_BINARY_DIR}/include/sql_state.h.tmp
|
||||
--in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp ${CMAKE_BINARY_DIR}/include/mysqld_error.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/mysqld_ername.h.tmp ${CMAKE_BINARY_DIR}/include/mysqld_ername.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/sql_state.h.tmp ${CMAKE_BINARY_DIR}/include/sql_state.h
|
||||
DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt)
|
||||
|
||||
ADD_CUSTOM_TARGET(GenError
|
||||
ALL
|
||||
DEPENDS
|
||||
${PROJECT_BINARY_DIR}/include/mysqld_error.h
|
||||
${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys
|
||||
${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt)
|
||||
${CMAKE_BINARY_DIR}/include/mysqld_error.h.tmp)
|
||||
|
||||
MYSQL_ADD_EXECUTABLE(my_print_defaults my_print_defaults.c)
|
||||
TARGET_LINK_LIBRARIES(my_print_defaults mysys)
|
||||
|
@ -77,4 +81,3 @@ IF(UNIX)
|
|||
MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c)
|
||||
TARGET_LINK_LIBRARIES(mysql_waitpid mysys)
|
||||
ENDIF()
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#define HEADER_LENGTH 32 /* Length of header in errmsg.sys */
|
||||
#define DEFAULT_CHARSET_DIR "../sql/share/charsets"
|
||||
#define ER_PREFIX "ER_"
|
||||
#define ER_PREFIX2 "MARIA_ER_"
|
||||
#define WARN_PREFIX "WARN_"
|
||||
static char *OUTFILE= (char*) "errmsg.sys";
|
||||
static char *HEADERFILE= (char*) "mysqld_error.h";
|
||||
|
@ -57,7 +58,7 @@ const char *empty_string= ""; /* For empty states */
|
|||
*/
|
||||
|
||||
const char *default_language= "eng";
|
||||
int er_offset= 1000;
|
||||
uint er_offset= 1000;
|
||||
my_bool info_flag= 0;
|
||||
|
||||
/* Storage of one error message row (for one language) */
|
||||
|
@ -85,7 +86,7 @@ struct languages
|
|||
struct errors
|
||||
{
|
||||
const char *er_name; /* Name of the error (ER_HASHCK) */
|
||||
int d_code; /* Error code number */
|
||||
uint d_code; /* Error code number */
|
||||
const char *sql_code1; /* sql state */
|
||||
const char *sql_code2; /* ODBC state */
|
||||
struct errors *next_error; /* Pointer to next error */
|
||||
|
@ -127,6 +128,7 @@ static struct my_option my_long_options[]=
|
|||
};
|
||||
|
||||
|
||||
static struct errors *generate_empty_message(uint dcode);
|
||||
static struct languages *parse_charset_string(char *str);
|
||||
static struct errors *parse_error_string(char *ptr, int er_count);
|
||||
static struct message *parse_message_string(struct message *new_message,
|
||||
|
@ -225,7 +227,7 @@ static int create_header_files(struct errors *error_head)
|
|||
struct errors *tmp_error;
|
||||
struct message *er_msg;
|
||||
const char *er_text;
|
||||
|
||||
uint current_d_code;
|
||||
DBUG_ENTER("create_header_files");
|
||||
|
||||
if (!(er_definef= my_fopen(HEADERFILE, O_WRONLY, MYF(MY_WME))))
|
||||
|
@ -250,13 +252,22 @@ static int create_header_files(struct errors *error_head)
|
|||
|
||||
fprintf(er_definef, "#define ER_ERROR_FIRST %d\n", error_head->d_code);
|
||||
|
||||
current_d_code= error_head->d_code -1;
|
||||
for (tmp_error= error_head; tmp_error; tmp_error= tmp_error->next_error)
|
||||
{
|
||||
/*
|
||||
generating mysqld_error.h
|
||||
fprintf() will automatically add \r on windows
|
||||
*/
|
||||
fprintf(er_definef, "#define %s %d\n", tmp_error->er_name,
|
||||
|
||||
if (!tmp_error->er_name)
|
||||
continue; /* Placeholder for gap */
|
||||
|
||||
if (tmp_error->d_code > current_d_code + 1)
|
||||
fprintf(er_definef, "\n/* New section */\n\n");
|
||||
current_d_code= tmp_error->d_code;
|
||||
|
||||
fprintf(er_definef, "#define %s %u\n", tmp_error->er_name,
|
||||
tmp_error->d_code);
|
||||
er_last= tmp_error->d_code;
|
||||
|
||||
|
@ -428,7 +439,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||
char *str, buff[1000];
|
||||
struct errors *current_error= 0, **tail_error= top_error;
|
||||
struct message current_message;
|
||||
int rcount= 0;
|
||||
uint rcount= 0;
|
||||
my_bool er_offset_found= 0;
|
||||
DBUG_ENTER("parse_input_file");
|
||||
|
||||
*top_error= 0;
|
||||
|
@ -449,11 +461,32 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||
}
|
||||
if (is_prefix(str, "start-error-number"))
|
||||
{
|
||||
if (!(er_offset= parse_error_offset(str)))
|
||||
uint tmp_er_offset;
|
||||
if (!(tmp_er_offset= parse_error_offset(str)))
|
||||
{
|
||||
fprintf(stderr, "Failed to parse the error offset string!\n");
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
if (!er_offset_found)
|
||||
{
|
||||
er_offset_found= 1;
|
||||
er_offset= tmp_er_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Create empty error messages between er_offset and tmp_err_offset */
|
||||
if (tmp_er_offset < er_offset + rcount)
|
||||
{
|
||||
fprintf(stderr, "new start-error-number %u is smaller than current error message: %u\n", tmp_er_offset, er_offset + rcount);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
for ( ; er_offset + rcount < tmp_er_offset ; rcount++)
|
||||
{
|
||||
current_error= generate_empty_message(er_offset + rcount);
|
||||
*tail_error= current_error;
|
||||
tail_error= ¤t_error->next_error;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (is_prefix(str, "default-language"))
|
||||
|
@ -500,7 +533,8 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||
DBUG_RETURN(0);
|
||||
continue;
|
||||
}
|
||||
if (is_prefix(str, ER_PREFIX) || is_prefix(str, WARN_PREFIX))
|
||||
if (is_prefix(str, ER_PREFIX) || is_prefix(str, WARN_PREFIX) ||
|
||||
is_prefix(str, ER_PREFIX2))
|
||||
{
|
||||
if (!(current_error= parse_error_string(str, rcount)))
|
||||
{
|
||||
|
@ -515,12 +549,12 @@ static int parse_input_file(const char *file_name, struct errors **top_error,
|
|||
continue;
|
||||
}
|
||||
if (*str == '#' || *str == '\n')
|
||||
continue; /* skip comment or empty lines */
|
||||
continue; /* skip comment or empty lines */
|
||||
|
||||
fprintf(stderr, "Wrong input file format. Stop!\nLine: %s\n", str);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
*tail_error= 0; /* Mark end of list */
|
||||
*tail_error= 0; /* Mark end of list */
|
||||
|
||||
my_fclose(file, MYF(0));
|
||||
DBUG_RETURN(rcount);
|
||||
|
@ -629,7 +663,6 @@ static struct message *find_message(struct errors *err, const char *lang,
|
|||
DBUG_RETURN(tmp);
|
||||
if (!strcmp(tmp->lang_short_name, default_language))
|
||||
{
|
||||
DBUG_ASSERT(tmp->text[0] != 0);
|
||||
return_val= tmp;
|
||||
}
|
||||
}
|
||||
|
@ -849,6 +882,33 @@ static struct message *parse_message_string(struct message *new_message,
|
|||
}
|
||||
|
||||
|
||||
static struct errors *generate_empty_message(uint d_code)
|
||||
{
|
||||
struct errors *new_error;
|
||||
struct message message;
|
||||
|
||||
/* create a new element */
|
||||
if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error),
|
||||
MYF(MY_WME))))
|
||||
return(0);
|
||||
if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 1))
|
||||
return(0); /* OOM: Fatal error */
|
||||
|
||||
new_error->er_name= NULL;
|
||||
new_error->d_code= d_code;
|
||||
new_error->sql_code1= empty_string;
|
||||
new_error->sql_code2= empty_string;
|
||||
|
||||
if (!(message.lang_short_name= my_strdup(default_language, MYF(MY_WME))) ||
|
||||
!(message.text= my_strdup("", MYF(MY_WME))))
|
||||
return(0);
|
||||
|
||||
/* Can't fail as msg is preallocated */
|
||||
(void) insert_dynamic(&new_error->msg, (uchar*) &message);
|
||||
return(new_error);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Parsing the string with error name and codes; returns the pointer to
|
||||
the errors struct
|
||||
|
@ -861,7 +921,9 @@ static struct errors *parse_error_string(char *str, int er_count)
|
|||
DBUG_PRINT("enter", ("str: %s", str));
|
||||
|
||||
/* create a new element */
|
||||
new_error= (struct errors *) my_malloc(sizeof(*new_error), MYF(MY_WME));
|
||||
if (!(new_error= (struct errors *) my_malloc(sizeof(*new_error),
|
||||
MYF(MY_WME))))
|
||||
DBUG_RETURN(0);
|
||||
|
||||
if (my_init_dynamic_array(&new_error->msg, sizeof(struct message), 0, 0))
|
||||
DBUG_RETURN(0); /* OOM: Fatal error */
|
||||
|
@ -991,7 +1053,7 @@ static struct languages *parse_charset_string(char *str)
|
|||
static void print_version(void)
|
||||
{
|
||||
DBUG_ENTER("print_version");
|
||||
printf("%s (Compile errormessage) Ver %s\n", my_progname, "2.0");
|
||||
printf("%s (Compile errormessage) Ver %s\n", my_progname, "3.0");
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@ INCLUDE_DIRECTORIES(
|
|||
${CMAKE_SOURCE_DIR}/extra/libevent
|
||||
${CMAKE_SOURCE_DIR}/extra/libevent/compat
|
||||
${CMAKE_SOURCE_DIR}/extra/libevent/WIN32-Code
|
||||
${CMAKE_SOURCE_DIR}/include)
|
||||
${CMAKE_BINARY_DIR}/extra/libevent
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
IF(MSVC)
|
||||
ADD_DEFINITIONS("-DWIN32 -DHAVE_CONFIG_H")
|
||||
|
@ -28,8 +30,14 @@ SET(LIBEVENT_SOURCES
|
|||
min_heap.h
|
||||
strlcpy-internal.h
|
||||
)
|
||||
IF(WIN32)
|
||||
# Workaround source distribution bug, remove preconfigured event-config
|
||||
IF(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||
FILE(REMOVE ${CMAKE_SOURCE_DIR}/extra/libevent/event-config.h)
|
||||
ENDIF()
|
||||
CONFIGURE_FILE(WIN32-Code/config.h ${CMAKE_BINARY_DIR}/extra/libevent/event-config.h COPYONLY)
|
||||
ENDIF()
|
||||
|
||||
CONFIGURE_FILE(WIN32-Code/config.h ${CMAKE_SOURCE_DIR}/extra/libevent/event-config.h COPYONLY)
|
||||
IF(NOT SOURCE_SUBLIBS)
|
||||
ADD_LIBRARY(libevent ${LIBEVENT_SOURCES})
|
||||
ENDIF(NOT SOURCE_SUBLIBS)
|
||||
|
|
|
@ -185,7 +185,7 @@ devpoll_init(struct event_base *base)
|
|||
}
|
||||
|
||||
static int
|
||||
devpoll_recalc(struct event_base *base, void *arg, int max)
|
||||
devpoll_recalc(struct event_base *base __attribute__((unused)), void *arg, int max)
|
||||
{
|
||||
struct devpollop *devpollop = arg;
|
||||
|
||||
|
|
|
@ -155,8 +155,8 @@ epoll_init(struct event_base *base)
|
|||
}
|
||||
|
||||
static int
|
||||
epoll_recalc(struct event_base *base __attribute__((unused)),
|
||||
void *arg, int max)
|
||||
epoll_recalc(struct event_base *base __attribute__((unused)), void *arg,
|
||||
int max)
|
||||
{
|
||||
struct epollop *epollop = arg;
|
||||
|
||||
|
|
|
@ -75,8 +75,10 @@ bufferevent_add(struct event *ev, int timeout)
|
|||
*/
|
||||
|
||||
void
|
||||
bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old __attribute__((unused)), size_t now,
|
||||
void *arg) {
|
||||
bufferevent_read_pressure_cb(struct evbuffer *buf,
|
||||
size_t old __attribute__((unused)), size_t now,
|
||||
void *arg)
|
||||
{
|
||||
struct bufferevent *bufev = arg;
|
||||
/*
|
||||
* If we are below the watermark then reschedule reading if it's
|
||||
|
|
|
@ -405,7 +405,7 @@ event_loopexit_cb(int fd __attribute__((unused)),
|
|||
int
|
||||
event_loopexit(struct timeval *tv)
|
||||
{
|
||||
return (event_once(-1, EV_TIMEOUT, event_loopexit_cb,
|
||||
return (event_once(-1, EV_TIMEOUT, &event_loopexit_cb,
|
||||
current_base, tv));
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ const struct eventop kqops = {
|
|||
};
|
||||
|
||||
static void *
|
||||
kq_init(struct event_base *base)
|
||||
kq_init(struct event_base *base __attribute__((unused)))
|
||||
{
|
||||
int kq;
|
||||
struct kqop *kqueueop;
|
||||
|
@ -203,13 +203,14 @@ kq_insert(struct kqop *kqop, struct kevent *kev)
|
|||
}
|
||||
|
||||
static void
|
||||
kq_sighandler(int sig)
|
||||
kq_sighandler(int sig __attribute__((unused)))
|
||||
{
|
||||
/* Do nothing here */
|
||||
}
|
||||
|
||||
static int
|
||||
kq_dispatch(struct event_base *base, void *arg, struct timeval *tv)
|
||||
kq_dispatch(struct event_base *base __attribute__((unused)), void *arg,
|
||||
struct timeval *tv)
|
||||
{
|
||||
struct kqop *kqop = arg;
|
||||
struct kevent *changes = kqop->changes;
|
||||
|
@ -408,7 +409,7 @@ kq_del(void *arg, struct event *ev)
|
|||
}
|
||||
|
||||
static void
|
||||
kq_dealloc(struct event_base *base, void *arg)
|
||||
kq_dealloc(struct event_base *base __attribute__((unused)), void *arg)
|
||||
{
|
||||
struct kqop *kqop = arg;
|
||||
|
||||
|
|
|
@ -69,7 +69,8 @@ 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 __attribute__((unused)), void *arg __attribute__((unused)))
|
||||
evsignal_cb(int fd, short what __attribute__((unused)),
|
||||
void *arg __attribute__((unused)))
|
||||
{
|
||||
static char signals[100];
|
||||
#ifdef WIN32
|
||||
|
@ -113,7 +114,7 @@ evsignal_init(struct event_base *base)
|
|||
evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]);
|
||||
|
||||
event_set(&base->sig.ev_signal, base->sig.ev_signal_pair[1],
|
||||
EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal);
|
||||
EV_READ | EV_PERSIST, &evsignal_cb, &base->sig.ev_signal);
|
||||
base->sig.ev_signal.ev_base = base;
|
||||
base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ static void usage(my_bool version)
|
|||
my_print_help(my_long_options);
|
||||
my_print_default_files(config_file);
|
||||
my_print_variables(my_long_options);
|
||||
printf("\nExample usage:\n%s --defaults-file=example.cnf client mysql\n", my_progname);
|
||||
printf("\nExample usage:\n%s --defaults-file=example.cnf client client-server mysql\n", my_progname);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1086,7 +1086,7 @@ static int convert_file(REPLACE *rep, char * name)
|
|||
my_fclose(in,MYF(0)); my_fclose(out,MYF(0));
|
||||
|
||||
if (updated && ! error)
|
||||
my_redel(org_name,tempname,MYF(MY_WME | MY_LINK_WARNING));
|
||||
my_redel(org_name, tempname, 0, MYF(MY_WME | MY_LINK_WARNING));
|
||||
else
|
||||
my_delete(tempname,MYF(MY_WME));
|
||||
if (!silent && ! error)
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
* with SSL types and sockets
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h> // memcpy
|
||||
#include "runtime.hpp"
|
||||
|
|
|
@ -128,7 +128,7 @@ void SetErrorString(unsigned long error, char* buffer)
|
|||
break;
|
||||
|
||||
case badVersion_error :
|
||||
strncpy(buffer, "protocl version mismatch", max);
|
||||
strncpy(buffer, "protocol version mismatch", max);
|
||||
break;
|
||||
|
||||
case compress_error :
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
/*
|
||||
Copyright (C) 2006, 2007 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// benchmark.cpp
|
||||
// TaoCrypt benchmark
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ public:
|
|||
|
||||
word32 size(bool use_current = false);
|
||||
private:
|
||||
void put(Source&);
|
||||
size_t put(Source&);
|
||||
|
||||
FileSink(const FileSink&); // hide
|
||||
FileSink& operator=(const FileSink&); // hide
|
||||
|
|
|
@ -98,9 +98,9 @@ FileSink::~FileSink()
|
|||
|
||||
|
||||
// fill source from file sink
|
||||
void FileSink::put(Source& source)
|
||||
size_t FileSink::put(Source& source)
|
||||
{
|
||||
fwrite(source.get_buffer(), 1, source.size(), file_);
|
||||
return fwrite(source.get_buffer(), 1, source.size(), file_);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,24 +1,10 @@
|
|||
/*
|
||||
Copyright (C) 2006, 2007 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
// test.cpp
|
||||
// test taocrypt functionality
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ SET(HEADERS_ABI
|
|||
mysql/plugin.h
|
||||
mysql/plugin_audit.h
|
||||
mysql/plugin_ftparser.h
|
||||
mysql/plugin_auth.h
|
||||
mysql/client_plugin.h
|
||||
)
|
||||
|
||||
SET(HEADERS
|
||||
|
|
|
@ -32,14 +32,14 @@ int internal_str2dec(const char *from, decimal_t *to, char **end,
|
|||
int decimal2string(const decimal_t *from, char *to, int *to_len,
|
||||
int fixed_precision, int fixed_decimals,
|
||||
char filler);
|
||||
int decimal2ulonglong(decimal_t *from, ulonglong *to);
|
||||
int decimal2ulonglong(const decimal_t *from, ulonglong *to);
|
||||
int ulonglong2decimal(ulonglong from, decimal_t *to);
|
||||
int decimal2longlong(decimal_t *from, longlong *to);
|
||||
int decimal2longlong(const decimal_t *from, longlong *to);
|
||||
int longlong2decimal(longlong from, decimal_t *to);
|
||||
int decimal2double(const decimal_t *from, double *to);
|
||||
int double2decimal(double from, decimal_t *to);
|
||||
int decimal_actual_fraction(decimal_t *from);
|
||||
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
|
||||
int decimal2bin(const decimal_t *from, uchar *to, int precision, int scale);
|
||||
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
|
||||
|
||||
int decimal_size(int precision, int scale);
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <my_compare.h>
|
||||
|
||||
#define HA_FT_MAXBYTELEN 254
|
||||
#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3)
|
||||
|
||||
|
|
|
@ -136,6 +136,8 @@ typedef struct st_heap_share
|
|||
ulong min_records,max_records; /* Params to open */
|
||||
ulonglong data_length,index_length,max_table_size;
|
||||
uint key_stat_version; /* version to indicate insert/delete */
|
||||
uint key_version; /* Updated on key change */
|
||||
uint file_version; /* Update on clear */
|
||||
uint records; /* records */
|
||||
uint blength; /* records rounded up to 2^n */
|
||||
uint deleted; /* Deleted records in database */
|
||||
|
@ -171,6 +173,8 @@ typedef struct st_heap_info
|
|||
enum ha_rkey_function last_find_flag;
|
||||
TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1];
|
||||
TREE_ELEMENT **last_pos;
|
||||
uint key_version; /* Version at last read */
|
||||
uint file_version; /* Version at scan */
|
||||
uint lastkey_len;
|
||||
my_bool implicit_emptied;
|
||||
THR_LOCK_DATA lock;
|
||||
|
|
|
@ -163,7 +163,8 @@ enum my_lex_states
|
|||
MY_LEX_USER_VARIABLE_DELIMITER, MY_LEX_SYSTEM_VAR,
|
||||
MY_LEX_IDENT_OR_KEYWORD,
|
||||
MY_LEX_IDENT_OR_HEX, MY_LEX_IDENT_OR_BIN, MY_LEX_IDENT_OR_NCHAR,
|
||||
MY_LEX_STRING_OR_DELIMITER
|
||||
MY_LEX_STRING_OR_DELIMITER, MY_LEX_MINUS_OR_COMMENT, MY_LEX_PLACEHOLDER,
|
||||
MY_LEX_COMMA
|
||||
};
|
||||
|
||||
struct charset_info_st;
|
||||
|
@ -389,6 +390,9 @@ extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
|
|||
extern void my_hash_sort_simple(CHARSET_INFO *cs,
|
||||
const uchar *key, size_t len,
|
||||
ulong *nr1, ulong *nr2);
|
||||
extern void my_hash_sort_bin(CHARSET_INFO *cs,
|
||||
const uchar *key, size_t len, ulong *nr1,
|
||||
ulong *nr2);
|
||||
|
||||
extern size_t my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, size_t length);
|
||||
|
||||
|
|
|
@ -90,6 +90,12 @@ extern const char _dig_vec_lower[];
|
|||
|
||||
extern char *strmov_overlapp(char *dest, const char *src);
|
||||
|
||||
#if defined(_lint) || defined(FORCE_INIT_OF_VARS)
|
||||
#define LINT_INIT_STRUCT(var) bzero(&var, sizeof(var)) /* No uninitialize-warning */
|
||||
#else
|
||||
#define LINT_INIT_STRUCT(var)
|
||||
#endif
|
||||
|
||||
/* Prototypes for string functions */
|
||||
|
||||
extern void bmove_upp(uchar *dst,const uchar *src,size_t len);
|
||||
|
@ -215,75 +221,6 @@ struct st_mysql_const_unsigned_lex_string
|
|||
};
|
||||
typedef struct st_mysql_const_unsigned_lex_string LEX_CUSTRING;
|
||||
|
||||
/* SPACE_INT is a word that contains only spaces */
|
||||
#if SIZEOF_INT == 4
|
||||
#define SPACE_INT 0x20202020
|
||||
#elif SIZEOF_INT == 8
|
||||
#define SPACE_INT 0x2020202020202020
|
||||
#else
|
||||
#error define the appropriate constant for a word full of spaces
|
||||
#endif
|
||||
|
||||
/**
|
||||
Skip trailing space.
|
||||
|
||||
On most systems reading memory in larger chunks (ideally equal to the size of
|
||||
the chinks that the machine physically reads from memory) causes fewer memory
|
||||
access loops and hence increased performance.
|
||||
This is why the 'int' type is used : it's closest to that (according to how
|
||||
it's defined in C).
|
||||
So when we determine the amount of whitespace at the end of a string we do
|
||||
the following :
|
||||
1. We divide the string into 3 zones :
|
||||
a) from the start of the string (__start) to the first multiple
|
||||
of sizeof(int) (__start_words)
|
||||
b) from the end of the string (__end) to the last multiple of sizeof(int)
|
||||
(__end_words)
|
||||
c) a zone that is aligned to sizeof(int) and can be safely accessed
|
||||
through an int *
|
||||
2. We start comparing backwards from (c) char-by-char. If all we find is
|
||||
space then we continue
|
||||
3. If there are elements in zone (b) we compare them as unsigned ints to a
|
||||
int mask (SPACE_INT) consisting of all spaces
|
||||
4. Finally we compare the remaining part (a) of the string char by char.
|
||||
This covers for the last non-space unsigned int from 3. (if any)
|
||||
|
||||
This algorithm works well for relatively larger strings, but it will slow
|
||||
the things down for smaller strings (because of the additional calculations
|
||||
and checks compared to the naive method). Thus the barrier of length 20
|
||||
is added.
|
||||
|
||||
@param ptr pointer to the input string
|
||||
@param len the length of the string
|
||||
@return the last non-space character
|
||||
*/
|
||||
|
||||
static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
|
||||
{
|
||||
const uchar *end= ptr + len;
|
||||
|
||||
if (len > 20)
|
||||
{
|
||||
const uchar *end_words= (const uchar *)(intptr)
|
||||
(((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT);
|
||||
const uchar *start_words= (const uchar *)(intptr)
|
||||
((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT);
|
||||
|
||||
DBUG_ASSERT(((ulonglong)(intptr)ptr) >= SIZEOF_INT);
|
||||
if (end_words > ptr)
|
||||
{
|
||||
while (end > end_words && end[-1] == 0x20)
|
||||
end--;
|
||||
if (end[-1] == 0x20 && start_words < end_words)
|
||||
while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT)
|
||||
end -= SIZEOF_INT;
|
||||
}
|
||||
}
|
||||
while (end > ptr && end[-1] == 0x20)
|
||||
end--;
|
||||
return (end);
|
||||
}
|
||||
|
||||
static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
|
||||
{
|
||||
lex_str->str= (char *) c_str;
|
||||
|
|
147
include/ma_dyncol.h
Normal file
147
include/ma_dyncol.h
Normal file
|
@ -0,0 +1,147 @@
|
|||
/* Copyright (c) 2011, Monty Program Ab
|
||||
Copyright (c) 2011, Oleksandr Byelkin
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef ma_dyncol_h
|
||||
#define ma_dyncol_h
|
||||
|
||||
#include <decimal.h>
|
||||
#include <my_decimal_limits.h>
|
||||
#include <mysql_time.h>
|
||||
|
||||
/*
|
||||
Max length for data in a dynamic colums. This comes from how the
|
||||
how the offset are stored.
|
||||
*/
|
||||
#define MAX_DYNAMIC_COLUMN_LENGTH 0X1FFFFFFFL
|
||||
|
||||
/* NO and OK is the same used just to show semantics */
|
||||
#define ER_DYNCOL_NO ER_DYNCOL_OK
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
{
|
||||
ER_DYNCOL_OK= 0,
|
||||
ER_DYNCOL_YES= 1, /* For functions returning 0/1 */
|
||||
ER_DYNCOL_FORMAT= -1, /* Wrong format of the encoded string */
|
||||
ER_DYNCOL_LIMIT= -2, /* Some limit reached */
|
||||
ER_DYNCOL_RESOURCE= -3, /* Out of resourses */
|
||||
ER_DYNCOL_DATA= -4, /* Incorrect input data */
|
||||
ER_DYNCOL_UNKNOWN_CHARSET= -5 /* Unknown character set */
|
||||
};
|
||||
|
||||
typedef DYNAMIC_STRING DYNAMIC_COLUMN;
|
||||
|
||||
enum enum_dynamic_column_type
|
||||
{
|
||||
DYN_COL_NULL= 0,
|
||||
DYN_COL_INT,
|
||||
DYN_COL_UINT,
|
||||
DYN_COL_DOUBLE,
|
||||
DYN_COL_STRING,
|
||||
DYN_COL_DECIMAL,
|
||||
DYN_COL_DATETIME,
|
||||
DYN_COL_DATE,
|
||||
DYN_COL_TIME
|
||||
};
|
||||
|
||||
typedef enum enum_dynamic_column_type DYNAMIC_COLUMN_TYPE;
|
||||
|
||||
struct st_dynamic_column_value
|
||||
{
|
||||
DYNAMIC_COLUMN_TYPE type;
|
||||
union
|
||||
{
|
||||
long long long_value;
|
||||
unsigned long long ulong_value;
|
||||
double double_value;
|
||||
struct {
|
||||
LEX_STRING string_value;
|
||||
CHARSET_INFO *charset;
|
||||
};
|
||||
struct {
|
||||
decimal_digit_t decimal_buffer[DECIMAL_BUFF_LENGTH];
|
||||
decimal_t decimal_value;
|
||||
};
|
||||
MYSQL_TIME time_value;
|
||||
};
|
||||
};
|
||||
|
||||
typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE;
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_create(DYNAMIC_COLUMN *str,
|
||||
uint column_nr, DYNAMIC_COLUMN_VALUE *value);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_create_many(DYNAMIC_COLUMN *str,
|
||||
uint column_count,
|
||||
uint *column_numbers,
|
||||
DYNAMIC_COLUMN_VALUE *values);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr,
|
||||
DYNAMIC_COLUMN_VALUE *value);
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_update_many(DYNAMIC_COLUMN *str,
|
||||
uint add_column_count,
|
||||
uint *column_numbers,
|
||||
DYNAMIC_COLUMN_VALUE *values);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_delete(DYNAMIC_COLUMN *org, uint column_nr);
|
||||
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr);
|
||||
|
||||
/* List of not NULL columns */
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint);
|
||||
|
||||
/*
|
||||
if the column do not exists it is NULL
|
||||
*/
|
||||
enum enum_dyncol_func_result
|
||||
dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
|
||||
DYNAMIC_COLUMN_VALUE *store_it_here);
|
||||
|
||||
#define dynamic_column_initialize(A) memset((A), 0, sizeof(*(A)))
|
||||
#define dynamic_column_column_free(V) dynstr_free(V)
|
||||
|
||||
/***************************************************************************
|
||||
Internal functions, don't use if you don't know what you are doing...
|
||||
***************************************************************************/
|
||||
|
||||
#define dynamic_column_reassociate(V,P,L, A) dynstr_reassociate((V),(P),(L),(A))
|
||||
|
||||
#define dynamic_column_value_init(V) (V)->type= DYN_COL_NULL
|
||||
|
||||
/*
|
||||
Prepare value for using as decimal
|
||||
*/
|
||||
void dynamic_column_prepare_decimal(DYNAMIC_COLUMN_VALUE *value);
|
||||
|
||||
#endif
|
|
@ -430,7 +430,8 @@ int maria_repair_by_sort(HA_CHECK *param, MARIA_HA *info,
|
|||
int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
||||
const char *name, my_bool rep_quick);
|
||||
int maria_change_to_newfile(const char *filename, const char *old_ext,
|
||||
const char *new_ext, myf myflags);
|
||||
const char *new_ext, time_t backup_time,
|
||||
myf myflags);
|
||||
void maria_lock_memory(HA_CHECK *param);
|
||||
int maria_update_state_info(HA_CHECK *param, MARIA_HA *info, uint update);
|
||||
void maria_update_key_parts(MARIA_KEYDEF *keyinfo, double *rec_per_key_part,
|
||||
|
|
|
@ -36,10 +36,15 @@
|
|||
#ifndef __attribute__
|
||||
# if !defined(__GNUC__)
|
||||
# define __attribute__(A)
|
||||
# elif GCC_VERSION < 2008
|
||||
# define __attribute__(A)
|
||||
# elif defined(__cplusplus) && GCC_VERSION < 3004
|
||||
# define __attribute__(A)
|
||||
# else
|
||||
# ifndef GCC_VERSION
|
||||
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
# endif
|
||||
# if GCC_VERSION < 2008
|
||||
# define __attribute__(A)
|
||||
# elif defined(__cplusplus) && GCC_VERSION < 3004
|
||||
# define __attribute__(A)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -461,7 +461,9 @@ enum ha_base_keytype {
|
|||
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */
|
||||
#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */
|
||||
#define HA_ERR_ROW_NOT_VISIBLE 179
|
||||
#define HA_ERR_LAST 179 /* Copy of last error nr */
|
||||
#define HA_ERR_ABORTED_BY_USER 180
|
||||
#define HA_ERR_DISK_FULL 181
|
||||
#define HA_ERR_LAST 181 /* Copy of last error nr */
|
||||
|
||||
/* Number of different errors */
|
||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||
|
@ -535,7 +537,7 @@ enum en_fieldtype {
|
|||
};
|
||||
|
||||
enum data_file_type {
|
||||
STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD
|
||||
STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD, NO_RECORD
|
||||
};
|
||||
|
||||
/* For key ranges */
|
||||
|
@ -558,11 +560,13 @@ typedef struct st_key_range
|
|||
enum ha_rkey_function flag;
|
||||
} key_range;
|
||||
|
||||
typedef void *range_id_t;
|
||||
|
||||
typedef struct st_key_multi_range
|
||||
{
|
||||
key_range start_key;
|
||||
key_range end_key;
|
||||
char *ptr; /* Free to use by caller (ptr to row etc) */
|
||||
range_id_t ptr; /* Free to use by caller (ptr to row etc) */
|
||||
uint range_flag; /* key range flags see above */
|
||||
} KEY_MULTI_RANGE;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2007, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011, 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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009-2011, 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
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2011, Oracle and/or its affiliates.
|
||||
Copyright (c) Monty Program Ab; 1991-2011
|
||||
|
||||
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
|
||||
|
@ -61,22 +62,22 @@ typedef struct st_HA_KEYSEG /* Key-portion */
|
|||
} HA_KEYSEG;
|
||||
|
||||
#define get_key_length(length,key) \
|
||||
{ if (*(uchar*) (key) != 255) \
|
||||
length= (uint) *(uchar*) ((key)++); \
|
||||
{ if (*(const uchar*) (key) != 255) \
|
||||
length= (uint) *(const uchar*) ((key)++); \
|
||||
else \
|
||||
{ length= mi_uint2korr((key)+1); (key)+=3; } \
|
||||
}
|
||||
|
||||
#define get_key_length_rdonly(length,key) \
|
||||
{ if (*(uchar*) (key) != 255) \
|
||||
length= ((uint) *(uchar*) ((key))); \
|
||||
{ if (*(const uchar*) (key) != 255) \
|
||||
length= ((uint) *(const uchar*) ((key))); \
|
||||
else \
|
||||
{ length= mi_uint2korr((key)+1); } \
|
||||
}
|
||||
|
||||
#define get_key_pack_length(length,length_pack,key) \
|
||||
{ if (*(uchar*) (key) != 255) \
|
||||
{ length= (uint) *(uchar*) ((key)++); length_pack= 1; }\
|
||||
{ if (*(const uchar*) (key) != 255) \
|
||||
{ length= (uint) *(const uchar*) ((key)++); length_pack= 1; }\
|
||||
else \
|
||||
{ length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef MY_COMPILER_INCLUDED
|
||||
#define MY_COMPILER_INCLUDED
|
||||
|
||||
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2010, Oracle and/or its affiliates.
|
||||
|
||||
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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000 MySQL AB & 2009 Monty Program Ab
|
||||
/* Copyright (c) 2009-2011 Monty Program Ab
|
||||
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
@ -14,16 +14,10 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef MY_DBUG_INCLUDED
|
||||
#define MY_DBUG_INCLUDED
|
||||
#ifndef _my_dbug_h
|
||||
#define _my_dbug_h
|
||||
|
||||
#ifndef __WIN__
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#endif /* not __WIN__ */
|
||||
|
||||
|
@ -96,7 +90,7 @@ extern void _db_free_(void *ptr);
|
|||
#define DBUG_END() _db_end_ ()
|
||||
#define DBUG_LOCK_FILE _db_lock_file_()
|
||||
#define DBUG_UNLOCK_FILE _db_unlock_file_()
|
||||
#define DBUG_ASSERT(A) assert(A)
|
||||
#define DBUG_ASSERT(A) do { _db_flush_(); assert(A); } while(0)
|
||||
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
|
||||
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
|
||||
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
|
||||
|
@ -104,6 +98,7 @@ extern void _db_free_(void *ptr);
|
|||
#define DBUG_MALLOC(SIZE) _db_malloc_(SIZE)
|
||||
#define DBUG_REALLOC(PTR,SIZE) _db_realloc_(PTR,SIZE)
|
||||
#define DBUG_FREE(PTR) _db_free_(PTR)
|
||||
#define IF_DBUG(A,B) A
|
||||
|
||||
#ifndef __WIN__
|
||||
#define DBUG_ABORT() (_db_flush_(), abort())
|
||||
|
@ -118,15 +113,6 @@ extern void _db_free_(void *ptr);
|
|||
(void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
|
||||
_exit(3))
|
||||
#endif
|
||||
#define DBUG_CHECK_CRASH(func, op) \
|
||||
do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \
|
||||
DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0)
|
||||
#define DBUG_CRASH_ENTER(func) \
|
||||
DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter")
|
||||
#define DBUG_CRASH_RETURN(val) \
|
||||
DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
|
||||
#define DBUG_CRASH_VOID_RETURN \
|
||||
DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
|
||||
|
||||
/*
|
||||
Make the program fail, without creating a core file.
|
||||
|
@ -173,6 +159,7 @@ extern void _db_suicide_();
|
|||
#define DBUG_MALLOC(SIZE) malloc(SIZE)
|
||||
#define DBUG_REALLOC(PTR,SIZE) realloc(PTR,SIZE)
|
||||
#define DBUG_FREE(PTR) free(PTR)
|
||||
#define IF_DBUG(A,B) B
|
||||
#define DBUG_ABORT() do { } while(0)
|
||||
#define DBUG_CRASH_ENTER(func)
|
||||
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
|
||||
|
@ -200,4 +187,4 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* MY_DBUG_INCLUDED */
|
||||
#endif /* _my_dbug_h */
|
||||
|
|
45
include/my_decimal_limits.h
Normal file
45
include/my_decimal_limits.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
#ifndef MY_DECIMAL_LIMITS_INCLUDED
|
||||
#define MY_DECIMAL_LIMITS_INCLUDED
|
||||
/* Copyright (c) 2011 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
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#define DECIMAL_LONGLONG_DIGITS 22
|
||||
#define DECIMAL_LONG_DIGITS 10
|
||||
#define DECIMAL_LONG3_DIGITS 8
|
||||
|
||||
/** maximum length of buffer in our big digits (uint32). */
|
||||
#define DECIMAL_BUFF_LENGTH 9
|
||||
|
||||
/* the number of digits that my_decimal can possibly contain */
|
||||
#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
|
||||
|
||||
|
||||
/**
|
||||
maximum guaranteed precision of number in decimal digits (number of our
|
||||
digits * number of decimal digits in one our big digit - number of decimal
|
||||
digits in one our big digit decreased by 1 (because we always put decimal
|
||||
point on the border of our big digits))
|
||||
*/
|
||||
#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
|
||||
#define DECIMAL_MAX_SCALE 30
|
||||
#define DECIMAL_NOT_SPECIFIED 31
|
||||
|
||||
/**
|
||||
maximum length of string representation (number of maximum decimal
|
||||
digits + 1 position for sign + 1 position for decimal point)
|
||||
*/
|
||||
#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
|
||||
|
||||
#endif /* MY_DECIMAL_LIMITS_INCLUDED */
|
|
@ -753,10 +753,10 @@ inline unsigned long long my_double2ulonglong(double d)
|
|||
#define strtok_r(A,B,C) strtok((A),(B))
|
||||
#endif
|
||||
|
||||
/* This is from the old m-machine.h file */
|
||||
|
||||
#if SIZEOF_LONG_LONG > 4
|
||||
#if SIZEOF_LONG_LONG >= 8
|
||||
#define HAVE_LONG_LONG 1
|
||||
#else
|
||||
#error WHAT? sizeof(long long) < 8 ???
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc,
|
||||
2010-2011 Oracle and/or its affiliates, 2009-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
|
||||
|
@ -85,37 +86,11 @@ typedef volatile LONG my_pthread_once_t;
|
|||
#define MY_PTHREAD_ONCE_INPROGRESS 1
|
||||
#define MY_PTHREAD_ONCE_DONE 2
|
||||
|
||||
/*
|
||||
Struct and macros to be used in combination with the
|
||||
windows implementation of pthread_cond_timedwait
|
||||
*/
|
||||
|
||||
/*
|
||||
Declare a union to make sure FILETIME is properly aligned
|
||||
so it can be used directly as a 64 bit value. The value
|
||||
stored is in 100ns units.
|
||||
*/
|
||||
union ft64 {
|
||||
FILETIME ft;
|
||||
__int64 i64;
|
||||
};
|
||||
|
||||
struct timespec {
|
||||
union ft64 tv;
|
||||
/* The max timeout value in millisecond for pthread_cond_timedwait */
|
||||
long max_timeout_msec;
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
|
||||
#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \
|
||||
(ABSTIME).tv.i64= (TIME)+(__int64)(NSEC)/100; \
|
||||
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
|
||||
} while(0)
|
||||
|
||||
#define set_timespec_nsec(ABSTIME,NSEC) do { \
|
||||
union ft64 tv; \
|
||||
GetSystemTimeAsFileTime(&tv.ft); \
|
||||
set_timespec_time_nsec((ABSTIME), tv.i64, (NSEC)); \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
Compare two timespec structs.
|
||||
|
@ -413,7 +388,7 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
|
|||
|
||||
#ifndef set_timespec_nsec
|
||||
#define set_timespec_nsec(ABSTIME,NSEC) \
|
||||
set_timespec_time_nsec((ABSTIME),my_getsystime(),(NSEC))
|
||||
set_timespec_time_nsec((ABSTIME), my_hrtime().val*1000 + (NSEC))
|
||||
#endif /* !set_timespec_nsec */
|
||||
|
||||
/* adapt for two different flavors of struct timespec */
|
||||
|
@ -443,11 +418,10 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
|
|||
#endif /* !cmp_timespec */
|
||||
|
||||
#ifndef set_timespec_time_nsec
|
||||
#define set_timespec_time_nsec(ABSTIME,TIME,NSEC) do { \
|
||||
ulonglong nsec= (NSEC); \
|
||||
ulonglong now= (TIME) + (nsec/100); \
|
||||
(ABSTIME).MY_tv_sec= (now / ULL(10000000)); \
|
||||
(ABSTIME).MY_tv_nsec= (now % ULL(10000000) * 100 + (nsec % 100)); \
|
||||
#define set_timespec_time_nsec(ABSTIME,NSEC) do { \
|
||||
ulonglong now= (NSEC); \
|
||||
(ABSTIME).MY_tv_sec= (now / 1000000000ULL); \
|
||||
(ABSTIME).MY_tv_nsec= (now % 1000000000ULL); \
|
||||
} while(0)
|
||||
#endif /* !set_timespec_time_nsec */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (C) 2000-2003 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -38,6 +38,7 @@ typedef struct my_aio_result {
|
|||
#ifdef _WIN32
|
||||
#include <malloc.h> /*for alloca*/
|
||||
#endif
|
||||
#include <mysql/plugin.h>
|
||||
|
||||
#define MY_INIT(name) { my_progname= name; my_init(); }
|
||||
|
||||
|
@ -142,6 +143,9 @@ typedef struct my_aio_result {
|
|||
#define GETDATE_GMT 8
|
||||
#define GETDATE_FIXEDLENGTH 16
|
||||
|
||||
/* Extra length needed for filename if one calls my_create_backup_name */
|
||||
#define MY_BACKUP_NAME_EXTRA_LENGTH 17
|
||||
|
||||
/* defines when allocating data */
|
||||
extern void *my_malloc(size_t Size,myf MyFlags);
|
||||
extern void *my_multi_malloc(myf MyFlags, ...);
|
||||
|
@ -171,7 +175,7 @@ extern void my_large_free(uchar *ptr);
|
|||
#define my_large_free(A) my_free_lock((A))
|
||||
#endif /* HAVE_LARGE_PAGES */
|
||||
|
||||
#ifdef HAVE_ALLOCA
|
||||
#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
|
||||
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
|
||||
#pragma alloca
|
||||
#endif /* _AIX */
|
||||
|
@ -209,7 +213,7 @@ extern void (*fatal_error_handler_hook)(uint my_err, const char *str,
|
|||
extern uint my_file_limit;
|
||||
extern ulong my_thread_stack_size;
|
||||
|
||||
extern const char *(*proc_info_hook)(void *, const char *, const char *,
|
||||
extern const char *(*proc_info_hook)(MYSQL_THD, const char *, const char *,
|
||||
const char *, const unsigned int);
|
||||
|
||||
#ifdef HAVE_LARGE_PAGES
|
||||
|
@ -314,9 +318,6 @@ struct st_my_file_info
|
|||
int oflag; /* open flags, e.g O_APPEND */
|
||||
#endif
|
||||
enum file_type type;
|
||||
#if !defined(HAVE_PREAD) && !defined(_WIN32)
|
||||
mysql_mutex_t mutex;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern struct st_my_file_info *my_file_info;
|
||||
|
@ -528,6 +529,8 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
|
|||
|
||||
#define my_b_tell(info) ((info)->pos_in_file + \
|
||||
(size_t) (*(info)->current_pos - (info)->request_pos))
|
||||
#define my_b_write_tell(info) ((info)->pos_in_file + \
|
||||
((info)->write_pos - (info)->write_buffer))
|
||||
|
||||
#define my_b_get_buffer_start(info) (info)->request_pos
|
||||
#define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \
|
||||
|
@ -651,7 +654,10 @@ extern void my_message(uint my_err, const char *str,myf MyFlags);
|
|||
extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
|
||||
extern my_bool my_init(void);
|
||||
extern void my_end(int infoflag);
|
||||
extern int my_redel(const char *from, const char *to, int MyFlags);
|
||||
extern int my_redel(const char *from, const char *to, time_t backup_time_stamp,
|
||||
myf MyFlags);
|
||||
void my_create_backup_name(char *to, const char *from,
|
||||
time_t backup_time_stamp);
|
||||
extern int my_copystat(const char *from, const char *to, int MyFlags);
|
||||
extern char * my_filename(File fd);
|
||||
|
||||
|
@ -796,6 +802,8 @@ extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
|
|||
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size);
|
||||
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n);
|
||||
extern void dynstr_free(DYNAMIC_STRING *str);
|
||||
extern void dynstr_reassociate(DYNAMIC_STRING *str, char **res, size_t *length,
|
||||
size_t *alloc_length);
|
||||
#ifdef HAVE_MLOCK
|
||||
extern void *my_malloc_lock(size_t length,myf flags);
|
||||
extern void my_free_lock(void *ptr);
|
||||
|
@ -861,15 +869,23 @@ extern ulong crc32(ulong crc, const uchar *buf, uint len);
|
|||
extern uint my_set_max_open_files(uint files);
|
||||
void my_free_open_file_info(void);
|
||||
|
||||
extern time_t my_time(myf flags);
|
||||
extern ulonglong my_getsystime(void);
|
||||
extern ulonglong my_getcputime(void);
|
||||
extern ulonglong my_micro_time();
|
||||
extern ulonglong my_micro_time_and_time(time_t *time_arg);
|
||||
time_t my_time_possible_from_micro(ulonglong microtime);
|
||||
extern my_bool my_gethwaddr(uchar *to);
|
||||
extern int my_getncpus();
|
||||
|
||||
#define HRTIME_RESOLUTION 1000000ULL /* microseconds */
|
||||
typedef struct {ulonglong val;} my_hrtime_t;
|
||||
void my_time_init();
|
||||
extern my_hrtime_t my_hrtime();
|
||||
extern ulonglong my_interval_timer(void);
|
||||
extern ulonglong my_getcputime(void);
|
||||
|
||||
#define microsecond_interval_timer() (my_interval_timer()/1000)
|
||||
#define hrtime_to_time(X) ((X).val/HRTIME_RESOLUTION)
|
||||
#define hrtime_from_time(X) ((ulonglong)((X)*HRTIME_RESOLUTION))
|
||||
#define hrtime_to_double(X) ((X).val/(double)HRTIME_RESOLUTION)
|
||||
#define hrtime_sec_part(X) ((ulong)((X).val % HRTIME_RESOLUTION))
|
||||
#define my_time(X) hrtime_to_time(my_hrtime())
|
||||
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef long my_time_t;
|
|||
#define TIMESTAMP_MAX_YEAR 2038
|
||||
#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1)
|
||||
#define TIMESTAMP_MAX_VALUE INT_MAX32
|
||||
#define TIMESTAMP_MIN_VALUE 1
|
||||
#define TIMESTAMP_MIN_VALUE 0
|
||||
|
||||
/* two-digit years < this are 20..; >= this are 19.. */
|
||||
#define YY_PART_YEAR 70
|
||||
|
@ -66,6 +66,7 @@ typedef long my_time_t;
|
|||
/* Flags to str_to_datetime */
|
||||
#define TIME_FUZZY_DATE 1
|
||||
#define TIME_DATETIME_ONLY 2
|
||||
#define TIME_TIME_ONLY 4
|
||||
/* Must be same as MODE_NO_ZERO_IN_DATE */
|
||||
#define TIME_NO_ZERO_IN_DATE (65536L*2*2*2*2*2*2*2)
|
||||
/* Must be same as MODE_NO_ZERO_DATE */
|
||||
|
@ -79,28 +80,46 @@ typedef long my_time_t;
|
|||
#define TIME_MAX_HOUR 838
|
||||
#define TIME_MAX_MINUTE 59
|
||||
#define TIME_MAX_SECOND 59
|
||||
#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \
|
||||
TIME_MAX_SECOND)
|
||||
#define TIME_MAX_SECOND_PART 999999
|
||||
#define TIME_SECOND_PART_FACTOR (TIME_MAX_SECOND_PART+1)
|
||||
#define TIME_SECOND_PART_DIGITS 6
|
||||
#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + TIME_MAX_SECOND)
|
||||
#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \
|
||||
TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND)
|
||||
|
||||
my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
|
||||
ulonglong flags, int *was_cut);
|
||||
enum enum_mysql_timestamp_type
|
||||
str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
|
||||
ulong flag, int *warning);
|
||||
enum enum_mysql_timestamp_type
|
||||
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
|
||||
ulonglong flags, int *was_cut);
|
||||
longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
|
||||
longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res,
|
||||
ulonglong flags, int *was_cut);
|
||||
|
||||
static inline
|
||||
longlong double_to_datetime(double nr, MYSQL_TIME *ltime, uint flags, int *cut)
|
||||
{
|
||||
if (nr < 0 || nr > LONGLONG_MAX)
|
||||
nr= (double)LONGLONG_MAX;
|
||||
return number_to_datetime((longlong) floor(nr),
|
||||
(ulong)((nr-floor(nr))*TIME_SECOND_PART_FACTOR),
|
||||
ltime, flags, cut);
|
||||
}
|
||||
|
||||
int number_to_time(my_bool neg, longlong nr, ulong sec_part,
|
||||
MYSQL_TIME *ltime, int *was_cut);
|
||||
ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
|
||||
ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *);
|
||||
ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *);
|
||||
ulonglong TIME_to_ulonglong(const MYSQL_TIME *);
|
||||
double TIME_to_double(const MYSQL_TIME *my_time);
|
||||
|
||||
longlong pack_time(MYSQL_TIME *my_time);
|
||||
MYSQL_TIME *unpack_time(longlong packed, MYSQL_TIME *my_time);
|
||||
|
||||
my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
|
||||
int *warning);
|
||||
|
||||
int check_time_range(struct st_mysql_time *, int *warning);
|
||||
int check_time_range(struct st_mysql_time *my_time, uint dec, int *warning);
|
||||
|
||||
long calc_daynr(uint year,uint month,uint day);
|
||||
uint calc_days_in_year(uint year);
|
||||
|
@ -133,8 +152,7 @@ static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
|
|||
}
|
||||
|
||||
my_time_t
|
||||
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone,
|
||||
my_bool *in_dst_time_gap);
|
||||
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, uint *error_code);
|
||||
|
||||
void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
|
||||
|
||||
|
@ -147,11 +165,28 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
|
|||
sent using binary protocol fit in this buffer.
|
||||
*/
|
||||
#define MAX_DATE_STRING_REP_LENGTH 30
|
||||
#define AUTO_SEC_PART_DIGITS 31 /* same as NOT_FIXED_DEC */
|
||||
|
||||
int my_time_to_str(const MYSQL_TIME *l_time, char *to);
|
||||
int my_time_to_str(const MYSQL_TIME *l_time, char *to, uint digits);
|
||||
int my_date_to_str(const MYSQL_TIME *l_time, char *to);
|
||||
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to);
|
||||
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to);
|
||||
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to, uint digits);
|
||||
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to, uint digits);
|
||||
|
||||
static inline longlong sec_part_shift(longlong second_part, uint digits)
|
||||
{
|
||||
return second_part / (longlong)log_10_int[TIME_SECOND_PART_DIGITS - digits];
|
||||
}
|
||||
static inline longlong sec_part_unshift(longlong second_part, uint digits)
|
||||
{
|
||||
return second_part * (longlong)log_10_int[TIME_SECOND_PART_DIGITS - digits];
|
||||
}
|
||||
static inline ulong sec_part_truncate(ulong second_part, uint digits)
|
||||
{
|
||||
/* the cast here should be unnecessary! */
|
||||
return second_part - second_part % (ulong)log_10_int[TIME_SECOND_PART_DIGITS - digits];
|
||||
}
|
||||
|
||||
#define hrtime_to_my_time(X) ((my_time_t)hrtime_to_time(X))
|
||||
|
||||
/*
|
||||
Available interval types used in any statement.
|
||||
|
|
|
@ -31,7 +31,17 @@ extern "C" {
|
|||
|
||||
#define tree_set_pointer(element,ptr) *((uchar **) (element+1))=((uchar*) (ptr))
|
||||
|
||||
/*
|
||||
A tree with its flag set to TREE_ONLY_DUPS behaves differently on inserting
|
||||
an element that is not in the tree:
|
||||
the element is not added at all, but instead tree_insert() returns a special
|
||||
address TREE_ELEMENT_UNIQUE as an indication that the function has not failed
|
||||
due to lack of memory.
|
||||
*/
|
||||
|
||||
#define TREE_ELEMENT_UNIQUE ((TREE_ELEMENT *) 1)
|
||||
#define TREE_NO_DUPS 1
|
||||
#define TREE_ONLY_DUPS 2
|
||||
|
||||
typedef enum { left_root_right, right_root_left } TREE_WALK;
|
||||
typedef uint32 element_count;
|
||||
|
|
|
@ -290,6 +290,8 @@ extern int mi_is_changed(struct st_myisam_info *info);
|
|||
extern int mi_delete_all_rows(struct st_myisam_info *info);
|
||||
extern ulong _mi_calc_blob_length(uint length , const uchar *pos);
|
||||
extern uint mi_get_pointer_length(ulonglong file_length, uint def);
|
||||
extern int mi_make_backup_of_index(struct st_myisam_info *info,
|
||||
time_t backup_time, myf flags);
|
||||
|
||||
#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */
|
||||
/* this is used to pass to mysql_myisamchk_table */
|
||||
|
@ -382,7 +384,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
|
|||
int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
|
||||
const char * name, int rep_quick);
|
||||
int change_to_newfile(const char * filename, const char * old_ext,
|
||||
const char * new_ext, myf myflags);
|
||||
const char * new_ext, time_t backup_time, myf myflags);
|
||||
int lock_file(HA_CHECK *param, File file, my_off_t start, int lock_type,
|
||||
const char *filetype, const char *filename);
|
||||
void lock_memory(HA_CHECK *param);
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
#define TT_USEFRM 1
|
||||
#define TT_FOR_UPGRADE 2
|
||||
|
||||
#define O_NEW_INDEX 1 /* Bits set in out_flag */
|
||||
/* Bits set in out_flag */
|
||||
#define O_NEW_DATA 2
|
||||
#define O_DATA_LOST 4
|
||||
|
||||
|
@ -141,6 +141,7 @@ typedef struct st_handler_check_param
|
|||
ulonglong use_buffers; /* Used as param to getopt() */
|
||||
size_t read_buffer_length, write_buffer_length;
|
||||
size_t sort_buffer_length, sort_key_blocks;
|
||||
time_t backup_time; /* To sign backup files */
|
||||
ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
|
||||
double new_rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
|
||||
uint out_flag, warning_printed, error_printed, verbose;
|
||||
|
@ -154,6 +155,11 @@ typedef struct st_handler_check_param
|
|||
char temp_filename[FN_REFLEN];
|
||||
IO_CACHE read_cache;
|
||||
enum_handler_stats_method stats_method;
|
||||
/* For reporting progress */
|
||||
uint stage, max_stage;
|
||||
uint progress_counter; /* How often to call _report_progress() */
|
||||
ulonglong progress, max_progress;
|
||||
|
||||
mysql_mutex_t print_msg_mutex;
|
||||
my_bool need_print_msg_lock;
|
||||
} HA_CHECK;
|
||||
|
|
|
@ -166,7 +166,8 @@ enum mysql_option
|
|||
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
|
||||
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
|
||||
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
|
||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH
|
||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
|
||||
MYSQL_PROGRESS_CALLBACK
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -100,7 +100,8 @@ int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
|
|||
struct my_rnd_struct;
|
||||
enum Item_result
|
||||
{
|
||||
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT
|
||||
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT,
|
||||
TIME_RESULT,IMPOSSIBLE_RESULT
|
||||
};
|
||||
typedef struct st_udf_args
|
||||
{
|
||||
|
@ -261,7 +262,8 @@ enum mysql_option
|
|||
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
|
||||
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
|
||||
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
|
||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH
|
||||
MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
|
||||
MYSQL_PROGRESS_CALLBACK
|
||||
};
|
||||
struct st_mysql_options_extention;
|
||||
struct st_mysql_options {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
Copyright (C) 2009-2011 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
|
||||
|
@ -75,7 +76,7 @@ typedef struct st_mysql_xid MYSQL_XID;
|
|||
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102
|
||||
|
||||
/* MariaDB plugin interface version */
|
||||
#define MARIA_PLUGIN_INTERFACE_VERSION 0x0100
|
||||
#define MARIA_PLUGIN_INTERFACE_VERSION 0x0101
|
||||
|
||||
/*
|
||||
The allowable types of plugins
|
||||
|
@ -590,10 +591,6 @@ char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
|
|||
/* Increments the row counter, see THD::row_count */
|
||||
void thd_inc_row_count(MYSQL_THD thd);
|
||||
|
||||
#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, __func__, __FILE__, __LINE__)
|
||||
const char *set_thd_proc_info(void *, const char * info, const char *func,
|
||||
const char *file, const unsigned int line);
|
||||
|
||||
/**
|
||||
Create a temporary file.
|
||||
|
||||
|
|
|
@ -59,6 +59,27 @@ extern struct my_thread_scheduler_service {
|
|||
} *my_thread_scheduler_service;
|
||||
int my_thread_scheduler_set(struct scheduler_functions *scheduler);
|
||||
int my_thread_scheduler_reset();
|
||||
#include <mysql/service_progress_report.h>
|
||||
extern struct progress_report_service_st {
|
||||
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
|
||||
void (*thd_progress_report_func)(void* thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void (*thd_progress_next_stage_func)(void* thd);
|
||||
void (*thd_progress_end_func)(void* thd);
|
||||
const char *(*set_thd_proc_info_func)(void*, const char *info,
|
||||
const char *func,
|
||||
const char *file,
|
||||
unsigned int line);
|
||||
} *progress_report_service;
|
||||
void thd_progress_init(void* thd, unsigned int max_stage);
|
||||
void thd_progress_report(void* thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void thd_progress_next_stage(void* thd);
|
||||
void thd_progress_end(void* thd);
|
||||
const char *set_thd_proc_info(void*, const char * info, const char *func,
|
||||
const char *file, unsigned int line);
|
||||
struct st_mysql_xid {
|
||||
long formatID;
|
||||
long gtrid_length;
|
||||
|
@ -200,8 +221,6 @@ int thd_tx_isolation(const void* thd);
|
|||
char *thd_security_context(void* thd, char *buffer, unsigned int length,
|
||||
unsigned int max_query_len);
|
||||
void thd_inc_row_count(void* thd);
|
||||
const char *set_thd_proc_info(void*, const char * info, const char *func,
|
||||
const char *file, const unsigned int line);
|
||||
int mysql_tmpfile(const char *prefix);
|
||||
int thd_killed(const void* thd);
|
||||
unsigned long thd_get_thread_id(const void* thd);
|
||||
|
|
|
@ -59,6 +59,27 @@ extern struct my_thread_scheduler_service {
|
|||
} *my_thread_scheduler_service;
|
||||
int my_thread_scheduler_set(struct scheduler_functions *scheduler);
|
||||
int my_thread_scheduler_reset();
|
||||
#include <mysql/service_progress_report.h>
|
||||
extern struct progress_report_service_st {
|
||||
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
|
||||
void (*thd_progress_report_func)(void* thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void (*thd_progress_next_stage_func)(void* thd);
|
||||
void (*thd_progress_end_func)(void* thd);
|
||||
const char *(*set_thd_proc_info_func)(void*, const char *info,
|
||||
const char *func,
|
||||
const char *file,
|
||||
unsigned int line);
|
||||
} *progress_report_service;
|
||||
void thd_progress_init(void* thd, unsigned int max_stage);
|
||||
void thd_progress_report(void* thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void thd_progress_next_stage(void* thd);
|
||||
void thd_progress_end(void* thd);
|
||||
const char *set_thd_proc_info(void*, const char * info, const char *func,
|
||||
const char *file, unsigned int line);
|
||||
struct st_mysql_xid {
|
||||
long formatID;
|
||||
long gtrid_length;
|
||||
|
@ -200,8 +221,6 @@ int thd_tx_isolation(const void* thd);
|
|||
char *thd_security_context(void* thd, char *buffer, unsigned int length,
|
||||
unsigned int max_query_len);
|
||||
void thd_inc_row_count(void* thd);
|
||||
const char *set_thd_proc_info(void *, const char * info, const char *func,
|
||||
const char *file, const unsigned int line);
|
||||
int mysql_tmpfile(const char *prefix);
|
||||
int thd_killed(const void* thd);
|
||||
unsigned long thd_get_thread_id(const void* thd);
|
||||
|
|
|
@ -43,7 +43,7 @@ typedef enum _thd_wait_type_e {
|
|||
THD_WAIT_BINLOG= 8,
|
||||
THD_WAIT_GROUP_COMMIT= 9,
|
||||
THD_WAIT_SYNC= 10,
|
||||
THD_WAIT_LAST= 11
|
||||
THD_WAIT_LAST= 11
|
||||
} thd_wait_type;
|
||||
extern struct thd_wait_service_st {
|
||||
void (*thd_wait_begin_func)(void*, int);
|
||||
|
@ -59,6 +59,27 @@ extern struct my_thread_scheduler_service {
|
|||
} *my_thread_scheduler_service;
|
||||
int my_thread_scheduler_set(struct scheduler_functions *scheduler);
|
||||
int my_thread_scheduler_reset();
|
||||
#include <mysql/service_progress_report.h>
|
||||
extern struct progress_report_service_st {
|
||||
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
|
||||
void (*thd_progress_report_func)(void* thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void (*thd_progress_next_stage_func)(void* thd);
|
||||
void (*thd_progress_end_func)(void* thd);
|
||||
const char *(*set_thd_proc_info_func)(void*, const char *info,
|
||||
const char *func,
|
||||
const char *file,
|
||||
unsigned int line);
|
||||
} *progress_report_service;
|
||||
void thd_progress_init(void* thd, unsigned int max_stage);
|
||||
void thd_progress_report(void* thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void thd_progress_next_stage(void* thd);
|
||||
void thd_progress_end(void* thd);
|
||||
const char *set_thd_proc_info(void*, const char * info, const char *func,
|
||||
const char *file, unsigned int line);
|
||||
struct st_mysql_xid {
|
||||
long formatID;
|
||||
long gtrid_length;
|
||||
|
@ -153,8 +174,6 @@ int thd_tx_isolation(const void* thd);
|
|||
char *thd_security_context(void* thd, char *buffer, unsigned int length,
|
||||
unsigned int max_query_len);
|
||||
void thd_inc_row_count(void* thd);
|
||||
const char *set_thd_proc_info(void*, const char * info, const char *func,
|
||||
const char *file, const unsigned int line);
|
||||
int mysql_tmpfile(const char *prefix);
|
||||
int thd_killed(const void* thd);
|
||||
unsigned long thd_get_thread_id(const void* thd);
|
||||
|
|
82
include/mysql/service_progress_report.h
Normal file
82
include/mysql/service_progress_report.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
#ifndef MYSQL_SERVICE_PROGRESS_REPORT_INCLUDED
|
||||
/* Copyright (C) 2011 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
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/**
|
||||
@file
|
||||
This service allows plugins to report progress of long running operations
|
||||
to the server. The progress report is visible in SHOW PROCESSLIST,
|
||||
INFORMATION_SCHEMA.PROCESSLIST, and is sent to the client
|
||||
if requested.
|
||||
|
||||
The functions are documented at
|
||||
http://kb.askmonty.org/en/progress-reporting#how-to-add-support-for-progress-reporting-to-a-storage-engine
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define thd_proc_info(thd, msg) set_thd_proc_info(thd, msg, \
|
||||
__func__, __FILE__, __LINE__)
|
||||
|
||||
extern struct progress_report_service_st {
|
||||
void (*thd_progress_init_func)(MYSQL_THD thd, unsigned int max_stage);
|
||||
void (*thd_progress_report_func)(MYSQL_THD thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void (*thd_progress_next_stage_func)(MYSQL_THD thd);
|
||||
void (*thd_progress_end_func)(MYSQL_THD thd);
|
||||
const char *(*set_thd_proc_info_func)(MYSQL_THD, const char *info,
|
||||
const char *func,
|
||||
const char *file,
|
||||
unsigned int line);
|
||||
} *progress_report_service;
|
||||
|
||||
#ifdef MYSQL_DYNAMIC_PLUGIN
|
||||
|
||||
#define thd_progress_init(thd,max_stage) (progress_report_service->thd_progress_init_func((thd),(max_stage)))
|
||||
#define thd_progress_report(thd, progress, max_progress) (progress_report_service->thd_progress_report_func((thd), (progress), (max_progress)))
|
||||
#define thd_progress_next_stage(thd) (progress_report_service->thd_progress_next_stage_func(thd))
|
||||
#define thd_progress_end(thd) (progress_report_service->thd_progress_end_func(thd))
|
||||
#define set_thd_proc_info(thd,info,func,file,line) (progress_report_service->set_thd_proc_info_func((thd),(info),(func),(file),(line)))
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
Report progress for long running operations
|
||||
|
||||
@param thd User thread connection handle
|
||||
@param progress Where we are now
|
||||
@param max_progress Progress will continue up to this
|
||||
*/
|
||||
void thd_progress_init(MYSQL_THD thd, unsigned int max_stage);
|
||||
void thd_progress_report(MYSQL_THD thd,
|
||||
unsigned long long progress,
|
||||
unsigned long long max_progress);
|
||||
void thd_progress_next_stage(MYSQL_THD thd);
|
||||
void thd_progress_end(MYSQL_THD thd);
|
||||
const char *set_thd_proc_info(MYSQL_THD, const char * info, const char *func,
|
||||
const char *file, unsigned int line);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MYSQL_SERVICE_PROGRESS_REPORT_INCLUDED
|
||||
#endif
|
||||
|
|
@ -22,6 +22,7 @@ extern "C" {
|
|||
#include <mysql/service_thd_alloc.h>
|
||||
#include <mysql/service_thd_wait.h>
|
||||
#include <mysql/service_thread_scheduler.h>
|
||||
#include <mysql/service_progress_report.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -51,7 +51,6 @@ void thd_lock_thread_count(THD *thd);
|
|||
void thd_unlock_thread_count(THD *thd);
|
||||
void thd_close_connection(THD *thd);
|
||||
THD *thd_get_current_thd();
|
||||
void thd_new_connection_setup(THD *thd, char *stack_start);
|
||||
void thd_lock_data(THD *thd);
|
||||
void thd_unlock_data(THD *thd);
|
||||
bool thd_is_transaction_active(THD *thd);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -152,6 +152,7 @@ enum enum_server_command
|
|||
#define REFRESH_QUERY_CACHE_FREE 0x20000L /* pack query cache */
|
||||
#define REFRESH_DES_KEY_FILE 0x40000L
|
||||
#define REFRESH_USER_RESOURCES 0x80000L
|
||||
#define REFRESH_CHECKPOINT 0x100000L /* Don't do checkpoints */
|
||||
|
||||
#define REFRESH_TABLE_STATS (1L << 20) /* Refresh table stats hash table */
|
||||
#define REFRESH_INDEX_STATS (1L << 21) /* Refresh index stats hash table */
|
||||
|
@ -179,6 +180,7 @@ enum enum_server_command
|
|||
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
|
||||
|
||||
#define CLIENT_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */
|
||||
#define CLIENT_PROGRESS (1UL << 29) /* Client support progress indicator */
|
||||
|
||||
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
|
||||
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
|
||||
|
@ -211,6 +213,7 @@ enum enum_server_command
|
|||
CLIENT_PS_MULTI_RESULTS | \
|
||||
CLIENT_SSL_VERIFY_SERVER_CERT | \
|
||||
CLIENT_REMEMBER_OPTIONS | \
|
||||
CLIENT_PROGRESS | \
|
||||
CLIENT_PLUGIN_AUTH)
|
||||
|
||||
/*
|
||||
|
@ -481,7 +484,8 @@ struct my_rnd_struct;
|
|||
|
||||
enum Item_result
|
||||
{
|
||||
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT
|
||||
STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT,
|
||||
TIME_RESULT,IMPOSSIBLE_RESULT
|
||||
};
|
||||
|
||||
typedef struct st_udf_args
|
||||
|
|
|
@ -66,9 +66,10 @@ extern const char *globerrs[]; /* my_error_messages is here */
|
|||
#define EE_CHANGE_OWNERSHIP 31
|
||||
#define EE_CHANGE_PERMISSIONS 32
|
||||
#define EE_CANT_SEEK 33
|
||||
#define EE_CANT_CHMOD 34
|
||||
#define EE_CANT_CHMOD 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 */
|
||||
|
@ -87,9 +88,7 @@ extern const char *globerrs[]; /* my_error_messages is here */
|
|||
#define EXIT_OPTION_DISABLED 12
|
||||
#define EXIT_ARGUMENT_INVALID 13
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -23,3 +23,4 @@
|
|||
#define VERSION_thd_alloc 0x0100
|
||||
#define VERSION_thd_wait 0x0100
|
||||
#define VERSION_my_thread_scheduler 0x0100
|
||||
#define VERSION_progress_report 0x0100
|
||||
|
|
|
@ -28,6 +28,12 @@ extern const char *not_error_sqlstate;
|
|||
struct st_mysql_options_extention {
|
||||
char *plugin_dir;
|
||||
char *default_auth;
|
||||
void (*report_progress)(const MYSQL *mysql,
|
||||
unsigned int stage,
|
||||
unsigned int max_stage,
|
||||
double progress,
|
||||
const char *proc_info,
|
||||
uint proc_info_length);
|
||||
};
|
||||
|
||||
typedef struct st_mysql_methods
|
||||
|
|
|
@ -88,6 +88,7 @@ typedef struct st_alarm {
|
|||
|
||||
extern uint thr_client_alarm;
|
||||
extern pthread_t alarm_thread;
|
||||
extern my_bool my_disable_thr_alarm;
|
||||
|
||||
#define thr_alarm_init(A) (*(A))=0
|
||||
#define thr_alarm_in_use(A) (*(A)!= 0)
|
||||
|
|
|
@ -104,9 +104,10 @@ typedef struct st_thr_lock_data {
|
|||
struct st_thr_lock *lock;
|
||||
mysql_cond_t *cond;
|
||||
void *status_param; /* Param to status functions */
|
||||
void *debug_print_param;
|
||||
void *debug_print_param; /* For error messages */
|
||||
struct PSI_table *m_psi;
|
||||
enum thr_lock_type type;
|
||||
enum thr_lock_type org_type; /* Cache for MariaDB */
|
||||
uint priority;
|
||||
} THR_LOCK_DATA;
|
||||
|
||||
|
@ -131,6 +132,7 @@ typedef struct st_thr_lock {
|
|||
my_bool (*start_trans)(void*); /* When all locks are taken */
|
||||
my_bool (*check_status)(void *);
|
||||
void (*fix_status)(void *, void *);/* For thr_merge_locks() */
|
||||
const char *name; /* Used for error reporting */
|
||||
my_bool allow_multiple_concurrent_insert;
|
||||
} THR_LOCK;
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
the Free Software Foundation.
|
||||
|
||||
There are special exceptions to the terms and conditions of the GPL as it
|
||||
is applied to this software.
|
||||
is applied to this software. View the full text of the exception in file
|
||||
EXCEPTIONS-CLIENT in the directory of this software distribution.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
|
@ -213,11 +214,19 @@ void STDCALL mysql_server_end()
|
|||
{
|
||||
my_end(0);
|
||||
}
|
||||
#ifdef NOT_NEEDED
|
||||
/*
|
||||
The following is not needed as if the program explicitely called
|
||||
my_init() then we can assume it will also call my_end().
|
||||
The reason to not also do it here is in that case we can't get
|
||||
statistics from my_end() to debug log.
|
||||
*/
|
||||
else
|
||||
{
|
||||
free_charsets();
|
||||
mysql_thread_end();
|
||||
}
|
||||
#endif
|
||||
|
||||
mysql_client_init= org_my_init_done= 0;
|
||||
}
|
||||
|
@ -3183,7 +3192,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
|
|||
case MYSQL_TYPE_TIME:
|
||||
{
|
||||
MYSQL_TIME *tm= (MYSQL_TIME *)buffer;
|
||||
str_to_time(value, length, tm, &err);
|
||||
str_to_time(value, length, tm, TIME_FUZZY_DATE, &err);
|
||||
*param->error= test(err);
|
||||
break;
|
||||
}
|
||||
|
@ -3315,7 +3324,8 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
|
|||
case MYSQL_TYPE_DATETIME:
|
||||
{
|
||||
int error;
|
||||
value= number_to_datetime(value, (MYSQL_TIME *) buffer, TIME_FUZZY_DATE,
|
||||
value= number_to_datetime(value, 0,
|
||||
(MYSQL_TIME *) buffer, TIME_FUZZY_DATE,
|
||||
&error);
|
||||
*param->error= test(error);
|
||||
break;
|
||||
|
@ -3521,7 +3531,7 @@ static void fetch_datetime_with_conversion(MYSQL_BIND *param,
|
|||
fetch_string_with_conversion:
|
||||
*/
|
||||
char buff[MAX_DATE_STRING_REP_LENGTH];
|
||||
uint length= my_TIME_to_str(my_time, buff);
|
||||
uint length= my_TIME_to_str(my_time, buff, field->decimals);
|
||||
/* Resort to string conversion */
|
||||
fetch_string_with_conversion(param, (char *)buff, length);
|
||||
break;
|
||||
|
@ -3998,7 +4008,7 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
|
|||
field->max_length= MAX_DOUBLE_STRING_REP_LENGTH;
|
||||
break;
|
||||
case MYSQL_TYPE_TIME:
|
||||
field->max_length= 15; /* 19:23:48.123456 */
|
||||
field->max_length= 17; /* -819:23:48.123456 */
|
||||
param->skip_result= skip_result_with_length;
|
||||
break;
|
||||
case MYSQL_TYPE_DATE:
|
||||
|
|
|
@ -91,7 +91,8 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
|||
../sql/multi_range_read.cc
|
||||
../sql/opt_index_cond_pushdown.cc
|
||||
../sql/opt_subselect.cc
|
||||
../sql/create_options.cc
|
||||
../sql/create_options.cc ../sql/rpl_utility.cc
|
||||
../sql/rpl_reporting.cc
|
||||
../sql/sql_expression_cache.cc
|
||||
${GEN_SOURCES}
|
||||
${MYSYS_LIBWRAP_SOURCE}
|
||||
|
|
|
@ -36,7 +36,6 @@ ENDIF(UNIX)
|
|||
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
|
||||
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
|
||||
|
||||
|
||||
IF(CMAKE_GENERATOR MATCHES "Xcode")
|
||||
# It does not seem possible to tell Xcode the resulting target might need
|
||||
# to be linked with C++ runtime. The project needs to have at least one C++
|
||||
|
|
|
@ -46,6 +46,7 @@ extern "C" void unireg_clear(int exit_code)
|
|||
{
|
||||
DBUG_ENTER("unireg_clear");
|
||||
clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */
|
||||
clean_up_mutexes();
|
||||
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@ -620,6 +621,7 @@ void end_embedded_server()
|
|||
my_free(copy_arguments_ptr);
|
||||
copy_arguments_ptr=0;
|
||||
clean_up(0);
|
||||
clean_up_mutexes();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
LIBRARY LIBMYSQLD
|
||||
DESCRIPTION 'MySQL 5.1 Embedded Server Library'
|
||||
VERSION 5.1
|
||||
EXPORTS
|
||||
mysql_thread_end
|
||||
|
|
|
@ -19,7 +19,8 @@ SET(MYSQLSERVICES_SOURCES
|
|||
my_snprintf_service.c
|
||||
thd_alloc_service.c
|
||||
thd_wait_service.c
|
||||
my_thread_scheduler_service.c)
|
||||
my_thread_scheduler_service.c
|
||||
progress_report_service.c)
|
||||
|
||||
ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
|
||||
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2010 Monty Program Ab
|
||||
/* Copyright (C) 2009 Sun Microsystems, Inc.
|
||||
|
||||
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
|
||||
|
@ -13,15 +13,5 @@
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
extern struct st_maria_plugin compat_aliases;
|
||||
extern char mysql_real_data_home[FN_REFLEN];
|
||||
extern TYPELIB maria_recover_typelib;
|
||||
extern TYPELIB maria_stats_method_typelib;
|
||||
extern TYPELIB maria_translog_purge_type_typelib;
|
||||
extern TYPELIB maria_sync_log_dir_typelib;
|
||||
extern TYPELIB maria_group_commit_typelib;
|
||||
extern struct st_mysql_storage_engine maria_storage_engine;
|
||||
extern my_bool use_maria_for_temp_tables;
|
||||
extern struct st_mysql_sys_var* system_variables[];
|
||||
extern st_mysql_show_var status_variables[];
|
||||
void copy_variable_aliases();
|
||||
#include <service_versions.h>
|
||||
SERVICE_VERSION *progress_report_service= (void*)VERSION_progress_report;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue