summaryrefslogtreecommitdiff
path: root/libmysqld/libmysqld.c
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-06-18 15:58:57 +0500
committerunknown <hf@deer.(none)>2003-06-18 15:58:57 +0500
commit13e8bf67fc63280f76023fab73c373f33e363bfc (patch)
treef2de81966600f6bb3e831afc62a7ed1d9babbf42 /libmysqld/libmysqld.c
parent4c7431dc906cd5e5dba8515ec63107b590708898 (diff)
downloadmariadb-git-13e8bf67fc63280f76023fab73c373f33e363bfc.tar.gz
SCRUM
including client code into embedded server code to guess what library to use added net_field_length moved to pack.c include/mysql.h: typedefinitions moved for suitability mysql_option.methods_to_use added include/mysql_com.h: net_store_length declaration libmysql/libmysql.c: net_store_length moved to sql-common/pack.c libmysqld/libmysqld.c: added code to guess whether to use remote or embedded connection sql-common/client.c: options checking added sql-common/pack.c: net_store_length implementation moved here sql/protocol.cc: net_store_length moved to sql-common/pack.c
Diffstat (limited to 'libmysqld/libmysqld.c')
-rw-r--r--libmysqld/libmysqld.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index efc3ee353e8..5b738f7f95b 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -68,6 +68,10 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
*/
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group);
+MYSQL * STDCALL
+cli_mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
+ const char *passwd, const char *db,
+ uint port, const char *unix_socket,ulong client_flag);
#ifdef HAVE_GETPWUID
struct passwd *getpwuid(uid_t);
@@ -179,7 +183,7 @@ static MYSQL_METHODS embedded_methods=
MYSQL * STDCALL
mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
- const char *passwd __attribute__((unused)), const char *db,
+ const char *passwd, const char *db,
uint port, const char *unix_socket,ulong client_flag)
{
char *db_name;
@@ -189,6 +193,14 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
db ? db : "(Null)",
user ? user : "(Null)"));
+ if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION)
+ cli_mysql_real_connect(mysql, host, user,
+ passwd, db, port, unix_socket, client_flag);
+ if ((mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION) &&
+ host && strcmp(host,LOCAL_HOST))
+ cli_mysql_real_connect(mysql, host, user,
+ passwd, db, port, unix_socket, client_flag);
+
mysql->methods= &embedded_methods;
/* use default options */