~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_handler_errors.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
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.
9
 
 *
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.
14
 
 *
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
 
 */
19
 
 
20
 
#include <drizzled/global.h>
21
 
#include <drizzled/base.h>
22
 
#include <mysys/my_sys.h>
23
 
#include <storage/myisam/my_handler.h>
24
 
 
25
 
#include <drizzled/gettext.h>
 
1
#include <libdrizzle/gettext.h>
26
2
 
27
3
/*
28
4
  Errors a handler can give you
37
13
  /* HA_ERR_INTERNAL_ERROR */
38
14
  N_("Internal (unspecified) error in handler"),
39
15
  /* HA_ERR_RECORD_CHANGED */
40
 
  N_("Someone has changed the row since it was read (while the table "
41
 
     "was locked to prevent it)"),
 
16
  N_("Someone has changed the row since it was read (while the table was locked to prevent it)"),
42
17
  /* HA_ERR_WRONG_INDEX */
43
18
  N_("Wrong index given to function"),
44
19
  /* empty */
140
115
  /* HA_ERR_NEW_FILE */
141
116
  N_("The table is of a new format not supported by this version"),
142
117
  /* HA_ERR_ROWS_EVENT_APPLY */
143
 
  N_("The event could not be processed no other handler error happened"),
 
118
  N_("The event could not be processed no other hanlder error happened"),
144
119
  /* HA_ERR_INITIALIZATION */
145
 
  N_("Got a fatal error during initialzation of handler"),
 
120
  N_("Got a fatal error during initialzaction of handler"),
146
121
  /* HA_ERR_FILE_TOO_SHORT */
147
122
  N_("File to short; Expected more data in file"),
148
123
  /* HA_ERR_WRONG_CRC */
155
130
  N_("Tablespace not empty") /* TODO: get a better message */
156
131
};
157
132
 
158
 
 
159
 
/*
160
 
  Register handler error messages for usage with my_error()
161
 
 
162
 
  NOTES
163
 
    This is safe to call multiple times as my_error_register()
164
 
    will ignore calls to register already registered error numbers.
165
 
*/
166
 
 
167
 
 
168
 
void my_handler_error_register(void)
169
 
{
170
 
  /*
171
 
    If you got compilation error here about compile_time_assert array, check
172
 
    that every HA_ERR_xxx constant has a corresponding error message in
173
 
    handler_error_messages[] list (check mysys/ma_handler_errors.h and
174
 
    include/my_base.h).
175
 
 
176
 
    TODO: Remove fix the handler_error_messages so that this hack isn't
177
 
          necessary.
178
 
  */
179
 
#ifdef __GNUC__
180
 
  char compile_time_assert[(HA_ERR_FIRST +
181
 
                            array_elements(handler_error_messages) ==
182
 
                            HA_ERR_LAST + 1) ? 1 : -1]
183
 
    __attribute__ ((__unused__));
184
 
#endif
185
 
  my_error_register(handler_error_messages, HA_ERR_FIRST,
186
 
                    HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
187
 
}
188
 
 
189
 
 
190
 
void my_handler_error_unregister(void)
191
 
{
192
 
  my_error_unregister(HA_ERR_FIRST,
193
 
                      HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
194
 
}