List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:February 21 2000 11:24pm
Subject:patch: Problem with aborted connections in 3.23.11
View as plain text  
Hi!

Hans> Hello Monty!
Hans> I am not quite sure how to report this correctly.
Hans> 
Hans> The System is "SuSE Linux 6.3"
Hans> 
Hans> This is what I do:
Hans> 
Hans> lin3:/usr/local # mysqldump -u hara -phandycam -c versnet > /tmp/test1.dump
Hans> lin3:/usr/local # mysql -u hara -phandycam test1 < /tmp/test1.dump
Hans> 
Hans> If I use the tarball for "mysql-3.23.8-alpha-pc-linux-gnu-i686" everything
Hans> works fine!
Hans> 
Hans> If I use any "higher" tarball version (3.23.9, 3.23.11) I get the following
Hans> in mysql.err:
Hans> 
Hans> (already for the mysqldump!)
Hans> 
Hans> 000220 17:24:38  Aborted connection 1 to db: 'versnet' user: 'hara
Hans> ' (Got an error writing communication packets)
Hans> 
Hans> And in addition the query does not complete...
Hans> 
Hans> This happens for local and remote queries (I have another 3.23.11 running on
Hans> Solaris 2.5.1, which I had to compile by myself because there is no current
Hans> tar-ball for solaris 2.5.1, there it works fine).
Hans> 
Hans> If I compile mysql 3.23.11 (on linux) myself - it seems - that everything
Hans> works right (./configure --prefix=/usr/local/mysql --disable-shared).
Hans> 
Hans> Maybe you want to check the tarball distributions?
Hans> 
Hans> Is there more I can do?

I have now managed to find the problem.  I can't however understand why I
didn't get this problem on my test system.

Here is a patch that fixes this; I will try to do a release of 3.23.12
tomorrow to get this fixed as soon as possible!

*** /my/monty/master/mysql-3.23.11-alpha/libmysql/net.c	Wed Feb 16 12:45:37 2000
--- ./net.c	Tue Feb 22 01:14:51 2000
***************
*** 158,170 ****
  {
  #ifndef EXTRA_DEBUG
    int count;
!   vio_blocking(net->vio, FALSE);
    if (!vio_is_blocking(net->vio))		/* Safety if SSL */
    {
      while ( (count = vio_read(net->vio, (char*) (net->buff),
  			      net->max_packet)) > 0)
        DBUG_PRINT("info",("skipped %d bytes from file: %s",
  			 count,vio_description(net->vio)));
    }
  #endif /* EXTRA_DEBUG */
    net->pkt_nr=0;				/* Ready for new command */
--- 158,174 ----
  {
  #ifndef EXTRA_DEBUG
    int count;
!   bool is_blocking=vio_is_blocking(net->vio);
!   if (is_blocking)
!     vio_blocking(net->vio, FALSE);
    if (!vio_is_blocking(net->vio))		/* Safety if SSL */
    {
      while ( (count = vio_read(net->vio, (char*) (net->buff),
  			      net->max_packet)) > 0)
        DBUG_PRINT("info",("skipped %d bytes from file: %s",
  			 count,vio_description(net->vio)));
+     if (is_blocking)
+       vio_blocking(net->vio, TRUE);
    }
  #endif /* EXTRA_DEBUG */
    net->pkt_nr=0;				/* Ready for new command */


Regards,
Monty

PS: Because of the nature of this bug I did a CC: to
    mysql@stripped;  I assume you don't mind about this.
Thread
patch: Problem with aborted connections in 3.23.11Michael Widenius22 Feb