Named pipe support in MySQL Connector/C++
I suppose you have already heard from Ulf what MySQL Connector/C++ is. Today Ulf was looking at the test cases and out of the blue asked whether we support named pipes. Well, it wasn't tested but one can pass OPT_NAMED_PIPE to the connect method of the driver (or the MySQL_Connection constructor).
The Connector already can use host values with the following syntax proto://host/schema . Which for TCP/IP looks so:
tcp://127.0.12.1/my_schema
In case of Unix Sockets one can use:
unix:///tmp/mysql.sock
Yes, it's right, there are three slashes one after another in the example above. The first too come from the syntax, the third one is part of the path to where the unix socket is. In other C words "unix://" "/tmp/mysql.sock", if you want to write it separately (C will concatenate it).
Because we want to support as many features as possible from the underlying library, which is libmysql or recently known as MySQL Connector/C, I decided to add explicit support of named pipes that fit into this scheme. The syntax is :
"pipe://" "path/to/the/pipe"
Lawrin tested it on Windows and it worked like a charm. You can start your server, mysqld-nt it should be named, with --enable-named-pipe . If you don't pass also --socket (yes, --socket) then the pipe's name will be MySQL(case insensitive, like FAT/NTFS is), how weird, right :) . Pass a value to --socket to create the pipe in other place and with another name.
P.S.
We also enabled today the internal trace functionality on Windows. Some ifdef magic for the Microsoft compilers that support variadic arguments to macros. VS 2005 (VC8) supports them as well as the later versions. If you try to build with VS2003 the trace functionality will be missing. Seems all other compilers on all other platforms we support don't have problems with variadic macro parameters, as in C99. Microsoft was lagging behind :).