"manage.py dbshell" on windows causes strange command line / mysql switching bug
|Reported by:||jumpfroggy||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This is hard to explain. I run this on a Windows XP machine:
C:\project>manage.py dbshell C:\project>Welcome to the MySQL monitor. Commands end with ; or \ g. Your MySQL connection id is 6902 Server version: 5.0.51a-community-nt-log MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
Basically what happens is that every other command goes to either the mysql.exe client or the original command line shell (cmd.exe) in alternating order. So if you keep pressing enter/return, you get this:
mysql> C:\project> mysql> C:\project>
And if you do type in "show tables;" three times, you get this:
mysql> show tables; 'show' is not recognized as an internal or external command, operable program or batch file. C:\project>show tables; (shows tables here) 26 rows in set (0.00 sec) mysql> show tables; 'show' is not recognized as an internal or external command, operable program or batch file.
The first response (show is not recognized) is from cmd.exe. The second result is from mysql.exe. The third result is again from cmd.exe.
I think that manage.py is executing the mysql.exe process concurrently with the opening command line, and the STDIN and STDOUT are being merged together. Since they both block for input, when you enter a command in one and press enter, the "focus" switches to the other process.
All of this works on unix, so it seems to be a Windows-only problem. Can anyone else confirm?
- Django SVN rev 9014 (Apologies for running an older version of Django... production server is running 1.0, so I can't upgrade my dev machine at the moment).
- Windows XP SP3
- Python 2.5.2