summaryrefslogtreecommitdiff
path: root/sql/net_pkg.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/net_pkg.cc')
-rw-r--r--sql/net_pkg.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/net_pkg.cc b/sql/net_pkg.cc
index 55c9bd3cfab..8bb601cebcf 100644
--- a/sql/net_pkg.cc
+++ b/sql/net_pkg.cc
@@ -115,7 +115,13 @@ net_printf(NET *net, uint errcode, ...)
is useful for rare errors that are not worth the hassle to put in
errmsg.sys, but at the same time, the message is not fixed text
*/
- format=errcode ? ER(errcode) : va_arg(args,char*);
+ if (errcode)
+ format= ER(errcode);
+ else
+ {
+ format=va_arg(args,char*);
+ errcode= ER_UNKNOWN_ERROR;
+ }
offset= net->return_errno ? 2 : 0;
text_pos=(char*) net->buff+head_length+offset+1;
(void) vsprintf(my_const_cast(char*) (text_pos),format,args);