Bug #49133 .mysql_history usage too inflexible (without going in batch mode)
Submitted: 26 Nov 2009 10:52 Modified: 26 Nov 2009 11:18
Reporter: Nicklas Westerlund (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.1.41 OS:Any
Assigned to: CPU Architecture:Any
Tags: community, Contribution

[26 Nov 2009 10:52] Nicklas Westerlund
The default is to always log to .mysql_history unless it is symlinked to /dev/null. There is cases where you want to execute a few statements (without using --batch) and not have them logged.  

At those times it also feels like overkill to move the history file out of the way, create a link to /dev/null, do your things, then remove the link and move the history file back. 

For these reasons I added the --no-history option to the mysql client, as well as support for no-history in the [client] my.cnf section

How to repeat:
apply patch to 5.1.41 and recompile the client section. 

Suggested fix:
Review the attached patch
[26 Nov 2009 10:54] Nicklas Westerlund
patch attached

Attachment: client_priv.h-mysql.cc.diff.rtf (text/rtf), 2.85 KiB.

[26 Nov 2009 11:18] Valeriy Kravchuk
Thank you for the patch contributed.