diff options
author | unknown <bell@sanja.is.com.ua> | 2002-10-04 14:15:59 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2002-10-04 14:15:59 +0300 |
commit | 05c5908a9e801d604a5651ccb9fde081378435f9 (patch) | |
tree | c7e9f63a5d35171d649cbd11f951d58a8f953720 /sql/net_serv.cc | |
parent | e607221a3cd778131cc9250108473819c9b8c8a0 (diff) | |
parent | f094b6af4c5c32bfda7f74461d47675ab61722a0 (diff) | |
download | mariadb-git-05c5908a9e801d604a5651ccb9fde081378435f9.tar.gz |
merging
include/mysql_com.h:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/distinct.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/key_primary.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/odbc.result:
Auto merged
mysql-test/r/order_by.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/r/user_var.result:
Auto merged
mysql-test/r/varbinary.result:
Auto merged
mysql-test/t/union.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.h:
Auto merged
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 51910167d97..d165125eb90 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -99,6 +99,7 @@ my_bool my_net_init(NET *net, Vio* vio) net->where_b = net->remain_in_buf=0; net->last_errno=0; net->query_cache_query=0; + net->report_error= 0; if (vio != 0) /* If real connection */ { @@ -134,8 +135,9 @@ my_bool net_realloc(NET *net, ulong length) if (length >= net->max_packet_size) { DBUG_PRINT("error",("Packet too large (%lu)", length)); - net->error=1; - net->last_errno=ER_NET_PACKET_TOO_LARGE; + net->error= 1; + net->report_error= 1; + net->last_errno= ER_NET_PACKET_TOO_LARGE; return 1; } pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1); @@ -147,9 +149,10 @@ my_bool net_realloc(NET *net, ulong length) NET_HEADER_SIZE + COMP_HEADER_SIZE, MYF(MY_WME)))) { - net->error=1; + net->error= 1; + net->report_error= 1; #ifdef MYSQL_SERVER - net->last_errno=ER_OUT_OF_RESOURCES; + net->last_errno= ER_OUT_OF_RESOURCES; #endif return 1; } @@ -369,10 +372,12 @@ net_real_write(NET *net,const char *packet,ulong len) COMP_HEADER_SIZE, MYF(MY_WME)))) { #ifdef MYSQL_SERVER - net->last_errno=ER_OUT_OF_RESOURCES; - net->error=2; + net->last_errno= ER_OUT_OF_RESOURCES; + net->error= 2; + //TODO is it needed to set this variable if we have no socket + net->report_error= 1; #endif - net->reading_or_writing=0; + net->reading_or_writing= 0; DBUG_RETURN(1); } memcpy(b+header_length,packet,len); @@ -422,9 +427,10 @@ net_real_write(NET *net,const char *packet,ulong len) my_progname,vio_errno(net->vio)); #endif /* EXTRA_DEBUG */ #ifdef MYSQL_SERVER - net->last_errno=ER_NET_ERROR_ON_WRITE; + net->last_errno= ER_NET_ERROR_ON_WRITE; #endif - net->error=2; /* Close socket */ + net->error= 2; /* Close socket */ + net->report_error= 1; goto end; } retry_count=0; @@ -450,7 +456,8 @@ net_real_write(NET *net,const char *packet,ulong len) continue; } #endif /* defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) */ - net->error=2; /* Close socket */ + net->error= 2; /* Close socket */ + net->report_error= 1; #ifdef MYSQL_SERVER net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : ER_NET_ERROR_ON_WRITE); @@ -586,9 +593,10 @@ my_real_read(NET *net, ulong *complen) my_progname,vio_errno(net->vio)); #endif /* EXTRA_DEBUG */ len= packet_error; - net->error=2; /* Close socket */ + net->error= 2; /* Close socket */ + net->report_error= 1; #ifdef MYSQL_SERVER - net->last_errno=ER_NET_FCNTL_ERROR; + net->last_errno= ER_NET_FCNTL_ERROR; #endif goto end; } @@ -618,7 +626,8 @@ my_real_read(NET *net, ulong *complen) remain,vio_errno(net->vio), length, thr_got_alarm(&alarmed))); len= packet_error; - net->error=2; /* Close socket */ + net->error= 2; /* Close socket */ + net->report_error= 1; #ifdef MYSQL_SERVER net->last_errno= (interrupted ? ER_NET_READ_INTERRUPTED : ER_NET_READ_ERROR); @@ -648,6 +657,7 @@ my_real_read(NET *net, ulong *complen) #endif } len= packet_error; + net->report_error= 1; #ifdef MYSQL_SERVER net->last_errno=ER_NET_PACKETS_OUT_OF_ORDER; #endif @@ -821,7 +831,8 @@ my_net_read(NET *net) if (my_uncompress((byte*) net->buff + net->where_b, &packet_len, &complen)) { - net->error=2; /* caller will close socket */ + net->error= 2; /* caller will close socket */ + net->report_error= 1; #ifdef MYSQL_SERVER net->last_errno=ER_NET_UNCOMPRESS_ERROR; #endif |