summaryrefslogtreecommitdiff
path: root/libmysqld/libmysqld.c
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-09-11 20:31:40 +0300
committerunknown <monty@mashka.mysql.fi>2003-09-11 20:31:40 +0300
commit41824a35338012ff8196eb975f961d5e0f0e2a22 (patch)
tree1475a169c541e6b7aedb36103dd255fe52fc0517 /libmysqld/libmysqld.c
parent07bc35e1d024e5e3b81b131a47878510f0521609 (diff)
parentd32bdcb1bfc274476cdd945e66e00f3ec31253c3 (diff)
downloadmariadb-git-41824a35338012ff8196eb975f961d5e0f0e2a22.tar.gz
merge with 4.1 tree
client/mysqltest.c: Auto merged include/mysql.h: Auto merged libmysql/errmsg.c: Auto merged libmysql/libmysql.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged sql/field.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged tests/client_test.c: Auto merged
Diffstat (limited to 'libmysqld/libmysqld.c')
-rw-r--r--libmysqld/libmysqld.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index f403400812f..56be78e3509 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -244,25 +244,18 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
db ? db : "(Null)",
user ? user : "(Null)"));
-#ifdef EMBEDDED_LIBRARY
- /*
- Here we check that mysql_server_init was called before.
- Actually we can perform the test for client (not embedded) library as well.
- But i'm afraid some old applications will be broken then.
- */
+#if defined(EMBEDDED_LIBRARY) || !defined(DBUG_OFF)
if (!server_inited)
{
mysql->net.last_errno=CR_MYSQL_SERVER_INIT_MISSED;
strmov(mysql->net.last_error,ER(mysql->net.last_errno));
goto error;
}
-#endif /*EMBEDDED_LIBRARY*/
+#endif
- 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))
+ if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION ||
+ (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);
@@ -325,7 +318,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
DBUG_RETURN(mysql);
error:
- DBUG_PRINT("error",("message: %u (%s)",mysql->net.last_errno,mysql->net.last_error));
+ DBUG_PRINT("error",("message: %u (%s)", mysql->net.last_errno,
+ mysql->net.last_error));
{
/* Free alloced memory */
my_bool free_me=mysql->free_me;
@@ -337,6 +331,7 @@ error:
DBUG_RETURN(0);
}
+
/*************************************************************************
** Send a QUIT to the server and close the connection
** If handle is alloced by mysql connect free it.