diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2013-06-15 14:22:03 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2013-06-15 14:22:03 +0200 |
commit | 4b058643cd6396b46898380ba7fee5d583e18cfd (patch) | |
tree | a3fc883411b6d6d56b3250d6ce43e0b9096bcefc /client | |
parent | b54a4b7621b4bdcc9846a968e4268ea71e88dab8 (diff) | |
download | mariadb-git-4b058643cd6396b46898380ba7fee5d583e18cfd.tar.gz |
MDEV-4601 : Allow MariaDB to be build without non-blocking client.
Non-blocking client currently can be build on Windows, GCC on i386 and x64, or any OS wth ucontext.h header. Prior to this patch, build failed if neither of these conditions is true.
Fix to avoid compiler errors in these case - non-blocking API would not be useful on , but otherwise everything will work as before.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 2dde607a016..e2846994c5a 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -63,8 +63,9 @@ #define SIGNAL_FMT "signal %d" #endif +#include <my_context.h> static my_bool non_blocking_api_enabled= 0; -#if !defined(EMBEDDED_LIBRARY) +#if !defined(EMBEDDED_LIBRARY) && !defined(MY_CONTEXT_DISABLE) #define WRAP_NONBLOCK_ENABLED non_blocking_api_enabled #include "../tests/nonblock-wrappers.h" #endif @@ -5932,8 +5933,10 @@ void do_connect(struct st_command *command) if (opt_connect_timeout) mysql_options(con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT, (void *) &opt_connect_timeout); - - mysql_options(con_slot->mysql, MYSQL_OPT_NONBLOCK, 0); +#ifndef MY_CONTEXT_DISABLE + if (mysql_options(con_slot->mysql, MYSQL_OPT_NONBLOCK, 0)) + die("Failed to initialise non-blocking API"); +#endif if (opt_compress || con_compress) mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS); mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0); |