summaryrefslogtreecommitdiff
path: root/sql/unireg.h
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-10-15 17:23:43 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-10-15 17:23:43 +0500
commitd8c3f2263f3deaadff957a0047460e8058cffccf (patch)
treee38788d80d85437efb1819550af226f7b2e2c195 /sql/unireg.h
parent3929dddcd76130529cabfbd68cfff024e6b5c80d (diff)
downloadmariadb-git-d8c3f2263f3deaadff957a0047460e8058cffccf.tar.gz
WL#751 Error message construction, backport
Diffstat (limited to 'sql/unireg.h')
-rw-r--r--sql/unireg.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/unireg.h b/sql/unireg.h
index 3ff7f058e3c..f22be194952 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -39,7 +39,11 @@
#define PLUGINDIR "lib/plugin"
#endif
-#define ER(X) errmesg[(X) - ER_ERROR_FIRST]
+#define CURRENT_THD_ERRMSGS current_thd->variables.lc_messages->errmsgs->errmsgs
+#define DEFAULT_ERRMSGS my_default_lc_messages->errmsgs->errmsgs
+
+#define ER(X) CURRENT_THD_ERRMSGS[(X) - ER_ERROR_FIRST]
+#define ER_DEFAULT(X) DEFAULT_ERRMSGS[(X) - ER_ERROR_FIRST]
#define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X) : "Invalid error code")