Bug #46751 mysql client application cannot read from Windows named pipes
Submitted: 17 Aug 2009 2:18 Modified: 29 Dec 2009 22:24
Reporter: Alex Goncharov Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:5.1, 5.4, 6.0 OS:Windows (\\.\foo\bar is unwisely converted to \foo\bar )
Assigned to: CPU Architecture:Any

[17 Aug 2009 2:18] Alex Goncharov
A Windows named pipe is referred to by a path starting with `\\.'.

MySQL's C internals "simplify" this so that `\\.\foo\bar' turns
into `\foo\bar', which is passed to Windows OS API.

"The file `\foo\bar' is not found" error follows, while the named pipe
`\\.\foo\bar' does exist and can be perfectly read from.

This does not happen on Unix, only on Windows, due to Windows path
conventions.  The ability to read from pipes is important for some

How to repeat:
Create a Windows named file, send some data there, and try to run the
`LOAD DATA' SQL command to read it.
[21 Aug 2009 1:33] MySQL Verification Team
See bug: http://bugs.mysql.com/bug.php?id=44835.
[29 Dec 2009 22:24] Sveta Smirnova
Thank you for the report.

Verified as described.
[18 Apr 2015 1:33] supreet padhi
I am also getting the same issue. Steps to reproduce
1. Create a named pipe server using 
LPTSTR lpszPipename = TEXT("\\\\.\\pipe\\mynamedpipe");
hPipe = CreateNamedPipe(
			lpszPipename,             // pipe name 
			PIPE_ACCESS_DUPLEX,       // read/write access 
			PIPE_TYPE_MESSAGE |       // message type pipe 
			PIPE_READMODE_MESSAGE |   // message-read mode 
			PIPE_WAIT,                // blocking mode 
			PIPE_UNLIMITED_INSTANCES, // max. instances  
			BUFSIZE,                  // output buffer size 
			BUFSIZE,                  // input buffer size 
			0,                        // client time-out 
			NULL);                    // default security attribute 

		fConnected = ConnectNamedPipe(hPipe, NULL) ?
		TRUE : (GetLastError() == ERROR_PIPE_CONNECTED);

		if (fConnected)
			printf("Client connected.\n");
			LPTSTR lpvMessage = TEXT("abc|2|ff|1.2\n");
			DWORD cbToWrite = (lstrlen(lpvMessage) + 1)*sizeof(TCHAR);
			DWORD cbWritten;
			// Write the reply to the pipe. 
			BOOL fSuccess = WriteFile(
				hPipe,        // handle to pipe 
				lpvMessage,     // buffer to write from 
				cbToWrite, // number of bytes to write 
				&cbWritten,   // number of bytes written 
				NULL);        // not overlapped I/O 
2. Create table test with ddl: create table test (a char(10), b int , c varchar(10), d float(2,2))
3. start writing to the named pipe using mysql client utility mysql --database=test --local-infile=true  -e "load data local infile '\\\\.\\pipe\\mynamedpipe' into table test  FIELDS TERMINATED BY '|' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' " .

I am getting the following error message
ERROR 2 (HY000) at line 1: File '\\pipe\mynamedpipe' not found (Errcode: 2 - No such file or directory)