From e422592b0d7f60a89e1a3e6111fafe4c6eb0d51f Mon Sep 17 00:00:00 2001 From: ulwlu Date: Fri, 30 Jul 2021 22:07:53 +0900 Subject: [PATCH] Add prompt option to show transaction status --- client/mysql.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/mysql.cc b/client/mysql.cc index c76536f29f2c..0af21b8815eb 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -5173,6 +5173,11 @@ static const char *construct_prompt() { part_username ? part_username : (current_user ? current_user : "(unknown)")); break; + case 'T': + if (mysql.server_status & SERVER_STATUS_IN_TRANS) { + processed_prompt.append("*"); + } + break; case PROMPT_CHAR: processed_prompt.append(PROMPT_CHAR); break;