summaryrefslogtreecommitdiff
path: root/sql-common/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sql-common/client.c')
-rw-r--r--sql-common/client.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 332e60947e6..47a68651e05 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -569,16 +569,22 @@ err:
Error message is set.
@retval
*/
-
ulong
cli_safe_read(MYSQL *mysql)
{
+ ulong reallen = 0;
+ return cli_safe_read_reallen(mysql, &reallen);
+}
+
+ulong
+cli_safe_read_reallen(MYSQL *mysql, ulong* reallen)
+{
NET *net= &mysql->net;
ulong len=0;
restart:
if (net->vio != 0)
- len= my_net_read_packet(net, 0);
+ len= my_net_read_packet_reallen(net, 0, reallen);
if (len == packet_error || len == 0)
{
@@ -601,7 +607,7 @@ restart:
uint last_errno=uint2korr(pos);
if (last_errno == 65535 &&
- (mysql->server_capabilities & CLIENT_PROGRESS))
+ (mysql->server_capabilities & CLIENT_PROGRESS_OBSOLETE))
{
if (cli_report_progress(mysql, pos+2, (uint) (len-3)))
{
@@ -1005,11 +1011,6 @@ enum option_id {
static TYPELIB option_types={array_elements(default_options)-1,
"options",default_options, NULL};
-const char *sql_protocol_names_lib[] =
-{ "TCP", "SOCKET", "PIPE", "MEMORY", NullS };
-TYPELIB sql_protocol_typelib = {array_elements(sql_protocol_names_lib)-1,"",
- sql_protocol_names_lib, NULL};
-
static int add_init_command(struct st_mysql_options *options, const char *cmd)
{
char *tmp;
@@ -1642,10 +1643,10 @@ mysql_init(MYSQL *mysql)
How this change impacts existing apps:
- existing apps which relyed on the default will see a behaviour change;
they will have to set reconnect=1 after mysql_real_connect().
- - existing apps which explicitely asked for reconnection (the only way they
+ - existing apps which explicitly asked for reconnection (the only way they
could do it was by setting mysql.reconnect to 1 after mysql_real_connect())
will not see a behaviour change.
- - existing apps which explicitely asked for no reconnection
+ - existing apps which explicitly asked for no reconnection
(mysql.reconnect=0) will not see a behaviour change.
*/
mysql->reconnect= 0;
@@ -3119,7 +3120,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
DBUG_RETURN(0);
mysql->methods= &client_methods;
- net->vio = 0; /* If something goes wrong */
mysql->client_flag=0; /* For handshake */
/* use default options */
@@ -4771,3 +4771,11 @@ mysql_get_socket(const MYSQL *mysql)
return vio_fd(mysql->net.vio);
return INVALID_SOCKET;
}
+
+
+int STDCALL mysql_cancel(MYSQL *mysql)
+{
+ if (mysql->net.vio)
+ return vio_shutdown(mysql->net.vio, SHUT_RDWR);
+ return -1;
+}