1
/* Copyright (C) 2002-2006 MySQL AB
3
This library is free software; you can redistribute it and/or
4
modify it under the terms of the GNU Library General Public
5
License as published by the Free Software Foundation; version 2
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public
14
License along with this library; if not, write to the Free
15
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
20
#include "mysys_priv.h"
583
Register handler error messages for usage with my_error()
586
This is safe to call multiple times as my_error_register()
587
will ignore calls to register already registered error numbers.
591
void my_handler_error_register(void)
594
If you got compilation error here about compile_time_assert array, check
595
that every HA_ERR_xxx constant has a corresponding error message in
596
handler_error_messages[] list (check mysys/ma_handler_errors.h and
599
TODO: Remove fix the handler_error_messages so that this hack isn't
603
char compile_time_assert[(HA_ERR_FIRST +
604
array_elements(handler_error_messages) ==
605
HA_ERR_LAST + 1) ? 1 : -1]
606
__attribute__ ((__unused__));
608
my_error_register(handler_error_messages, HA_ERR_FIRST,
609
HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
613
void my_handler_error_unregister(void)
615
my_error_unregister(HA_ERR_FIRST,
616
HA_ERR_FIRST+ array_elements(handler_error_messages)-1);