Bug #2041 4.1 mysql signal problem on Mac OS X
Submitted: 7 Dec 2003 19:08 Modified: 17 Dec 2003 10:00
Reporter: Paul DuBois Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.1.x OS:MacOS (Mac OS X 10.2.8)
Assigned to: CPU Architecture:Any

[7 Dec 2003 19:08] Paul DuBois
Description:
Ctrl-Z to suspend the mysql client works only *once*
per invocation. After mysql is resumed, it cannot be
suspended again. This happens only in 4.1, not in
4.0. It also doesn't happen on Linux.  Seems to be a
Mac OS X-specific problem.

How to repeat:
1. Invoke mysql.
2. Type Ctrl-Z. mysql will suspend
3. Resume mysql.
4. If you type Ctrl-Z a bunch of times, nothing happens.
mysql no longer can be suspended.
5. Hit return. The next mysql> prompt will appear.
6. Now if you type Ctrl-Z a bunch of times, nothing appears
for the first one, but the second and subsequent ones echo
as "^Z". These characters cannot be backspaced over.

Sending the mysql process a STOP signal using kill from another
window is ineffective when mysql is in a cannot-suspend state.
However, trying this led me to another odd scenario:

1. Invoke mysql.
2. From another window, determine the PID of the mysql process.
Issue kill - STOP and then kill -CONT for that process.
3. Resume mysql in the first window. *Now*, it can be suspended
and resumed normally!

Weird.

Suggested fix:
No idea.
[17 Dec 2003 10:00] Indrek Siitan
Cannot repeat on my system (10.3 Panther):

//indrek/tfr~>/usr/local/mysql/bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.1.1-alpha-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> 
[1]+  Stopped                 /usr/local/mysql/bin/mysql -uroot
//indrek/tfr~>fg
/usr/local/mysql/bin/mysql -uroot

mysql> 
[1]+  Stopped                 /usr/local/mysql/bin/mysql -uroot
//indrek/tfr~>
//indrek/tfr~>fg
/usr/local/mysql/bin/mysql -uroot

mysql> 
[1]+  Stopped                 /usr/local/mysql/bin/mysql -uroot
//indrek/tfr~>
//indrek/tfr~>fg
/usr/local/mysql/bin/mysql -uroot

mysql> 

I was able to suspend and resume it 'til it stopped being amusing.
[18 Dec 2003 19:01] Paul DuBois
Okay, I have tried to repeat the problem on Panther
(Mac OS X 10.3) and it does not happen.  Perhaps this
is a Jaguar (Mac OS X 10.2) issue only.