Bug #5863 The edit command in mysqlc doesn't work with cygwin editors
Submitted: 2 Oct 2004 19:30 Modified: 2 Oct 2004 21:21
Reporter: Charles Ocheret Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.0.21 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[2 Oct 2004 19:30] Charles Ocheret
Description:
The mysqlc command (w/ cygwin command line editing) seems to be confusing the cygwin and Windows nomenclature for the file system.  If I try to edit a command using \e or edit, I get the following error

mysql> edit
/mysql/bin/mysqlc.exe: Can't create/write to file '/tmp/sql10053304.0' (Errcode: 2)

If I create a folder called C:\tmp then this doesn't fail anymore.  However, my editor (cygwin vim) does not start up with any content, nor does providing content with my editor leave results in mysqlc when I return from the editor.

However, I am finding that files like /tmp/sql10053304.0 are being created in cygwin's /tmp directory (actually C:\cygwin\tmp on my system).

My guess is that mysqlc is dropping text in C:\tmp but the cygwin editor is looking in C:\cygwin\tmp.

How to repeat:
turbo 537$ mysqlc
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 4.0.21-max

Type 'help' for help.

mysql> edit
/mysql/bin/mysqlc.exe: Can't create/write to file '/tmp/sql10053304.0' (Errcode:
 2)
mysql> quit
Bye
turbo 538$ mkdir /cygdrive/c/tmp
turbo 539$ mysqlc
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.0.21-max

Type 'help' for help.
mysql> edit
...enter a command like 'show databases' in the editor...
mysql> quit
Bye
turbo 540$ ls /cygdrive/c/tmp
turbo 541$ ls /tmp/sql*
/tmp/sql10053304.0  /tmp/sql10053304.1

Suggested fix:
Allow a config or command line option for mysqlc so that it uses cygwin's file nomenclature so that cygwin editing programs can be used.
[2 Oct 2004 21:21] MySQL Verification Team
The problem with mysqlc.exe is it is a very older executable and
currently we don't have a Production environment for Cygwin.

Thanks for the bug report. 

Regards