Bug #7553 | Read StdIn only when EOF ? | ||
---|---|---|---|
Submitted: | 28 Dec 2004 9:22 | Modified: | 28 Dec 2004 13:34 |
Reporter: | Fabio Fernandes | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
Version: | 4.1.8 | OS: | Windows (windows 2000 Pro) |
Assigned to: | CPU Architecture: | Any |
[28 Dec 2004 9:22]
Fabio Fernandes
[28 Dec 2004 9:56]
Joerg Bruehe
You have to check the Windows API documentation for this. Typically, a C runtime library and an operating system will both buffer I/O for efficiency reasons. So if you want to use pipes for communication between co-processes, you have to ensure that 1) your application writes its commands _unbuffered_ into the pipe (in C, typically output is buffered unless it is to a terminal, so pipe output would be buffered - please check for Windows); 2) the command pipe is not by default buffered in the operating system; 3) the result pipe is not buffered; 4) your application gets results immediately, even if the result pipe is not yet full. I assume item 1) to be the most important one. If you have any doubts, try the same setup with a dummy process replacing the MySQL server, that dummy process should just read commands from one pipe and reply something on the other. Only if that works, replace the dummy by the MySQL server and try again.
[28 Dec 2004 10:32]
Sergei Golubchik
and don't forget to run mysql with -n switch (see mysql --help for details)
[28 Dec 2004 10:48]
Fabio Fernandes
Thanks for all, i will check my code NOW and send feedback very soon.
[28 Dec 2004 10:59]
Fabio Fernandes
My code to handle pipes ok, just "-n" in client and StdOut ready ! Thanks again !
[28 Dec 2004 13:34]
Alexander Keremidarski
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php