1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge MWL#192: Non-blocking client library, into MariaDB 5.5.

This commit is contained in:
unknown
2012-02-21 22:15:44 +01:00
36 changed files with 5362 additions and 43 deletions

View File

@ -38,6 +38,18 @@
#include <sql_common.h>
#include <mysql/client_plugin.h>
/*
If non_blocking_api_enabled is true, we will re-define all the blocking
API functions as wrappers that call the corresponding non-blocking API
and use poll()/select() to wait for them to complete. This way we can get
a good coverage testing of the non-blocking API as well.
*/
static my_bool non_blocking_api_enabled= 0;
#if !defined(EMBEDDED_LIBRARY)
#define WRAP_NONBLOCK_ENABLED non_blocking_api_enabled
#include "nonblock-wrappers.h"
#endif
#define VER "2.1"
#define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */
#define MAX_KEY MAX_INDEXES
@ -251,6 +263,8 @@ static MYSQL *mysql_client_init(MYSQL* con)
if (res && shared_memory_base_name)
mysql_options(res, MYSQL_SHARED_MEMORY_BASE_NAME, shared_memory_base_name);
#endif
if (res && non_blocking_api_enabled)
mysql_options(res, MYSQL_OPT_NONBLOCK, 0);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(res, MYSQL_PLUGIN_DIR, opt_plugin_dir);
@ -19937,6 +19951,10 @@ static struct my_option client_test_long_options[] =
#endif
{"vardir", 'v', "Data dir for tests.", (char**) &opt_vardir,
(char**) &opt_vardir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"non-blocking-api", 'n',
"Use the non-blocking client API for communication.",
&non_blocking_api_enabled, &non_blocking_api_enabled, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"getopt-ll-test", 'g', "Option for testing bug in getopt library",
&opt_getopt_ll_test, &opt_getopt_ll_test, 0,
GET_LL, REQUIRED_ARG, 0, 0, LONGLONG_MAX, 0, 0, 0},