From a022b3c5496b99c73b99f23f3aaf83818679c848 Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Wed, 8 Sep 2004 13:28:11 -0500 Subject: [PATCH] mysql.cc: Print sqlstate value in batch mode, not just in interactive mode. --- client/mysql.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 142e396d424..e940fdcc406 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2947,7 +2947,12 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) (void) fflush(file); fprintf(file,"ERROR"); if (error) - (void) fprintf(file," %d",error); + { + if (sqlstate) + (void) fprintf(file," %d (%s)",error, sqlstate); + else + (void) fprintf(file," %d",error); + } if (status.query_start_line && line_numbers) { (void) fprintf(file," at line %lu",status.query_start_line);