Bug #41860 Without Windows named pipe
Submitted: 5 Jan 2009 11:09 Modified: 7 Mar 2010 12:55
Reporter: Miguel Solorzano Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:6.0 OS:Windows
Assigned to: Davi Arnaut CPU Architecture:Any

[5 Jan 2009 11:09] Miguel Solorzano
Description:
Starting the server with --enable-named-pipe it starts without errors or warning but when try to connect with the 6.0 mysql client an error is showed. The mysql 5.1 connects with 6.0 server but the named pipe support is empty:

C:\dbs>5.1\bin\mysql -uroot -W
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.10-alpha-nt-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like "%pipe%";
Empty set (0.05 sec)

The 5.1 version works:

C:\dbs>5.1\bin\mysql -uroot -W
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.31-nt-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like "%pipe%";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| named_pipe    | ON    |
+---------------+-------+
1 row in set (0.05 sec)

How to repeat:
C:\dbs>6.0\bin\mysqld --standalone --console --enable-named-pipe
090105  7:40:45  InnoDB: Started; log sequence number 0 508056
090105  7:40:45 [Note] Event Scheduler: Loaded 0 events
090105  7:40:45 [Note] 6.0\bin\mysqld: ready for connections.
Version: '6.0.10-alpha-nt-log'  socket: ''  port: 3600  Source distribution

C:\dbs>6.0\bin\mysql -uroot -W
ERROR 2013 (HY000): Lost connection to MySQL server at 'waiting for initial communication packet', system error: 2

Suggested fix:
-
[7 Jan 2009 0:23] Omer Barnir
Problem is observed with 6.0.9 as well and does not requite the -W to be specified.
[16 Jan 2009 21:10] Vladislav Vaintroub
The reason seems to be the change for Bug#10374, that implements vio_poll_read() on Windows via select(). 

sql-common/client.c however calls vio_poll_read without checking if the VIO is a socket - also for pipes and shared memory. it worked as long as vio_poll_read was dummy and always retuned 0 , but broke now with  socket specific implementation.
[6 May 2009 12:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/73493

3253 Sergey Vojtovich	2009-05-06
      BUG#41860 - Without Windows named pipe
      
      Disable affected test case.
     @ mysql-test/r/shm.result
        Disable affected by BUG#41860 test case.
     @ mysql-test/t/shm.test
        Disable affected by BUG#41860 test case.
[6 May 2009 14:12] Bugs System
Pushed into 6.0.12-alpha (revid:svoj@sun.com-20090506125450-yokcmvqf2g7jhujq) (version source revid:svoj@sun.com-20090506125450-yokcmvqf2g7jhujq) (merge vers: 6.0.12-alpha) (pib:6)
[15 May 2009 12:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74197

3275 Davi Arnaut	2009-05-15
      Bug#41860: Without Windows named pipe
      
      The problem was that the patch for Bug#10374 broke named pipe
      and shared memory transports on Windows due to a failure to
      implement a dummy poll method for transports other than BSD
      sockets. Another problem was that mysqltest lacked support
      for named pipe and shared memory connections, which lead to
      misleading test cases that were supposed run common queries 
      over both transports.
      
      The solution is to properly implement, at the VIO layer, the
      poll and is_connected methods. The is_connected method is
      implemented for every suppported transport and the poll one
      only where it makes sense. Furthermore, support for named pipe
      and shared memory connections is added to mysqltest as to
      enable testing of both transports using the test suite.
     @ client/mysqltest.cc
        Add support for named pipe and shared memory connections.
     @ include/violite.h
        Move private functions to vio/vio_priv.h
        Add poll_read and is_connected methods.
     @ mysql-test/t/named_pipe.test
        Run tests over a named pipe connection.
     @ mysql-test/t/shm.test
        Run tests over a shared memory connection.
     @ sql/item_func.cc
        vio_ok is done inside is_connected now.
     @ sql/set_var.cc
        named_pipe functionality is compiled-in under _WIN32,
        so the variable should be tied in. Any mention of
        __NT__ is probably a bug as pre-NT systems are not
        supported.
     @ sql/sql_class.cc
        Remove higher-level vio_is_connected implementation.
     @ sql/sql_class.h
        Rename vio_is_connected to not conflict with the vio one.
     @ vio/vio.c
        Add poll_read and is_connected methods.
     @ vio/vio_priv.h
        Add private functions.
     @ vio/viosocket.c
        Implement the is_connected method for the various transports.
[21 May 2009 19:48] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74749

3313 Davi Arnaut	2009-05-21
      Bug#41860: Without Windows named pipe
      
      The problem was that the patch for Bug#10374 broke named pipe
      and shared memory transports on Windows due to a failure to
      implement a dummy poll method for transports other than BSD
      sockets. Another problem was that mysqltest lacked support
      for named pipe and shared memory connections, which lead to
      misleading test cases that were supposed run common queries
      over both transports.
      
      The solution is to properly implement, at the VIO layer, the
      poll and is_connected methods. The is_connected method is
      implemented for every suppported transport and the poll one
      only where it makes sense. Furthermore, support for named pipe
      and shared memory connections is added to mysqltest as to
      enable testing of both transports using the test suite.
     @ client/mysqltest.cc
        Add support for named pipe and shared memory connections.
     @ include/violite.h
        Move private functions to vio/vio_priv.h
        Add poll_read and is_connected methods.
     @ mysql-test/t/named_pipe.test
        Run tests over a named pipe connection.
     @ mysql-test/t/shm.test
        Run tests over a shared memory connection.
     @ sql/item_func.cc
        vio_ok is done inside is_connected now.
     @ sql/set_var.cc
        named_pipe functionality is compiled-in under _WIN32,
        so the variable should be tied in. Any mention of
        __NT__ is probably a bug as pre-NT systems are not
        supported.
     @ sql/sql_class.cc
        Remove higher-level vio_is_connected implementation.
     @ sql/sql_class.h
        Rename vio_is_connected to not conflict with the vio one.
     @ vio/vio.c
        Add poll_read and is_connected methods.
     @ vio/vio_priv.h
        Add private functions.
     @ vio/viosocket.c
        Implement the is_connected method for the various transports.
[22 May 2009 17:11] Davi Arnaut
Queued into 6.0-bugteam
[22 May 2009 17:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74798

3317 Davi Arnaut	2009-05-22
      Bug#41860: Without Windows named pipe
      
      The problem was that the patch for Bug#10374 broke named pipe
      and shared memory transports on Windows due to a failure to
      implement a dummy poll method for transports other than BSD
      sockets. Another problem was that mysqltest lacked support
      for named pipe and shared memory connections, which lead to
      misleading test cases that were supposed run common queries
      over both transports.
      
      The solution is to properly implement, at the VIO layer, the
      poll and is_connected methods. The is_connected method is
      implemented for every suppported transport and the poll one
      only where it makes sense. Furthermore, support for named pipe
      and shared memory connections is added to mysqltest as to
      enable testing of both transports using the test suite.
     @ client/mysqltest.cc
        Add support for named pipe and shared memory connections.
     @ include/violite.h
        Move private functions to vio/vio_priv.h
        Add poll_read and is_connected methods.
     @ mysql-test/t/named_pipe.test
        Run tests over a named pipe connection.
     @ mysql-test/t/shm.test
        Run tests over a shared memory connection.
     @ sql/item_func.cc
        vio_ok is done inside is_connected now.
     @ sql/set_var.cc
        named_pipe functionality is compiled-in under _WIN32,
        so the variable should be tied in. Any mention of
        __NT__ is probably a bug as pre-NT systems are not
        supported.
     @ sql/sql_class.cc
        Remove higher-level vio_is_connected implementation.
     @ sql/sql_class.h
        Rename vio_is_connected to not conflict with the vio one.
     @ vio/vio.c
        Add poll_read and is_connected methods.
     @ vio/vio_priv.h
        Add private functions.
     @ vio/viosocket.c
        Implement the is_connected method for the various transports.
[23 May 2009 17:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74840

3320 Davi Arnaut	2009-05-23
      Bug#41860: Post-merge fixes.
     @ mysql-test/r/shm.result
        Update test case result.
     @ vio/viosocket.c
        Correct type.
[17 Jun 2009 19:27] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:davi.arnaut@sun.com-20090523172937-iig9d6jibvm7myjo) (merge vers: 6.0.12-alpha) (pib:11)
[8 Aug 2009 0:11] Paul DuBois
Noted in 5.4.4, 6.0.12 changelogs.

The patch for Bug#10374 broke named-pipe and shared-memory
connections on Windows.
[12 Aug 2009 22:47] Paul DuBois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[15 Aug 2009 2:02] Paul DuBois
Ignore previous comment about 5.4.2.
[10 Nov 2009 19:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/90000

2921 Davi Arnaut	2009-11-10
      Backport of Bug#41860 to mysql-next-mr
      ------------------------------------------------------------
      revno: 3317
      revision-id: davi.arnaut@sun.com-20090522170916-fzc5ca3tjs9roy1t
      parent: patrick.crews@sun.com-20090522152933-ole8s3suy4zqyvku
      committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      branch nick: 41860-6.0
      timestamp: Fri 2009-05-22 14:09:16 -0300
      message:
        Bug#41860: Without Windows named pipe
      
        The problem was that the patch for Bug#10374 broke named pipe
        and shared memory transports on Windows due to a failure to
        implement a dummy poll method for transports other than BSD
        sockets. Another problem was that mysqltest lacked support
        for named pipe and shared memory connections, which lead to
        misleading test cases that were supposed run common queries
        over both transports.
      
        The solution is to properly implement, at the VIO layer, the
        poll and is_connected methods. The is_connected method is
        implemented for every suppported transport and the poll one
        only where it makes sense. Furthermore, support for named pipe
        and shared memory connections is added to mysqltest as to
        enable testing of both transports using the test suite.
     @ client/mysqltest.cc
        Add support for named pipe and shared memory connections.
     @ include/violite.h
        Move private functions to vio/vio_priv.h
        Add poll_read and is_connected methods.
     @ mysql-test/t/named_pipe.test
        Run tests over a named pipe connection.
     @ mysql-test/t/shm.test
        Run tests over a shared memory connection.
     @ sql/item_func.cc
        Rename method.
     @ sql/sql_class.cc
        Remove higher-level vio_is_connected implementation.
     @ sql/sql_class.h
        Rename vio_is_connected to not conflict with the vio one.
        Verify that there is a valid vio.
     @ vio/vio.c
        Add poll_read and is_connected methods.
     @ vio/vio_priv.h
        Add private functions.
     @ vio/viosocket.c
        Implement the is_connected method for the various transports.
[10 Nov 2009 19:38] Davi Arnaut
Queued to mysql-next-mr-runtime
[20 Nov 2009 12:54] Bugs System
Pushed into 5.6.0-beta (revid:davi.arnaut@sun.com-20091119234808-xbjpkwaxjt5x5c0b) (version source revid:davi.arnaut@sun.com-20090626124624-m4wolyo5193j4cu7) (merge vers: 5.4.4-alpha) (pib:13)
[20 Nov 2009 12:58] Bugs System
Pushed into 6.0.14-alpha (revid:kostja@sun.com-20091120124947-yi6h2jbgw0kbciwm) (version source revid:davi.arnaut@sun.com-20090626124624-m4wolyo5193j4cu7) (merge vers: 5.4.4-alpha) (pib:13)
[20 Nov 2009 23:37] Paul DuBois
Noted in 5.6.0 changelog.

Already fixed in 6.0.x.
[6 Mar 2010 10:59] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:davi.arnaut@sun.com-20090626124624-m4wolyo5193j4cu7) (merge vers: 5.4.4-alpha) (pib:16)
[7 Mar 2010 12:55] Paul DuBois
Moved 5.6.0 changelog entry to 5.5.3.