Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#10639 closed (duplicate)

"manage.py dbshell" on windows causes strange command line / mysql switching bug

Reported by: jumpfroggy Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords: dbshell windows
Cc: virtue@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (3)

comment:1 by jumpfroggy, 16 years ago

Cc: virtue@… added

comment:2 by Karen Tracey, 16 years ago

Resolution: duplicate
Status: newclosed

I suspect this is due to the same root cause as #10357. You might try the latest patch there and see if it solves what you are seeing, it would be useful either way to get feedback on that patch in #10357.

comment:3 by jumpfroggy, 16 years ago

I'm trying the patch, looks like it's better but not fixed completely. I'll comment more in that thread. Thx.

Note: See TracTickets for help on using tickets.
Back to Top