summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@oracle.com>2011-03-28 10:47:30 +0200
committerMagne Mahre <magne.mahre@oracle.com>2011-03-28 10:47:30 +0200
commit4c4cb80b0af1b9e4a5e38130ee3566615bd8a8b4 (patch)
treed9ded1526828e9a2bd239908dbd08d7d439d865d /extra
parente9935c6363b9fb1f132c4ca43dd38fddd61ebc10 (diff)
downloadmariadb-git-4c4cb80b0af1b9e4a5e38130ee3566615bd8a8b4.tar.gz
Bug#11900714 REMOVE LGPL LICENSED FILES IN MYSQL 5.1
The LGPL license is used in some legacy code, and to adhere to current licensing polity, we remove those files that are no longer used, and reorganize the remaining LGPL code so it will be GPL licensed from now on. Note: This patch only removed LGPL licensed files in MySQL 5.1, and is the second of a set of patches to remove LGPL from all trees. (See Bug# 11840513 for details)
Diffstat (limited to 'extra')
-rw-r--r--extra/perror.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/extra/perror.c b/extra/perror.c
index c32ad2bc791..5162f5e03dc 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -32,7 +32,6 @@ static my_bool verbose, print_all_codes;
#include "../include/my_base.h"
#include "../mysys/my_handler_errors.h"
-#include "../include/my_handler.h"
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
static my_bool ndb_code;
@@ -185,6 +184,36 @@ static const char *get_ha_error_msg(int code)
}
+/*
+ Register handler error messages for usage with my_error()
+
+ NOTES
+ This is safe to call multiple times as my_error_register()
+ will ignore calls to register already registered error numbers.
+*/
+void my_handler_error_register(void)
+{
+ /*
+ If you got compilation error here about compile_time_assert array, check
+ that every HA_ERR_xxx constant has a corresponding error message in
+ handler_error_messages[] list (check mysys/ma_handler_errors.h and
+ include/my_base.h).
+ */
+ compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) ==
+ HA_ERR_LAST + 1);
+ my_error_register(handler_error_messages, HA_ERR_FIRST,
+ HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
+}
+
+
+void my_handler_error_unregister(void)
+{
+ my_error_unregister(HA_ERR_FIRST,
+ HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
+}
+
+
+
#if defined(__WIN__)
static my_bool print_win_error_msg(DWORD error, my_bool verbose)
{