Skip to content

Commit

Permalink
merge 5.1->5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 1, 2010
2 parents f83113d + e9bce6c commit e5099a2
Show file tree
Hide file tree
Showing 545 changed files with 14,880 additions and 6,217 deletions.
15 changes: 9 additions & 6 deletions .bzrignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
*.dsp
*.Po
*.Plo
*/*.dir/*
*.dir/
*/*_pure_*warnings
*/.deps
*/.libs/*
*/.pure
*/debug/*
*/minsizerel/*
*/release/*
*/relwithdebinfo/*
debug/
MinSizeRel/
Release/
RelWithDebInfo/
*~
.*.swp
./CMakeCache.txt
Expand Down Expand Up @@ -96,7 +96,7 @@ BitKeeper/tmp/gone
BitKeeper/tmp
BitKeeper/log
BitKeeper/etc/SCCS
CMakeFiles/*
CMakeFiles/
COPYING
COPYING.LIB
Docs/#manual.texi#
Expand Down Expand Up @@ -666,6 +666,9 @@ libmysqld/time.cc
libmysqld/tztime.cc
libmysqld/uniques.cc
libmysqld/unireg.cc
libmysqld/discover_xt.cc
libmysqld/ha_pbxt.cc
libmysqld/myxt_xt.cc
libmysqltest/*.ds?
libmysqltest/*.vcproj
libmysqltest/mytest.c
Expand Down
4 changes: 3 additions & 1 deletion BUILD/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EXTRA_DIST = FINISH.sh \
compile-amd64-max \
compile-amd64-max-sci \
compile-amd64-valgrind-max \
compile-bintar \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
Expand Down Expand Up @@ -80,7 +81,8 @@ EXTRA_DIST = FINISH.sh \
compile-solaris-x86-32 \
compile-solaris-x86-32-debug \
compile-solaris-x86-32-debug-forte \
compile-solaris-x86-forte-32
compile-solaris-x86-forte-32 \
util.sh

# Don't update the files from bitkeeper
%::SCCS/s.%
10 changes: 2 additions & 8 deletions BUILD/SETUP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,9 @@ set -e
#
path=`dirname $0`
. "$path/check-cpu"
. "$path/util.sh"

export AM_MAKEFLAGS
# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
# (So buildbots can easily disable this behaviour if required.)
if test -z "$AM_MAKEFLAGS"
then
AM_MAKEFLAGS="-j 6"
fi

get_make_parallel_flag

# SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out
Expand Down
81 changes: 81 additions & 0 deletions BUILD/compile-bintar
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
#
# MariaDB SQL server.
# Copyright (C) 2010 Kristian Nielsen and 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.


# This script's purpose is to build the binary tarball packages for MariaDB
# (currently only on Linux systems).
#
# Thus BUILD/compile-bintar from the appropriate source tarball will reproduce
# such a release, provided the build environment (gcc version etc.) matches
# (use scripts/make_binary_distribution after running this script to actually
# create the binary tarball package).
#
# Note that packages are built from source tarballs not bzr checkouts.
# Therefore, this script assumes autotools have already been run.
#
# We link libc dynamically, otherwise we get lots of problems loading
# .so files at runtime (either system stuff like NSS, or server
# plugins).
#
# We link libgcc statically (and avoid linking libstdc++ at all by
# CXX=gcc), to avoid reduce nasty library version dependencies.

test -f Makefile && make distclean

path=`dirname $0`
. $path/util.sh

SYSTEM_TYPE="$(uname -o)"
MACHINE_TYPE="$(uname -m)"

# We cannot have a slash '/' in tarfile name.
SYSTEM_TYPE="$(echo ${SYSTEM_TYPE} | sed -e 's/GNU\///')"

# Get correct options for architecture into CPUOPT.
get_cpuopt
# Get correct -j option into AM_MAKEFLAGS
get_make_parallel_flag

# Use gcc rather than g++ to avoid linking libstdc++.so (which we don't need).
COMP="gcc -static-libgcc"
FLAGS="-O2 -fno-omit-frame-pointer -g -pipe -Wall $CPUOPT"

# Don't press on in case of error.
set -e

CC="$COMP" CXX="$COMP" CFLAGS="$FLAGS" CXXFLAGS="$FLAGS" \
./configure \
--prefix=/usr/local/mysql \
--exec-prefix=/usr/local/mysql \
--libexecdir=/usr/local/mysql/bin \
--localstatedir=/usr/local/mysql/data \
\
--with-comment="(MariaDB - http://mariadb.com/)" \
--with-system-type="${SYSTEM_TYPE}" \
--with-machine-type="${MACHINE_TYPE}" \
\
--enable-shared --enable-static \
--with-client-ldflags=-static --with-mysqld-ldflags=-static \
--enable-thread-safe-client --enable-local-infile --with-big-tables \
--without-docs --with-extra-charsets=all \
--with-libwrap --with-ssl --with-readline --with-libevent --with-zlib-dir=bundled \
--with-partition --with-embedded-server \
--with-plugins=max-no-ndb \
--without-plugin-innodb_plugin

make $AM_MAKEFLAGS
Empty file modified BUILD/compile-solaris-amd64-debug-forte
100644 → 100755
Empty file.
Empty file modified BUILD/compile-solaris-x86-32
100644 → 100755
Empty file.
Empty file modified BUILD/compile-solaris-x86-32-debug
100644 → 100755
Empty file.
Empty file modified BUILD/compile-solaris-x86-32-debug-forte
100644 → 100755
Empty file.
Empty file modified BUILD/compile-solaris-x86-forte-32
100644 → 100755
Empty file.
48 changes: 48 additions & 0 deletions BUILD/util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# MariaDB SQL server.
# Copyright (C) 2010 Kristian Nielsen and 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.

# Setting cpu options.
get_cpuopt () {
case "$(uname -o)" in
*Linux*)
case "$(gcc -dumpmachine)" in
x86_64-*)
# gcc barfs on -march=... on x64
CPUOPT="-m64 -mtune=generic"
;;
*)
# we'd use i586 to not trip up mobile/lowpower devices
CPUOPT="-m32 -march=i586 -mtune=generic"
;;
esac
;;
*Solaris*)
# ToDo: handle 32-bit build? For now default to 64-bit.
CPUOPT="-D__sun -m64 -mtune=athlon64"
;;
esac
return 0
}

# Default to a parallel build, but only if AM_MAKEFLAGS is not set.
# (So buildbots can easily disable this behaviour if required.)
get_make_parallel_flag () {
if test -z "$AM_MAKEFLAGS"
then
AM_MAKEFLAGS="-j 6"
fi
return 0
}
4 changes: 0 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,6 @@ test-bt-fast:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress

test-bt-fast2:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=ps --ps-protocol --report-features

test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=debug --force --timer \
Expand Down
8 changes: 3 additions & 5 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4356,7 +4356,7 @@ com_status(String *buffer __attribute__((unused)),
Don't remove "limit 1",
it is protection againts SQL_SELECT_LIMIT=0
*/
if (mysql_store_result_for_lazy(&result))
if (!mysql_store_result_for_lazy(&result))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
Expand Down Expand Up @@ -4401,7 +4401,7 @@ com_status(String *buffer __attribute__((unused)),
if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
return 0;
}
if (mysql_store_result_for_lazy(&result))
if (!mysql_store_result_for_lazy(&result))
{
MYSQL_ROW cur=mysql_fetch_row(result);
if (cur)
Expand Down Expand Up @@ -4496,9 +4496,7 @@ server_version_string(MYSQL *con)
*/

if (server_version == NULL)
{
server_version= strdup(mysql_get_server_info(con));
}
server_version= my_strdup(mysql_get_server_info(con), MYF(MY_WME));
}

return server_version ? server_version : "";
Expand Down
4 changes: 4 additions & 0 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,10 @@ static int parse_args(int *argc, char*** argv)
*/
static Exit_status safe_connect()
{
/* Close and old connections to MySQL */
if (mysql)
mysql_close(mysql);

mysql= mysql_init(NULL);

if (!mysql)
Expand Down
37 changes: 22 additions & 15 deletions client/mysqlslap.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,25 @@ static int gettimeofday(struct timeval *tp, void *tzp)
}
#endif

void set_mysql_connect_options(MYSQL *mysql)
{
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#endif
if (opt_protocol)
mysql_options(mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
}


int main(int argc, char **argv)
{
MYSQL mysql;
Expand Down Expand Up @@ -323,20 +342,7 @@ int main(int argc, char **argv)
exit(1);
}
mysql_init(&mysql);
if (opt_compress)
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#endif
if (opt_protocol)
mysql_options(&mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
set_mysql_connect_options(&mysql);

if (!opt_only_print)
{
Expand Down Expand Up @@ -1815,6 +1821,7 @@ pthread_handler_t run_task(void *p)
my_progname, mysql_error(mysql));
exit(0);
}
set_mysql_connect_options(mysql);

if (mysql_thread_init())
{
Expand Down Expand Up @@ -1855,7 +1862,6 @@ pthread_handler_t run_task(void *p)
my_progname, mysql_error(mysql));
exit(0);
}

if (slap_connect(mysql))
goto end;
}
Expand Down Expand Up @@ -2223,6 +2229,7 @@ slap_connect(MYSQL *mysql)
int x, connect_error= 1;
for (x= 0; x < 10; x++)
{
set_mysql_connect_options(mysql);
if (mysql_real_connect(mysql, host, user, opt_password,
create_schema_string,
opt_mysql_port,
Expand Down
4 changes: 3 additions & 1 deletion client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,9 @@ class LogFile {
}

while ((bytes= fread(buf, 1, sizeof(buf), m_file)) > 0)
fwrite(buf, 1, bytes, stderr);
if (fwrite(buf, 1, bytes, stderr))
die("Failed to write to '%s', errno: %d",
m_file_name, errno);

if (!lines)
{
Expand Down
13 changes: 7 additions & 6 deletions config/ac-macros/plugins.m4
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ dnl we have to recompile these modules when we want to
dnl to compile server parts with the different #defines
dnl Normally it happens when we compile the embedded server
dnl Thus one should mark such files in his handler using this macro
dnl (currently only one such a file per plugin is supported)
dnl
dnl ---------------------------------------------------------------------------

Expand Down Expand Up @@ -463,11 +462,13 @@ dnl Although this is "pretty", it breaks libmysqld build
mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
[with_plugin_]$2=yes
AC_MSG_RESULT([yes])
m4_ifdef([$11],[
condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp($11, [[^/]+$], [\&])"
condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp($11, [[^/]+\.], [\&o])"
condition_dependent_plugin_links="$condition_dependent_plugin_links $6/$11"
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
m4_ifdef([$11], [
m4_foreach([plugin], [$11], [
condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp(plugin, [[^/]+$], [\&])"
condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp(plugin, [[^/]+\.], [\&o])"
condition_dependent_plugin_links="$condition_dependent_plugin_links $6/plugin"
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp(plugin, [^.+[/$]], [\&])"
])
])
fi
fi
Expand Down
Loading

0 comments on commit e5099a2

Please sign in to comment.