Commit f05a1c83 authored by monty@narttu.mysql.fi's avatar monty@narttu.mysql.fi

Block SIGPIPE also for not threaded client programs.

Added --include and --libs_r options to mysql_config.
Added mysql_get_client_version() to client library
Fixed some minor benchmark issues
parent 88faa2ab
......@@ -839,9 +839,10 @@ AC_MSG_CHECKING(for OpenSSL)
echo "You can't use the --all-static link option when using openssl."
exit 1
fi
NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
else
AC_MSG_RESULT(no)
fi
NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
AC_SUBST(openssl_libs)
AC_SUBST(openssl_includes)
])
......
......@@ -2256,7 +2256,7 @@ do
done
if test $charset_okay = 0;
then
AC_MSG_ERROR([Charset $cs not available. (Available $CHARSETS_AVAILABLE).
AC_MSG_ERROR([Charset '$cs' not available. (Available $CHARSETS_AVAILABLE).
See the Installation chapter in the Reference Manual.]);
fi
done
......
......@@ -60,7 +60,7 @@ int main(int argc,char *argv[])
return(1);
}
VOID(count_rows(from,'"','}')); /* Calculate start-info */
VOID(count_rows(from,'"','{')); /* Calculate start-info */
if (remember_rows(from,'}') < 0) /* Remember rows */
{
fprintf(stderr,"Can't find textrows in '%s'\n",*argv);
......
......@@ -352,6 +352,7 @@ int STDCALL mysql_ping(MYSQL *mysql);
const char * STDCALL mysql_stat(MYSQL *mysql);
const char * STDCALL mysql_get_server_info(MYSQL *mysql);
const char * STDCALL mysql_get_client_info(void);
ulong STDCALL mysql_get_client_version(void);
const char * STDCALL mysql_get_host_info(MYSQL *mysql);
unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql);
MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
......
......@@ -1452,10 +1452,6 @@ mysql_init(MYSQL *mysql)
after we return if this is not the case.
*/
mysql->rpl_pivot = 1;
#if defined(SIGPIPE) && defined(THREAD) && !defined(__WIN__)
if (!((mysql)->client_flag & CLIENT_IGNORE_SIGPIPE))
(void) signal(SIGPIPE,pipe_sig_handler);
#endif
/*
Only enable LOAD DATA INFILE by default if configured with
......@@ -1515,8 +1511,8 @@ void mysql_once_init(void)
mysql_unix_port = env;
}
mysql_debug(NullS);
#if defined(SIGPIPE) && !defined(THREAD) && !defined(__WIN__)
(void) signal(SIGPIPE,SIG_IGN);
#if defined(SIGPIPE) && !defined(__WIN__)
(void) signal(SIGPIPE, SIG_IGN);
#endif
}
#ifdef THREAD
......@@ -2911,6 +2907,11 @@ mysql_get_client_info(void)
return (char*) MYSQL_SERVER_VERSION;
}
ulong STDCALL mysql_get_client_version(void)
{
return MYSQL_VERSION_ID;
}
int STDCALL
mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg)
......
......@@ -24,6 +24,7 @@ EXPORTS
mysql_get_host_info
mysql_get_proto_info
mysql_get_server_info
mysql_get_client_version
mysql_info
mysql_init
mysql_insert_id
......
......@@ -113,6 +113,7 @@ SUFFIXES = .sh
-e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \
-e 's!@''LIBS''@!@LIBS@!' \
-e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \
-e 's!@''openssl_libs''@!@openssl_libs@!' \
-e 's!@''VERSION''@!@VERSION@!' \
-e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
-e 's!@''COMPILATION_COMMENT''@!@COMPILATION_COMMENT@!' \
......
......@@ -84,17 +84,29 @@ port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@'
client_libs='@CLIENT_LIBS@'
libs="$ldflags -L'$pkglibdir' -lmysqlclient $client_libs"
libs=`echo $libs | sed -e 's; +;;'`
cflags="-I'$pkgincludedir'"
embedded_libs="$ldflags -L'$pkglibdir' -lmysqld @LIBS@ @innodb_system_libs@"
# Create options, without end space
libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs"
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@"
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
cflags="-I$pkgincludedir @CFLAGS@"
include="-I$pkgincludedir"
embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @innodb_system_libs@"
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
# Remove some options that a client doesn't have to care about
cflags=`echo "$cflags " | sed -e 's;\(-DDBUG_OFF\|-DSAFEMALLOC\|-USAFEMALLOC\|-DSAFE_MUTEX\|-DPEDANTIC_SAFEMALLOC\|-DUNIV_MUST_NOT_INLINE\|-DFORCE_INIT_OF_VARS\|-DEXTRA_DEBUG\|-DHAVE_purify\|-O[0-9]\|-W[-A-Za-z]*\) *;;g' | sed -e 's; *\$;;'`
usage () {
cat <<EOF
Usage: $0 [OPTIONS]
Options:
--cflags [$cflags]
--include [$include]
--libs [$libs]
--libs_r [$libs_r]
--socket [$socket]
--port [$port]
--version [$version]
......@@ -108,7 +120,9 @@ if test $# -le 0; then usage; fi
while test $# -gt 0; do
case $1 in
--cflags) echo "$cflags" ;;
--include) echo "$include" ;;
--libs) echo "$libs" ;;
--libs_r) echo "$libs_r" ;;
--socket) echo "$socket" ;;
--port) echo "$port" ;;
--version) echo "$version" ;;
......
......@@ -97,7 +97,7 @@ mdata=$ldata/mysql
if test ! -x $execdir/mysqld
then
if test "$IN_RPM" -eq 1
if test "$IN_RPM" = "1"
then
echo "FATAL ERROR $execdir/mysqld not found!"
exit 1
......@@ -112,7 +112,7 @@ fi
hostname=`@HOSTNAME@`
# Check if hostname is valid
if test "$IN_RPM" -eq 0 -a $force -eq 0
if test "$IN_RPM" = "0" -a $force = "0"
then
resolved=`$bindir/resolveip $hostname 2>&1`
if [ $? -ne 0 ]
......@@ -333,7 +333,7 @@ $c_c
END_OF_DATA
then
echo ""
if test "$IN_RPM" -eq 0
if test "$IN_RPM" = "0"
then
echo "To start mysqld at boot time you have to copy support-files/mysql.server"
echo "to the right place for your system"
......@@ -354,7 +354,7 @@ then
echo "able to use the new GRANT command!"
fi
echo
if test "$IN_RPM" -eq 0
if test "$IN_RPM" = "0"
then
echo "You can start the MySQL daemon with:"
echo "cd @prefix@ ; $bindir/mysqld_safe &"
......
......@@ -31,7 +31,7 @@
# $server Object for current server
# $limits Hash reference to limits for benchmark
$benchmark_version="2.14";
$benchmark_version="2.15";
use Getopt::Long;
require "$pwd/server-cfg" || die "Can't read Configuration file: $!\n";
......
......@@ -2862,7 +2862,6 @@ sub new
$limits{'working_blobs'} = 1; # If big varchar/blobs works
$limits{'order_by_unused'} = 0;
$limits{'working_all_fields'} = 1;
$limits{'multi_distinct'} = 1; # allows select count(distinct a),count(distinct b)..
return $self;
}
......
......@@ -24,7 +24,7 @@ use DBI;
use Benchmark;
$opt_start_field_count=8; # start with this many fields
$opt_loop_count=20; # How many tests to do
$opt_loop_count=100; # How many tests to do
$opt_row_count=1000; # Rows in the table
$opt_field_count=1000; # Add until this many fields.
$opt_time_limit=10*60; # Don't wait more than 10 min for some tests
......
......@@ -356,7 +356,8 @@ if ($limits->{'group_distinct_functions'})
timestr(timediff($end_time, $loop_time),"all") . "\n";
# Workaround mimer's behavior
if (limits->{'multi_distinct'} == 1 ) {
if ($limits->{'multi_distinct'})
{
$loop_time=new Benchmark;
$rows=$estimated=$count=0;
for ($i=0 ; $i < $opt_medium_loop_count ; $i++)
......
......@@ -25,8 +25,8 @@ $opt_debug = 0;
$opt_host = undef();
$opt_port = undef();
$opt_socket = undef();
$opt_db = undef();
$opt_table = undef();
$opt_db = "mail";
$opt_table = "mails";
$opt_user = undef();
$opt_password = undef();
$opt_max_mail_size = 65536;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment