Bug #72071 no month-day in "prompt"?
Submitted: 18 Mar 2014 19:38 Modified: 9 Dec 2014 19:22
Reporter: Programmer Old Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.6.14-log, 5.6.23 OS:Any
Assigned to: CPU Architecture:Any

[18 Mar 2014 19:38] Programmer Old
Description:
These timestamps or parts may be added to a "mysql"-prompt:

\D	The full current date
\Y	The current year, four digits
\y	The current year, two digits
\o	The current month in numeric format
\O	The current month in three-letter format (Jan, Feb, …)
\w	The current day of the week in three-letter format (Mon, Tue, …)
\R	The current time, in 24-hour military time (0–23)
\P	am/pm
\r	The current time, standard 12-hour time (1–12)
\m	Minutes of the current time
\s	Seconds of the current time

How to repeat:
One thing is conspicuously missing, the month-day.

Suggested fix:
Add the month-day, too.
[31 Mar 2014 9:54] Hartmut Holzgraefe
Looking at the code tm_mday, and also the less important tm_yday and tm_isdst, parts of "struct tm" are not handled anywhere, so printing the full date in the prompt is not possible:

client > egrep -o "tm_[[:alpha:]]+" mysql.cc | sort | uniq
tm_hour
tm_min
tm_mon
tm_sec
tm_wday
tm_year
[9 Dec 2014 19:22] Sveta Smirnova
Thank you for the reasonable feature request.
[20 Sep 2020 8:17] Sveta Smirnova
Added option \M for having day of the month in the prompt

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug72071.diff (text/x-patch), 446 bytes.

[20 Sep 2020 8:18] Sveta Smirnova
Example on how contributed code works:

mysql> prompt \O \M > 
PROMPT set to '\O \M > '
Sep 20 >