diff options
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/errmsg.c | 15 | ||||
-rw-r--r-- | libmysql/libmysql.c | 16 | ||||
-rw-r--r-- | libmysql/password.c | 2 |
3 files changed, 20 insertions, 13 deletions
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 0945aed6772..84c360ee5dc 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -50,6 +50,7 @@ const char *client_errors[]= "Error on SHOW SLAVE HOSTS:", "Error connecting to slave:", "Error connecting to master:", + "SSL connection error", "Invalid connection handle", "Invalid use of null pointer", "Statement not prepared", @@ -68,8 +69,8 @@ const char *client_errors[]= "Can't open shared memory. Map of memory don't create for client (%lu)", "Can't open shared memory. %s event don't create for client (%lu)", "Can't open shared memory. Server abandoded and don't sent the answer event (%lu)", - "Can't open shared memory. Can't send the request event to server (%lu)" - "Wrong or unknow protocol" + "Can't open shared memory. Can't send the request event to server (%lu)", + "Wrong or unknown protocol" }; /* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ @@ -103,6 +104,7 @@ const char *client_errors[]= "Error on SHOW SLAVE HOSTS:", "Error connecting to slave:", "Error connecting to master:", + "SSL connection error", "Invalid connection handle", "Invalid use of null pointer", "Statement not prepared", @@ -121,8 +123,8 @@ const char *client_errors[]= "Can't open shared memory. Map of memory don't create for client (%lu)", "Can't open shared memory. %s event don't create for client (%lu)", "Can't open shared memory. Server abandoded and don't sent the answer event (%lu)", - "Can't open shared memory. Can't send the request event to server (%lu)" - "Wrong or unknow protocol" + "Can't open shared memory. Can't send the request event to server (%lu)", + "Wrong or unknown protocol" }; #else /* ENGLISH */ @@ -154,6 +156,7 @@ const char *client_errors[]= "Error on SHOW SLAVE HOSTS:", "Error connecting to slave:", "Error connecting to master:", + "SSL connection error", "Invalid connection handle", "Invalid use of null pointer", "Statement not prepared", @@ -172,8 +175,8 @@ const char *client_errors[]= "Can't open shared memory. Map of memory don't create for client (%lu)", "Can't open shared memory. %s event don't create for client (%lu)", "Can't open shared memory. Server abandoded and don't sent the answer event (%lu)", - "Can't open shared memory. Can't send the request event to server (%lu)" - "Wrong or unknow protocol" + "Can't open shared memory. Can't send the request event to server (%lu)", + "Wrong or unknown protocol" }; #endif diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 535a79e0557..7b7d14f0a50 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -242,7 +242,7 @@ my_bool my_connect(my_socket s, const struct sockaddr *name, { tv.tv_sec = (long) timeout; tv.tv_usec = 0; -#if defined(HPUX) && defined(THREAD) +#if defined(HPUX10) && defined(THREAD) if ((res = select(s+1, NULL, (int*) &sfds, NULL, &tv)) >= 0) break; #else @@ -1807,6 +1807,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, #endif init_sigpipe_variables DBUG_ENTER("mysql_real_connect"); + LINT_INIT(host_info); DBUG_PRINT("enter",("host: %s db: %s user: %s", host ? host : "(Null)", @@ -2188,15 +2189,18 @@ Try also with PIPE or TCP/IP options->ssl_capath, options->ssl_cipher))) { - /* TODO: Change to SSL error */ - net->last_errno= CR_SERVER_LOST; + net->last_errno= CR_SSL_CONNECTION_ERROR; strmov(net->last_error,ER(net->last_errno)); goto error; } DBUG_PRINT("info", ("IO layer change in progress...")); - /* TODO: Add proper error checking here, with return error message */ - sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd), - mysql->net.vio, (long) (mysql->options.connect_timeout)); + if(sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd), + mysql->net.vio, (long) (mysql->options.connect_timeout))) + { + net->last_errno= CR_SSL_CONNECTION_ERROR; + strmov(net->last_error,ER(net->last_errno)); + goto error; + } DBUG_PRINT("info", ("IO layer change done!")); } #endif /* HAVE_OPENSSL */ diff --git a/libmysql/password.c b/libmysql/password.c index 9b154603b98..1c2c5589215 100644 --- a/libmysql/password.c +++ b/libmysql/password.c @@ -91,7 +91,7 @@ void make_scrambled_password(char *to,const char *password) sprintf(to,"%08lx%08lx",hash_res[0],hash_res[1]); } -static inline uint char_val(char X) +static inline unsigned int char_val(char X) { return (uint) (X >= '0' && X <= '9' ? X-'0' : X >= 'A' && X <= 'Z' ? X-'A'+10 : |