Bug #45498 Socket variable not available on Windows
Submitted: 15 Jun 2009 11:25 Modified: 20 Dec 2009 0:48
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Windows Severity:S2 (Serious)
Version:5.0, 5.1+ OS:Windows
Assigned to: Davi Arnaut CPU Architecture:Any

[15 Jun 2009 11:25] Davi Arnaut
Description:
On Windows, although the command line option --socket=path can be used to specify the pipe name, the "socket" variable is not available at runtime -- making it impossible to retrieve name pipe path using SQL.

How to repeat:
SELECT @@socket;

Suggested fix:
=== modified file 'sql/set_var.cc'
--- sql/set_var.cc	2009-06-02 08:14:41 +0000
+++ sql/set_var.cc	2009-06-15 11:23:01 +0000
@@ -529,11 +529,9 @@ static sys_var_const    sys_skip_network
 static sys_var_const    sys_skip_show_database(&vars, "skip_show_database",
                                             OPT_GLOBAL, SHOW_BOOL,
                                             (uchar*) &opt_skip_show_db);
-#ifdef HAVE_SYS_UN_H
 static sys_var_const    sys_socket(&vars, "socket",
                                    OPT_GLOBAL, SHOW_CHAR_PTR,
                                    (uchar*) &mysqld_unix_port);
-#endif
 #ifdef HAVE_THR_SETCONCURRENCY
 /* purecov: begin tested */
 static sys_var_const    sys_thread_concurrency(&vars, "thread_concurrency",
[15 Jun 2009 21:23] Sveta Smirnova
Thank you for the report.

Verified as described.
[22 Sep 2009 11:22] 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/84102

3118 Davi Arnaut	2009-09-22
      Bug#45498: Socket variable not available on Windows
      
      The "socket" variable is not available on Windows even though
      the --socket option can be used to specify the pipe name for
      local connections that use a named pipe.
      
      The solution is to ensure that the variable is always defined.
     @ mysql-test/r/windows.result
        Add test case result for Bug#45498
     @ mysql-test/t/windows.test
        Add test case for Bug#45498
     @ sql/set_var.cc
        socket variable must always be present.
[23 Sep 2009 12:14] Davi Arnaut
Queued to 5.1-bugteam
[6 Oct 2009 9:00] Bugs System
Pushed into 5.1.40 (revid:joro@sun.com-20091006073316-lea2cpijh9r6on7c) (version source revid:satya.bn@sun.com-20090923121556-gq1t48ko2l541vjg) (merge vers: 5.1.40) (pib:11)
[8 Oct 2009 0:01] Paul DuBois
Noted in 5.1.40 changelog.

The socket system variable was unavailable on Windows.

Setting report to NDI pending push into 5.4.x.
[22 Oct 2009 6:36] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20091022063126-l0qzirh9xyhp0bpc) (version source revid:alik@sun.com-20091019135554-s1pvptt6i750lfhv) (merge vers: 6.0.14-alpha) (pib:13)
[22 Oct 2009 7:08] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091022060553-znkmxm0g0gm6ckvw) (version source revid:alik@sun.com-20091013094238-g67x6tgdm9a7uik0) (merge vers: 5.5.0-beta) (pib:13)
[22 Oct 2009 19:22] Paul DuBois
Noted in 5.5.0, 6.0.14 changelogs.
[18 Dec 2009 10:35] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:51] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 11:06] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:20] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)