~drizzle-trunk/drizzle/development

549 by Monty Taylor
Took gettext.h out of header files.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
4
 *  Copyright (C) 2000 MySQL AB
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
5
 *  Copyright (C) 2008 Sun Microsystems, Inc.
549 by Monty Taylor
Took gettext.h out of header files.
6
 *
7
 *  This program is free software; you can redistribute it and/or modify
8
 *  it under the terms of the GNU General Public License as published by
9
 *  the Free Software Foundation; version 2 of the License.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
/*
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
22
 * Errors a drizzled can give you
23
 */
549 by Monty Taylor
Took gettext.h out of header files.
24
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
25
#include <config.h>
26
#include <drizzled/internal/my_sys.h>
27
#include <drizzled/definitions.h>
28
#include <drizzled/error.h>
29
#include <drizzled/gettext.h>
30
#include <drizzled/identifier.h>
2192.4.2 by Olaf van der Spek
drizzled/find_ptr.h => drizzled/util/find_ptr.h
31
#include <drizzled/util/find_ptr.h>
2041.3.15 by Brian Aker
Cleanup error usage around identifier usage.
32
1678.1.1 by Monty Taylor
Removed our unordered wrappers. We use Boost now.
33
#include <boost/unordered_map.hpp>
1271.7.9 by Tim Penhey
Almost there.
34
#include <exception>
549 by Monty Taylor
Took gettext.h out of header files.
35
1271.7.15 by Tim Penhey
Fix mistakes from the merge.
36
namespace drizzled
37
{
38
namespace
39
{
1271.7.2 by Tim Penhey
Add notes and typedef.
40
1271.7.9 by Tim Penhey
Almost there.
41
class ErrorStringNotFound: public std::exception
42
{
43
public:
1816.2.3 by Monty Taylor
Fixed some more ICC warnings. How did I get started on this this morning?
44
  ErrorStringNotFound()
1271.7.9 by Tim Penhey
Almost there.
45
  {}
46
};
1271.7.2 by Tim Penhey
Add notes and typedef.
47
1271.7.4 by Tim Penhey
Another incremental commit.
48
ErrorMap& get_error_map()
49
{
50
  static ErrorMap errors;
51
  return errors;
52
}
53
54
} // anonymous namespace
1271.7.3 by Tim Penhey
Kinda changed, probably doesn't compile.
55
1996.3.2 by Monty Taylor
Add API for getting at ErrorMap information.
56
const ErrorMap::ErrorMessageMap& ErrorMap::get_error_message_map()
57
{
58
  return get_error_map().mapping_;
59
}
60
2087.3.1 by Brian Aker
Entire convert over to time_t.
61
void add_error_message(drizzled::error_t error_code,
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
62
                       const std::string &error_name,
63
                       const std::string &message)
1271.7.9 by Tim Penhey
Almost there.
64
{
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
65
  get_error_map().add(error_code, error_name, message);
1271.7.9 by Tim Penhey
Almost there.
66
}
67
2087.3.1 by Brian Aker
Entire convert over to time_t.
68
const char * error_message(drizzled::error_t code)
549 by Monty Taylor
Took gettext.h out of header files.
69
{
1271.7.9 by Tim Penhey
Almost there.
70
  try
71
  {
72
    return get_error_map().find(code).c_str();
73
  }
74
  catch (ErrorStringNotFound const& e)
75
  {
76
    return get_error_map().find(ER_UNKNOWN_ERROR).c_str();
77
  }
549 by Monty Taylor
Took gettext.h out of header files.
78
}
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
79
80
error_handler_func error_handler_hook= NULL;
81
2159.2.8 by Brian Aker
Merge in fixes for error messages with privs.
82
namespace error {
83
84
void access(drizzled::identifier::User::const_reference user)
85
{
86
  std::string user_string;
87
  user.getSQLPath(user_string);
88
89
  my_error(ER_ACCESS_DENIED_ERROR, MYF(0), user_string.c_str(),
90
           user.hasPassword() ? ER(ER_YES) : ER(ER_NO));
91
} 
92
93
void access(drizzled::identifier::User::const_reference user, drizzled::identifier::Schema::const_reference schema)
94
{
95
  std::string user_string;
96
  user.getSQLPath(user_string);
97
98
  std::string schema_string;
99
  schema.getSQLPath(schema_string);
100
101
  my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), user_string.c_str(), schema_string.c_str());
102
} 
103
104
void access(drizzled::identifier::User::const_reference user, drizzled::identifier::Table::const_reference table)
105
{
106
  std::string user_string;
107
  user.getSQLPath(user_string);
108
109
  std::string table_string;
110
  table.getSQLPath(table_string);
111
112
  my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), user_string.c_str(), table_string.c_str());
113
} 
114
2187.2.3 by Brian Aker
This cleans up the the error message system by providing for the ability to
115
static error::level_t _verbosity= error::ERROR;
116
static std::string _verbosity_strint;
117
118
const std::string &verbose_string()
119
{
120
  switch (_verbosity)
121
  {
122
  case error::INSPECT:
123
    {
124
      static std::string _arg= "INSPECT";
125
      return _arg;
126
    }
127
  case error::INFO:
128
    {
129
      static std::string _arg= "INFO";
130
      return _arg;
131
    }
132
  case error::WARN:
133
    {
134
      static std::string _arg= "WARN";
135
      return _arg;
136
    }
137
  case error::ERROR:
138
    {
139
      static std::string _arg= "ERROR";
140
      return _arg;
141
    }
142
  }
143
144
  abort();
145
}
146
147
error::level_t &verbosity()
148
{
149
  return _verbosity;
150
}
151
152
void check_verbosity(const std::string &arg)
153
{
154
  if (not arg.compare("INSPECT"))
155
  {
156
    _verbosity= error::INSPECT;
157
  }
158
  else if (not arg.compare("INFO"))
159
  {
160
    _verbosity= error::INFO;
161
  }
162
  else if (not arg.compare("WARN"))
163
  {
164
    _verbosity= error::WARN;
165
  }
166
  else if (not arg.compare("ERROR"))
167
  {
168
    _verbosity= error::ERROR;
169
  }
170
}
171
2159.2.8 by Brian Aker
Merge in fixes for error messages with privs.
172
} // namespace error
173
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
174
/*
175
  WARNING!
176
  my_error family functions have to be used according following rules:
177
  - if message have not parameters use my_message(ER_CODE, ER(ER_CODE), MYF(N))
178
  - if message registered use my_error(ER_CODE, MYF(N), ...).
179
  - With some special text of errror message use:
180
  my_printf_error(ER_CODE, format, MYF(N), ...)
181
*/
182
183
/*
184
   Error message to user
185
186
   SYNOPSIS
187
     my_error()
188
       nr	Errno
189
       MyFlags	Flags
190
       ...	variable list
191
*/
192
2096.1.4 by Brian Aker
Clean up errors and pass information in creation of statement.
193
void my_error(const std::string &ref, error_t nr, myf MyFlags)
194
{
195
  my_error(nr, MyFlags, ref.c_str());
196
} 
197
2068.7.7 by Brian Aker
Add additional getTableMessage() method which will have a good return type.
198
void my_error(error_t nr, drizzled::Identifier::const_reference ref, myf MyFlags)
2041.3.15 by Brian Aker
Cleanup error usage around identifier usage.
199
{
200
  std::string temp;
201
  ref.getSQLPath(temp);
2068.7.7 by Brian Aker
Add additional getTableMessage() method which will have a good return type.
202
  my_error(nr, MyFlags, temp.c_str());
2041.3.15 by Brian Aker
Cleanup error usage around identifier usage.
203
} 
204
2054.1.2 by Brian Aker
Rename of the Loooongggggg error type over to simply drizzled::error_t
205
void my_error(error_t nr)
2040.2.2 by Brian Aker
Update assert test, additional my_error.
206
{
207
  my_error(nr, MYF(0));
208
}
209
2054.1.2 by Brian Aker
Rename of the Loooongggggg error type over to simply drizzled::error_t
210
void my_error(error_t nr, myf MyFlags, ...)
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
211
{
1271.7.9 by Tim Penhey
Almost there.
212
  std::string format;
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
213
  va_list args;
214
  char ebuff[ERRMSGSIZE + 20];
215
1271.7.9 by Tim Penhey
Almost there.
216
  try
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
217
  {
1271.7.9 by Tim Penhey
Almost there.
218
    format= get_error_map().find(nr);
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
219
    va_start(args,MyFlags);
1271.7.12 by Tim Penhey
Put the gettext macro back in.
220
    (void) vsnprintf (ebuff, sizeof(ebuff), _(format.c_str()), args);
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
221
    va_end(args);
222
  }
1271.7.9 by Tim Penhey
Almost there.
223
  catch (ErrorStringNotFound const& e)
224
  {
225
    (void) snprintf (ebuff, sizeof(ebuff), _("Unknown error %d"), nr);
226
  }
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
227
  (*error_handler_hook)(nr, ebuff, MyFlags);
228
}
229
230
/*
231
  Error as printf
232
1271.5.3 by Tim Penhey
change the include files
233
         SYNOPSIS
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
234
    my_printf_error()
235
      error	Errno
236
      format	Format string
237
      MyFlags	Flags
238
      ...	variable list
239
*/
240
2087.3.1 by Brian Aker
Entire convert over to time_t.
241
void my_printf_error(drizzled::error_t error, const char *format, myf MyFlags, ...)
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
242
{
243
  va_list args;
244
  char ebuff[ERRMSGSIZE+20];
245
246
  va_start(args,MyFlags);
247
  (void) vsnprintf (ebuff, sizeof(ebuff), format, args);
248
  va_end(args);
249
  (*error_handler_hook)(error, ebuff, MyFlags);
250
}
251
252
/*
253
  Give message using error_handler_hook
254
255
  SYNOPSIS
256
    my_message()
257
      error	Errno
258
      str	Error message
259
      MyFlags	Flags
260
*/
261
2194.3.1 by Olaf van der Spek
Remove register keyword
262
void my_message(drizzled::error_t error, const char *str, myf MyFlags)
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
263
{
264
  (*error_handler_hook)(error, str, MyFlags);
265
}
266
267
1271.7.4 by Tim Penhey
Another incremental commit.
268
// Insert the message for the error.  If the error already has an existing
269
// mapping, an error is logged, but the function continues.
2087.3.1 by Brian Aker
Entire convert over to time_t.
270
void ErrorMap::add(drizzled::error_t error_num,
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
271
                   const std::string &error_name,
272
                   const std::string &message)
1271.7.4 by Tim Penhey
Another incremental commit.
273
{
274
  if (mapping_.find(error_num) == mapping_.end())
275
  {
276
    // Log the error.
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
277
    mapping_[error_num]= ErrorMap::value_type(error_name, message);
1271.7.4 by Tim Penhey
Another incremental commit.
278
  }
279
  else
280
  {
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
281
    mapping_.insert(ErrorMessageMap::value_type(error_num, ErrorMap::value_type(error_name, message)));
1271.7.4 by Tim Penhey
Another incremental commit.
282
  }
283
}
284
2087.3.1 by Brian Aker
Entire convert over to time_t.
285
const std::string &ErrorMap::find(drizzled::error_t error_num) const
1271.7.4 by Tim Penhey
Another incremental commit.
286
{
2192.4.1 by Olaf van der Spek
Add find_ptr
287
  const ErrorMessageMap::mapped_type* pos= find_ptr(mapping_, error_num);
288
  if (!pos)
1271.7.4 by Tim Penhey
Another incremental commit.
289
  {
1816.2.3 by Monty Taylor
Fixed some more ICC warnings. How did I get started on this this morning?
290
    throw ErrorStringNotFound();
1271.7.4 by Tim Penhey
Another incremental commit.
291
  }
2192.4.1 by Olaf van der Spek
Add find_ptr
292
  return pos->second;
1271.7.4 by Tim Penhey
Another incremental commit.
293
}
294
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
295
#define ADD_ERROR_MESSAGE(code, msg) add(code, STRINGIFY_ARG(code), msg)
1271.7.4 by Tim Penhey
Another incremental commit.
296
// Constructor sets the default mappings.
297
ErrorMap::ErrorMap()
298
{
2107.1.1 by Brian Aker
Add in all of the error messages, also remove all cases of --error number
299
  ADD_ERROR_MESSAGE(EE_OK, N_("SUCCESS"));
300
  ADD_ERROR_MESSAGE(EE_ERROR_FIRST, N_("Error on first"));
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
301
  ADD_ERROR_MESSAGE(ER_NO, N_("NO"));
302
  ADD_ERROR_MESSAGE(ER_YES, N_("YES"));
303
  ADD_ERROR_MESSAGE(ER_CANT_CREATE_FILE, N_("Can't create file '%-.200s' (errno: %d)"));
304
  ADD_ERROR_MESSAGE(ER_CANT_CREATE_TABLE, N_("Can't create table '%-.200s' (errno: %d)"));
305
  ADD_ERROR_MESSAGE(ER_CANT_CREATE_DB, N_("Can't create schema '%-.192s' (errno: %d)"));
306
  ADD_ERROR_MESSAGE(ER_DB_CREATE_EXISTS, N_("Can't create schema '%-.192s'; schema exists"));
307
  ADD_ERROR_MESSAGE(ER_DB_DROP_EXISTS, N_("Can't drop schema '%-.192s'; schema doesn't exist"));
308
  ADD_ERROR_MESSAGE(ER_CANT_DELETE_FILE, N_("Error on delete of '%-.192s' (errno: %d)"));
309
  ADD_ERROR_MESSAGE(ER_CANT_GET_STAT, N_("Can't get status of '%-.200s' (errno: %d)"));
310
  ADD_ERROR_MESSAGE(ER_CANT_LOCK, N_("Can't lock file (errno: %d)"));
311
  ADD_ERROR_MESSAGE(ER_CANT_OPEN_FILE, N_("Can't open file: '%-.200s' (errno: %d)"));
312
  ADD_ERROR_MESSAGE(ER_FILE_NOT_FOUND, N_("Can't find file: '%-.200s' (errno: %d)"));
313
  ADD_ERROR_MESSAGE(ER_CANT_READ_DIR, N_("Can't read dir of '%-.192s' (errno: %d)"));
314
  ADD_ERROR_MESSAGE(ER_CHECKREAD, N_("Record has changed since last read in table '%-.192s'"));
315
  ADD_ERROR_MESSAGE(ER_DISK_FULL, N_("Disk full (%s); waiting for someone to free some space..."));
316
  ADD_ERROR_MESSAGE(ER_DUP_KEY, N_("Can't write; duplicate key in table '%-.192s'"));
317
  ADD_ERROR_MESSAGE(ER_ERROR_ON_CLOSE, N_("Error on close of '%-.192s' (errno: %d)"));
318
  ADD_ERROR_MESSAGE(ER_ERROR_ON_READ, N_("Error reading file '%-.200s' (errno: %d)"));
319
  ADD_ERROR_MESSAGE(ER_ERROR_ON_RENAME, N_("Error on rename of '%-.150s' to '%-.150s' (errno: %d)"));
320
  ADD_ERROR_MESSAGE(ER_ERROR_ON_WRITE, N_("Error writing file '%-.200s' (errno: %d)"));
321
  ADD_ERROR_MESSAGE(ER_FILE_USED, N_("'%-.192s' is locked against change"));
322
  ADD_ERROR_MESSAGE(ER_FILSORT_ABORT, N_("Sort aborted"));
323
  ADD_ERROR_MESSAGE(ER_GET_ERRNO, N_("Got error %d from storage engine"));
324
  ADD_ERROR_MESSAGE(ER_ILLEGAL_HA, N_("Table storage engine for '%-.192s' doesn't have this option"));
325
  ADD_ERROR_MESSAGE(ER_KEY_NOT_FOUND, N_("Can't find record in '%-.192s'"));
326
  ADD_ERROR_MESSAGE(ER_NOT_FORM_FILE, N_("Incorrect information in file: '%-.200s'"));
327
  ADD_ERROR_MESSAGE(ER_NOT_KEYFILE, N_("Incorrect key file for table '%-.200s'; try to repair it"));
328
  ADD_ERROR_MESSAGE(ER_OLD_KEYFILE, N_("Old key file for table '%-.192s'; repair it!"));
329
  ADD_ERROR_MESSAGE(ER_OPEN_AS_READONLY, N_("Table '%-.192s' is read only"));
330
  ADD_ERROR_MESSAGE(ER_OUTOFMEMORY, N_("Out of memory; restart server and try again (needed %lu bytes)"));
331
  ADD_ERROR_MESSAGE(ER_OUT_OF_SORTMEMORY, N_("Out of sort memory; increase server sort buffer size"));
332
  ADD_ERROR_MESSAGE(ER_OUT_OF_GLOBAL_SORTMEMORY, N_("Global sort memory constraint hit; increase sort-heap-threshold"));
333
  ADD_ERROR_MESSAGE(ER_OUT_OF_GLOBAL_JOINMEMORY, N_("Global join memory constraint hit; increase join-heap-threshold"));
334
  ADD_ERROR_MESSAGE(ER_OUT_OF_GLOBAL_READRNDMEMORY, N_("Global read_rnd memory constraint hit; increase read-rnd-heap-threshold"));
335
  ADD_ERROR_MESSAGE(ER_OUT_OF_GLOBAL_READMEMORY, N_("Global read memory constraint hit; increase read-buffer-threshold"));
336
  ADD_ERROR_MESSAGE(ER_UNEXPECTED_EOF, N_("Unexpected EOF found when reading file '%-.192s' (errno: %d)"));
337
  ADD_ERROR_MESSAGE(ER_CON_COUNT_ERROR, N_("Too many connections"));
338
  ADD_ERROR_MESSAGE(ER_OUT_OF_RESOURCES, N_("Out of memory; check if drizzled or some other process uses all available memory; if not, you may have to use 'ulimit' to allow drizzled to use more memory or you can add more swap space"));
339
  ADD_ERROR_MESSAGE(ER_BAD_HOST_ERROR, N_("Can't get hostname for your address"));
340
  ADD_ERROR_MESSAGE(ER_HANDSHAKE_ERROR, N_("Bad handshake"));
2159.2.8 by Brian Aker
Merge in fixes for error messages with privs.
341
342
  // Access error messages
343
  ADD_ERROR_MESSAGE(ER_DBACCESS_DENIED_ERROR, N_("Access denied for user '%s' to schema '%s'"));
344
  ADD_ERROR_MESSAGE(ER_TABLEACCESS_DENIED_ERROR, N_("Access denied for user '%s' to table '%s'"));
345
  ADD_ERROR_MESSAGE(ER_ACCESS_DENIED_ERROR, N_("Access denied for user '%s' (using password: %s)"));
346
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
347
  ADD_ERROR_MESSAGE(ER_NO_DB_ERROR, N_("No schema selected"));
348
  ADD_ERROR_MESSAGE(ER_UNKNOWN_COM_ERROR, N_("Unknown command"));
349
  ADD_ERROR_MESSAGE(ER_BAD_NULL_ERROR, N_("Column '%-.192s' cannot be null"));
350
  ADD_ERROR_MESSAGE(ER_BAD_DB_ERROR, N_("Unknown schema '%-.192s'"));
351
  ADD_ERROR_MESSAGE(ER_TABLE_EXISTS_ERROR, N_("Table '%-.192s' already exists"));
352
  ADD_ERROR_MESSAGE(ER_BAD_TABLE_ERROR, N_("Unknown table '%-.100s'"));
353
  ADD_ERROR_MESSAGE(ER_NON_UNIQ_ERROR, N_("Column '%-.192s' in %-.192s is ambiguous"));
354
  ADD_ERROR_MESSAGE(ER_SERVER_SHUTDOWN, N_("Server shutdown in progress"));
355
  ADD_ERROR_MESSAGE(ER_BAD_FIELD_ERROR, N_("Unknown column '%-.192s' in '%-.192s'"));
356
  ADD_ERROR_MESSAGE(ER_WRONG_FIELD_WITH_GROUP, N_("'%-.192s' isn't in GROUP BY"));
357
  ADD_ERROR_MESSAGE(ER_WRONG_GROUP_FIELD, N_("Can't group on '%-.192s'"));
358
  ADD_ERROR_MESSAGE(ER_WRONG_SUM_SELECT, N_("Statement has sum functions and columns in same statement"));
359
  ADD_ERROR_MESSAGE(ER_WRONG_VALUE_COUNT, N_("Column count doesn't match value count"));
360
  ADD_ERROR_MESSAGE(ER_TOO_LONG_IDENT, N_("Identifier name '%-.100s' is too long"));
361
  ADD_ERROR_MESSAGE(ER_DUP_FIELDNAME, N_("Duplicate column name '%-.192s'"));
362
  ADD_ERROR_MESSAGE(ER_DUP_KEYNAME, N_("Duplicate key name '%-.192s'"));
363
  ADD_ERROR_MESSAGE(ER_DUP_ENTRY, N_("Duplicate entry '%-.192s' for key %d"));
364
  ADD_ERROR_MESSAGE(ER_WRONG_FIELD_SPEC, N_("Incorrect column specifier for column '%-.192s'"));
365
  ADD_ERROR_MESSAGE(ER_PARSE_ERROR, N_("%s near '%-.80s' at line %d"));
2104.3.5 by Brian Aker
Fixed case where parser error message might be null.
366
  ADD_ERROR_MESSAGE(ER_PARSE_ERROR_UNKNOWN, N_("Parsing error near '%s'"));
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
367
  ADD_ERROR_MESSAGE(ER_EMPTY_QUERY, N_("Query was empty"));
368
  ADD_ERROR_MESSAGE(ER_NONUNIQ_TABLE, N_("Not unique table/alias: '%-.192s'"));
369
  ADD_ERROR_MESSAGE(ER_INVALID_DEFAULT, N_("Invalid default value for '%-.192s'"));
370
  ADD_ERROR_MESSAGE(ER_MULTIPLE_PRI_KEY, N_("Multiple primary key defined"));
371
  ADD_ERROR_MESSAGE(ER_TOO_MANY_KEYS, N_("Too many keys specified; max %d keys allowed"));
372
  ADD_ERROR_MESSAGE(ER_TOO_MANY_KEY_PARTS, N_("Too many key parts specified; max %d parts allowed"));
373
  ADD_ERROR_MESSAGE(ER_TOO_LONG_KEY, N_("Specified key was too long; max key length is %d bytes"));
374
  ADD_ERROR_MESSAGE(ER_KEY_COLUMN_DOES_NOT_EXITS, N_("Key column '%-.192s' doesn't exist in table"));
375
  ADD_ERROR_MESSAGE(ER_BLOB_USED_AS_KEY, N_("BLOB column '%-.192s' can't be used in key specification with the used table type"));
376
  ADD_ERROR_MESSAGE(ER_TOO_BIG_FIELDLENGTH, N_("Column length too big for column '%-.192s' (max = %d); use BLOB or TEXT instead"));
377
  ADD_ERROR_MESSAGE(ER_WRONG_AUTO_KEY, N_("Incorrect table definition; there can be only one auto column and it must be defined as a key"));
378
  ADD_ERROR_MESSAGE(ER_NORMAL_SHUTDOWN, N_("%s: Normal shutdown\n"));
379
  ADD_ERROR_MESSAGE(ER_GOT_SIGNAL, N_("%s: Got signal %d. Aborting!\n"));
380
  ADD_ERROR_MESSAGE(ER_SHUTDOWN_COMPLETE, N_("%s: Shutdown complete\n"));
381
  ADD_ERROR_MESSAGE(ER_FORCING_CLOSE, N_("%s: Forcing close of thread %" PRIu64 " user: '%-.48s'\n"));
382
  ADD_ERROR_MESSAGE(ER_IPSOCK_ERROR, N_("Can't create IP socket"));
383
  ADD_ERROR_MESSAGE(ER_NO_SUCH_INDEX, N_("Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table"));
384
  ADD_ERROR_MESSAGE(ER_WRONG_FIELD_TERMINATORS, N_("Field separator argument '%-.32s' with length '%d' is not what is expected; check the manual"));
385
  ADD_ERROR_MESSAGE(ER_BLOBS_AND_NO_TERMINATED, N_("You can't use fixed rowlength with BLOBs; please use 'fields terminated by'"));
386
  ADD_ERROR_MESSAGE(ER_TEXTFILE_NOT_READABLE, N_("The file '%-.128s' must be in the schema directory or be readable by all"));
387
  ADD_ERROR_MESSAGE(ER_FILE_EXISTS_ERROR, N_("File '%-.200s' already exists"));
388
  ADD_ERROR_MESSAGE(ER_LOAD_INFO, N_("Records: %ld  Deleted: %ld  Skipped: %ld  Warnings: %ld"));
389
  ADD_ERROR_MESSAGE(ER_WRONG_SUB_KEY, N_("Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys"));
390
  ADD_ERROR_MESSAGE(ER_CANT_REMOVE_ALL_FIELDS, N_("You can't delete all columns with ALTER TABLE; use DROP TABLE instead"));
391
  ADD_ERROR_MESSAGE(ER_CANT_DROP_FIELD_OR_KEY, N_("Can't DROP '%-.192s'; check that column/key exists"));
392
  ADD_ERROR_MESSAGE(ER_INSERT_INFO, N_("Records: %ld  Duplicates: %ld  Warnings: %ld"));
393
  ADD_ERROR_MESSAGE(ER_UPDATE_TABLE_USED, N_("You can't specify target table '%-.192s' for update in FROM clause"));
1963.2.1 by Brian Aker
Fixing up the kill function.
394
395
  // KILL session errors
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
396
  ADD_ERROR_MESSAGE(ER_NO_SUCH_THREAD, N_("Unknown session id: %lu"));
397
  ADD_ERROR_MESSAGE(ER_KILL_DENIED_ERROR, N_("You are not the owner of session %lu"));
398
  ADD_ERROR_MESSAGE(ER_KILL_DENY_SELF_ERROR, N_("You cannot kill the session you are connected from."));
399
400
401
  ADD_ERROR_MESSAGE(ER_NO_TABLES_USED, N_("No tables used"));
402
  ADD_ERROR_MESSAGE(ER_BLOB_CANT_HAVE_DEFAULT, N_("BLOB/TEXT column '%-.192s' can't have a default value"));
403
  ADD_ERROR_MESSAGE(ER_WRONG_DB_NAME, N_("Incorrect schema name '%-.100s'"));
404
  ADD_ERROR_MESSAGE(ER_WRONG_TABLE_NAME, N_("Incorrect table name '%-.100s'"));
405
  ADD_ERROR_MESSAGE(ER_TOO_BIG_SELECT, N_("The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay"));
406
  ADD_ERROR_MESSAGE(ER_UNKNOWN_ERROR, N_("Unknown error"));
407
  ADD_ERROR_MESSAGE(ER_UNKNOWN_PROCEDURE, N_("Unknown procedure '%-.192s'"));
408
  ADD_ERROR_MESSAGE(ER_WRONG_PARAMCOUNT_TO_PROCEDURE, N_("Incorrect parameter count to procedure '%-.192s'"));
409
  ADD_ERROR_MESSAGE(ER_UNKNOWN_TABLE, N_("Unknown table '%-.192s' in %-.32s"));
410
  ADD_ERROR_MESSAGE(ER_FIELD_SPECIFIED_TWICE, N_("Column '%-.192s' specified twice"));
411
  ADD_ERROR_MESSAGE(ER_INVALID_GROUP_FUNC_USE, N_("Invalid use of group function"));
412
  ADD_ERROR_MESSAGE(ER_UNSUPPORTED_EXTENSION, N_("Table '%-.192s' uses an extension that doesn't exist in this Drizzle version"));
413
  ADD_ERROR_MESSAGE(ER_TABLE_MUST_HAVE_COLUMNS, N_("A table must have at least 1 column"));
414
  ADD_ERROR_MESSAGE(ER_RECORD_FILE_FULL, N_("The table '%-.192s' is full"));
415
  ADD_ERROR_MESSAGE(ER_TOO_MANY_TABLES, N_("Too many tables; Drizzle can only use %d tables in a join"));
416
  ADD_ERROR_MESSAGE(ER_TOO_MANY_FIELDS, N_("Too many columns"));
417
  ADD_ERROR_MESSAGE(ER_TOO_BIG_ROWSIZE, N_("Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs"));
418
  ADD_ERROR_MESSAGE(ER_WRONG_OUTER_JOIN, N_("Cross dependency found in OUTER JOIN; examine your ON conditions"));
419
  ADD_ERROR_MESSAGE(ER_NULL_COLUMN_IN_INDEX, N_("Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler"));
420
  ADD_ERROR_MESSAGE(ER_PLUGIN_NO_PATHS, N_("No paths allowed for plugin library"));
421
  ADD_ERROR_MESSAGE(ER_PLUGIN_EXISTS, N_("Plugin '%-.192s' already exists"));
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
422
  ADD_ERROR_MESSAGE(ER_CANT_OPEN_LIBRARY, N_("Can't open shared library '%-.192s' (errno: %d %s)"));
423
  ADD_ERROR_MESSAGE(ER_CANT_FIND_DL_ENTRY, N_("Can't find symbol '%-.128s' in library '%s'"));
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
424
  ADD_ERROR_MESSAGE(ER_UPDATE_INFO, N_("Rows matched: %ld  Changed: %ld  Warnings: %ld"));
425
  ADD_ERROR_MESSAGE(ER_CANT_CREATE_THREAD, N_("Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug"));
426
  ADD_ERROR_MESSAGE(ER_WRONG_VALUE_COUNT_ON_ROW, N_("Column count doesn't match value count at row %ld"));
427
  ADD_ERROR_MESSAGE(ER_CANT_REOPEN_TABLE, N_("Can't reopen table: '%-.192s'"));
428
  ADD_ERROR_MESSAGE(ER_MIX_OF_GROUP_FUNC_AND_FIELDS, N_("Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause"));
429
  ADD_ERROR_MESSAGE(ER_SYNTAX_ERROR, N_("You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use"));
430
  ADD_ERROR_MESSAGE(ER_NET_PACKET_TOO_LARGE, N_("Got a packet bigger than 'max_allowed_packet' bytes"));
431
  ADD_ERROR_MESSAGE(ER_NET_PACKETS_OUT_OF_ORDER, N_("Got packets out of order"));
432
  ADD_ERROR_MESSAGE(ER_TABLE_CANT_HANDLE_BLOB, N_("The used table type doesn't support BLOB/TEXT columns"));
433
  ADD_ERROR_MESSAGE(ER_TABLE_CANT_HANDLE_AUTO_INCREMENT, N_("The used table type doesn't support AUTO_INCREMENT columns"));
434
  ADD_ERROR_MESSAGE(ER_WRONG_COLUMN_NAME, N_("Incorrect column name '%-.100s'"));
435
  ADD_ERROR_MESSAGE(ER_WRONG_KEY_COLUMN, N_("The used storage engine can't index column '%-.192s'"));
436
  ADD_ERROR_MESSAGE(ER_WRONG_MRG_TABLE, N_("Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist"));
437
  ADD_ERROR_MESSAGE(ER_DUP_UNIQUE, N_("Can't write, because of unique constraint, to table '%-.192s'"));
438
  ADD_ERROR_MESSAGE(ER_BLOB_KEY_WITHOUT_LENGTH, N_("BLOB/TEXT column '%-.192s' used in key specification without a key length"));
439
  ADD_ERROR_MESSAGE(ER_PRIMARY_CANT_HAVE_NULL, N_("All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead"));
440
  ADD_ERROR_MESSAGE(ER_TOO_MANY_ROWS, N_("Result consisted of more than one row"));
441
  ADD_ERROR_MESSAGE(ER_REQUIRES_PRIMARY_KEY, N_("This table type requires a primary key"));
442
  ADD_ERROR_MESSAGE(ER_KEY_DOES_NOT_EXITS, N_("Key '%-.192s' doesn't exist in table '%-.192s'"));
443
  ADD_ERROR_MESSAGE(ER_CHECK_NO_SUCH_TABLE, N_("Can't open table"));
444
  ADD_ERROR_MESSAGE(ER_CHECK_NOT_IMPLEMENTED, N_("The storage engine for the table doesn't support %s"));
445
  ADD_ERROR_MESSAGE(ER_ERROR_DURING_COMMIT, N_("Got error %d during COMMIT"));
446
  ADD_ERROR_MESSAGE(ER_ERROR_DURING_ROLLBACK, N_("Got error %d during ROLLBACK"));
1271.7.4 by Tim Penhey
Another incremental commit.
447
  // This is a very incorrect place to use the PRIi64 macro as the
448
  // program that looks over the source for the N_() macros does not
449
  // (obviously) do macro expansion, so the string is entirely wrong for
450
  // what it is trying to output for every language except english.
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
451
  ADD_ERROR_MESSAGE(ER_NEW_ABORTING_CONNECTION, N_("Aborted connection %"PRIi64" to db: '%-.192s' user: '%-.48s' host: '%-.64s' (%-.64s)"));
452
  ADD_ERROR_MESSAGE(ER_LOCK_OR_ACTIVE_TRANSACTION, N_("Can't execute the given command because you have active locked tables or an active transaction"));
453
  ADD_ERROR_MESSAGE(ER_UNKNOWN_SYSTEM_VARIABLE, N_("Unknown system variable '%-.64s'"));
454
  ADD_ERROR_MESSAGE(ER_CRASHED_ON_USAGE, N_("Table '%-.192s' is marked as crashed and should be repaired"));
455
  ADD_ERROR_MESSAGE(ER_CRASHED_ON_REPAIR, N_("Table '%-.192s' is marked as crashed and last (automatic?) repair failed"));
456
  ADD_ERROR_MESSAGE(ER_WARNING_NOT_COMPLETE_ROLLBACK, N_("Some non-transactional changed tables couldn't be rolled back"));
457
  ADD_ERROR_MESSAGE(ER_SET_CONSTANTS_ONLY, N_("You may only use constant expressions with SET"));
458
  ADD_ERROR_MESSAGE(ER_LOCK_WAIT_TIMEOUT, N_("Lock wait timeout exceeded; try restarting transaction"));
459
  ADD_ERROR_MESSAGE(ER_LOCK_TABLE_FULL, N_("The total number of locks exceeds the lock table size"));
460
  ADD_ERROR_MESSAGE(ER_READ_ONLY_TRANSACTION, N_("Update locks cannot be acquired during a READ UNCOMMITTED transaction"));
461
  ADD_ERROR_MESSAGE(ER_DROP_DB_WITH_READ_LOCK, N_("DROP DATABASE not allowed while thread is holding global read lock"));
462
  ADD_ERROR_MESSAGE(ER_WRONG_ARGUMENTS, N_("Incorrect arguments to %s"));
463
  ADD_ERROR_MESSAGE(ER_LOCK_DEADLOCK, N_("Deadlock found when trying to get lock; try restarting transaction"));
464
  ADD_ERROR_MESSAGE(ER_TABLE_CANT_HANDLE_FT, N_("The used table type doesn't support FULLTEXT indexes"));
465
  ADD_ERROR_MESSAGE(ER_CANNOT_ADD_FOREIGN, N_("Cannot add foreign key constraint"));
466
  ADD_ERROR_MESSAGE(ER_NO_REFERENCED_ROW, N_("Cannot add or update a child row: a foreign key constraint fails"));
467
  ADD_ERROR_MESSAGE(ER_ROW_IS_REFERENCED, N_("Cannot delete or update a parent row: a foreign key constraint fails"));
468
  ADD_ERROR_MESSAGE(ER_WRONG_USAGE, N_("Incorrect usage of %s and %s"));
469
  ADD_ERROR_MESSAGE(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT, N_("The used SELECT statements have a different number of columns"));
470
  ADD_ERROR_MESSAGE(ER_CANT_UPDATE_WITH_READLOCK, N_("Can't execute the query because you have a conflicting read lock"));
471
  ADD_ERROR_MESSAGE(ER_LOCAL_VARIABLE, N_("Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL"));
472
  ADD_ERROR_MESSAGE(ER_GLOBAL_VARIABLE, N_("Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL"));
473
  ADD_ERROR_MESSAGE(ER_NO_DEFAULT, N_("Variable '%-.64s' doesn't have a default value"));
474
  ADD_ERROR_MESSAGE(ER_WRONG_VALUE_FOR_VAR, N_("Variable '%-.64s' can't be set to the value of '%-.200s'"));
475
  ADD_ERROR_MESSAGE(ER_WRONG_TYPE_FOR_VAR, N_("Incorrect argument type to variable '%-.64s'"));
476
  ADD_ERROR_MESSAGE(ER_VAR_CANT_BE_READ, N_("Variable '%-.64s' can only be set, not read"));
477
  ADD_ERROR_MESSAGE(ER_CANT_USE_OPTION_HERE, N_("Incorrect usage/placement of '%s'"));
478
  ADD_ERROR_MESSAGE(ER_NOT_SUPPORTED_YET, N_("This version of Drizzle doesn't yet support '%s'"));
479
  ADD_ERROR_MESSAGE(ER_INCORRECT_GLOBAL_LOCAL_VAR, N_("Variable '%-.192s' is a %s variable"));
480
  ADD_ERROR_MESSAGE(ER_WRONG_FK_DEF, N_("Incorrect foreign key definition for '%-.192s': %s"));
481
  ADD_ERROR_MESSAGE(ER_KEY_REF_DO_NOT_MATCH_TABLE_REF, N_("Key reference and table reference don't match"));
482
  ADD_ERROR_MESSAGE(ER_OPERAND_COLUMNS, N_("Operand should contain %d column(s)"));
483
  ADD_ERROR_MESSAGE(ER_SUBQUERY_NO_1_ROW, N_("Subquery returns more than 1 row"));
484
  ADD_ERROR_MESSAGE(ER_AUTO_CONVERT, N_("Converting column '%s' from %s to %s"));
485
  ADD_ERROR_MESSAGE(ER_ILLEGAL_REFERENCE, N_("Reference '%-.64s' not supported (%s)"));
486
  ADD_ERROR_MESSAGE(ER_DERIVED_MUST_HAVE_ALIAS, N_("Every derived table must have its own alias"));
487
  ADD_ERROR_MESSAGE(ER_SELECT_REDUCED, N_("Select %u was reduced during optimization"));
488
  ADD_ERROR_MESSAGE(ER_TABLENAME_NOT_ALLOWED_HERE, N_("Table '%-.192s' from one of the SELECTs cannot be used in %-.32s"));
489
  ADD_ERROR_MESSAGE(ER_SPATIAL_CANT_HAVE_NULL, N_("All parts of a SPATIAL index must be NOT NULL"));
490
  ADD_ERROR_MESSAGE(ER_COLLATION_CHARSET_MISMATCH, N_("COLLATION '%s' is not valid for CHARACTER SET '%s'"));
491
  ADD_ERROR_MESSAGE(ER_TOO_BIG_FOR_UNCOMPRESS, N_("Uncompressed data size too large; the maximum size is %d (based on max_allowed_packet). The length of uncompressed data may also be corrupted."));
492
  ADD_ERROR_MESSAGE(ER_ZLIB_Z_MEM_ERROR, N_("ZLIB: Not enough memory"));
493
  ADD_ERROR_MESSAGE(ER_ZLIB_Z_BUF_ERROR, N_("ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)"));
494
  ADD_ERROR_MESSAGE(ER_ZLIB_Z_DATA_ERROR, N_("ZLIB: Input data corrupted"));
495
  ADD_ERROR_MESSAGE(ER_CUT_VALUE_GROUP_CONCAT, N_("%d line(s) were cut by GROUP_CONCAT()"));
496
  ADD_ERROR_MESSAGE(ER_WARN_TOO_FEW_RECORDS, N_("Row %ld doesn't contain data for all columns"));
497
  ADD_ERROR_MESSAGE(ER_WARN_TOO_MANY_RECORDS, N_("Row %ld was truncated; it contained more data than there were input columns"));
498
  ADD_ERROR_MESSAGE(ER_WARN_NULL_TO_NOTNULL, N_("Column set to default value; NULL supplied to NOT NULL column '%s' at row %ld"));
499
  ADD_ERROR_MESSAGE(ER_WARN_DATA_OUT_OF_RANGE, N_("Out of range value for column '%s' at row %ld"));
500
  ADD_ERROR_MESSAGE(ER_WARN_DATA_TRUNCATED, N_("Data truncated for column '%s' at row %ld"));
501
  ADD_ERROR_MESSAGE(ER_CANT_AGGREGATE_2COLLATIONS, N_("Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'"));
502
  ADD_ERROR_MESSAGE(ER_CANT_AGGREGATE_3COLLATIONS, N_("Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'"));
503
  ADD_ERROR_MESSAGE(ER_CANT_AGGREGATE_NCOLLATIONS, N_("Illegal mix of collations for operation '%s'"));
504
  ADD_ERROR_MESSAGE(ER_VARIABLE_IS_NOT_STRUCT, N_("Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)"));
505
  ADD_ERROR_MESSAGE(ER_UNKNOWN_COLLATION, N_("Unknown collation: '%-.64s'"));
506
  ADD_ERROR_MESSAGE(ER_WARN_FIELD_RESOLVED, N_("Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d"));
507
  ADD_ERROR_MESSAGE(ER_WRONG_NAME_FOR_INDEX, N_("Incorrect index name '%-.100s'"));
508
  ADD_ERROR_MESSAGE(ER_WRONG_NAME_FOR_CATALOG, N_("Incorrect catalog name '%-.100s'"));
509
  ADD_ERROR_MESSAGE(ER_BAD_FT_COLUMN, N_("Column '%-.192s' cannot be part of FULLTEXT index"));
510
  ADD_ERROR_MESSAGE(ER_UNKNOWN_STORAGE_ENGINE, N_("Unknown table engine '%s'"));
511
  ADD_ERROR_MESSAGE(ER_NON_UPDATABLE_TABLE, N_("The target table %-.100s of the %s is not updatable"));
512
  ADD_ERROR_MESSAGE(ER_FEATURE_DISABLED, N_("The '%s' feature is disabled; you need Drizzle built with '%s' to have it working"));
513
  ADD_ERROR_MESSAGE(ER_OPTION_PREVENTS_STATEMENT, N_("The Drizzle server is running with the %s option so it cannot execute this statement"));
514
  ADD_ERROR_MESSAGE(ER_DUPLICATED_VALUE_IN_TYPE, N_("Column '%-.100s' has duplicated value '%-.64s' in %s"));
515
  ADD_ERROR_MESSAGE(ER_TRUNCATED_WRONG_VALUE, N_("Truncated incorrect %-.32s value: '%-.128s'"));
516
  ADD_ERROR_MESSAGE(ER_TOO_MUCH_AUTO_TIMESTAMP_COLS, N_("Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause"));
517
  ADD_ERROR_MESSAGE(ER_INVALID_ON_UPDATE, N_("Invalid ON UPDATE clause for '%-.192s' column"));
518
  ADD_ERROR_MESSAGE(ER_GET_ERRMSG, N_("Got error %d '%-.100s' from %s"));
519
  ADD_ERROR_MESSAGE(ER_GET_TEMPORARY_ERRMSG, N_("Got temporary error %d '%-.100s' from %s"));
520
  ADD_ERROR_MESSAGE(ER_UNKNOWN_TIME_ZONE, N_("Unknown or incorrect time zone: '%-.64s'"));
521
  ADD_ERROR_MESSAGE(ER_INVALID_CHARACTER_STRING, N_("Invalid %s character string: '%.64s'"));
522
  ADD_ERROR_MESSAGE(ER_WARN_ALLOWED_PACKET_OVERFLOWED, N_("Result of %s() was larger than max_allowed_packet (%ld) - truncated"));
523
  ADD_ERROR_MESSAGE(ER_SP_DOES_NOT_EXIST, N_("%s %s does not exist"));
524
  ADD_ERROR_MESSAGE(ER_QUERY_INTERRUPTED, N_("Query execution was interrupted"));
525
  ADD_ERROR_MESSAGE(ER_VIEW_INVALID, N_("View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them"));
526
  ADD_ERROR_MESSAGE(ER_NO_DEFAULT_FOR_FIELD, N_("Field '%-.192s' doesn't have a default value"));
527
  ADD_ERROR_MESSAGE(ER_DIVISION_BY_ZERO, N_("Division by 0"));
528
  ADD_ERROR_MESSAGE(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, N_("Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %u"));
529
  ADD_ERROR_MESSAGE(ER_ILLEGAL_VALUE_FOR_TYPE, N_("Illegal %s '%-.192s' value found during parsing"));
530
  ADD_ERROR_MESSAGE(ER_KEY_PART_0, N_("Key part '%-.192s' length cannot be 0"));
531
  ADD_ERROR_MESSAGE(ER_XAER_RMFAIL, N_("XAER_RMFAIL: The command cannot be executed when global transaction is in the  %.64s state"));
532
  ADD_ERROR_MESSAGE(ER_DATA_TOO_LONG, N_("Data too long for column '%s' at row %ld"));
533
  ADD_ERROR_MESSAGE(ER_STARTUP, N_("%s: ready for connections.\nVersion: '%s' %s\n"));
534
  ADD_ERROR_MESSAGE(ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR, N_("Can't load value from file with fixed size rows to variable"));
535
  ADD_ERROR_MESSAGE(ER_WRONG_VALUE_FOR_TYPE, N_("Incorrect %-.32s value: '%-.128s' for function %-.32s"));
536
  ADD_ERROR_MESSAGE(ER_TABLE_DEF_CHANGED, N_("Table definition has changed, please retry transaction"));
537
  ADD_ERROR_MESSAGE(ER_SP_NO_RETSET, N_("Not allowed to return a result set from a %s"));
538
  ADD_ERROR_MESSAGE(ER_CANT_CREATE_GEOMETRY_OBJECT, N_("Cannot get geometry object from data you send to the GEOMETRY field"));
539
  ADD_ERROR_MESSAGE(ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, N_("Explicit or implicit commit is not allowed in stored function or trigger."));
540
  ADD_ERROR_MESSAGE(ER_TOO_BIG_SCALE, N_("Too big scale %d specified for column '%-.192s'. Maximum is %d."));
541
  ADD_ERROR_MESSAGE(ER_TOO_BIG_PRECISION, N_("Too big precision %d specified for column '%-.192s'. Maximum is %d."));
542
  ADD_ERROR_MESSAGE(ER_M_BIGGER_THAN_D, N_("For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s')."));
543
  ADD_ERROR_MESSAGE(ER_TRG_IN_WRONG_SCHEMA, N_("Trigger in wrong schema"));
544
  ADD_ERROR_MESSAGE(ER_STACK_OVERRUN_NEED_MORE, N_("Thread stack overrun:  %ld bytes used of a %ld byte stack, and %ld bytes needed.  Use 'drizzled -O thread_stack=#' to specify a bigger stack."));
545
  ADD_ERROR_MESSAGE(ER_TOO_BIG_DISPLAYWIDTH, N_("Display width out of range for column '%-.192s' (max = %d)"));
546
  ADD_ERROR_MESSAGE(ER_DATETIME_FUNCTION_OVERFLOW, N_("Datetime function: %-.32s field overflow"));
547
  ADD_ERROR_MESSAGE(ER_ROW_IS_REFERENCED_2, N_("Cannot delete or update a parent row: a foreign key constraint fails (%.192s)"));
548
  ADD_ERROR_MESSAGE(ER_NO_REFERENCED_ROW_2, N_("Cannot add or update a child row: a foreign key constraint fails (%.192s)"));
549
  ADD_ERROR_MESSAGE(ER_SP_FETCH_NO_DATA, N_("No data - zero rows fetched, selected, or processed"));
550
  ADD_ERROR_MESSAGE(ER_TABLE_NEEDS_UPGRADE, N_("Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" to fix it!"));
551
  ADD_ERROR_MESSAGE(ER_NON_GROUPING_FIELD_USED, N_("non-grouping field '%-.192s' is used in %-.64s clause"));
552
  ADD_ERROR_MESSAGE(ER_TABLE_CANT_HANDLE_SPKEYS, N_("The used table type doesn't support SPATIAL indexes"));
553
  ADD_ERROR_MESSAGE(ER_REMOVED_SPACES, N_("Leading spaces are removed from name '%s'"));
554
  ADD_ERROR_MESSAGE(ER_AUTOINC_READ_FAILED, N_("Failed to read auto-increment value from storage engine"));
555
  ADD_ERROR_MESSAGE(ER_WRONG_STRING_LENGTH, N_("String '%-.70s' is too long for %s (should be no longer than %d)"));
556
  ADD_ERROR_MESSAGE(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT, N_("Too high level of nesting for select"));
557
  ADD_ERROR_MESSAGE(ER_NAME_BECOMES_EMPTY, N_("Name '%-.64s' has become ''"));
558
  ADD_ERROR_MESSAGE(ER_AMBIGUOUS_FIELD_TERM, N_("First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY"));
559
  ADD_ERROR_MESSAGE(ER_ILLEGAL_HA_CREATE_OPTION, N_("Table storage engine '%-.64s' does not support the create option '%.64s'"));
560
  ADD_ERROR_MESSAGE(ER_INVALID_OPTION_VALUE, N_("Error setting %-.32s. Given value %-.128s %-.128s"));
561
  ADD_ERROR_MESSAGE(ER_WRONG_VALUE, N_("Incorrect %-.32s value: '%-.128s'"));
562
  ADD_ERROR_MESSAGE(ER_NO_PARTITION_FOR_GIVEN_VALUE, N_("Table has no partition for value %-.64s"));
563
  ADD_ERROR_MESSAGE(ER_BINLOG_ROW_LOGGING_FAILED, N_("Writing one row to the row-based binary log failed"));
564
  ADD_ERROR_MESSAGE(ER_DROP_INDEX_FK, N_("Cannot drop index '%-.192s': needed in a foreign key constraint"));
565
  ADD_ERROR_MESSAGE(ER_FOREIGN_DUPLICATE_KEY, N_("Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry"));
566
  ADD_ERROR_MESSAGE(ER_CANT_CHANGE_TX_ISOLATION, N_("Transaction isolation level can't be changed while a transaction is in progress"));
567
  ADD_ERROR_MESSAGE(ER_WRONG_PARAMCOUNT_TO_FUNCTION, N_("Incorrect parameter count in the call to native function '%-.192s'"));
568
  ADD_ERROR_MESSAGE(ER_WRONG_PARAMETERS_TO_NATIVE_FCT, N_("Incorrect parameters in the call to native function '%-.192s'"));
569
  ADD_ERROR_MESSAGE(ER_DUP_ENTRY_WITH_KEY_NAME, N_("Duplicate entry '%-.64s' for key '%-.192s'"));
570
  ADD_ERROR_MESSAGE(ER_LOAD_DATA_INVALID_COLUMN, N_("Invalid column reference (%-.64s) in LOAD DATA"));
2114.5.4 by Brian Aker
Fix error message on date.
571
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
572
  ADD_ERROR_MESSAGE(ER_INVALID_DATETIME_VALUE, N_("Received an invalid datetime value '%s'."));
2114.5.4 by Brian Aker
Fix error message on date.
573
  ADD_ERROR_MESSAGE(ER_INVALID_DATE_VALUE, N_("Received an invalid DATE value '%s'."));
574
  ADD_ERROR_MESSAGE(ER_INVALID_NULL_ARGUMENT, N_("Received a NULL argument for function '%s'."));
2069.2.4 by Brian Aker
Fix issue with return value from unix_timestamp(). Also clean up error
575
  ADD_ERROR_MESSAGE(ER_INVALID_TIMESTAMP_VALUE, N_("Received an invalid timestamp value '%s'."));
2114.5.3 by Brian Aker
fix test case along with the error message for TIME.
576
  ADD_ERROR_MESSAGE(ER_INVALID_TIME_VALUE, N_("Received an invalid TIME value '%s'."));
2114.5.4 by Brian Aker
Fix error message on date.
577
  ADD_ERROR_MESSAGE(ER_INVALID_UNIX_TIMESTAMP_VALUE, N_("Received an invalid value '%s' for a UNIX timestamp."));
578
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
579
  ADD_ERROR_MESSAGE(ER_ARGUMENT_OUT_OF_RANGE, N_("Received an out-of-range argument '%s' for function '%s'."));
580
  ADD_ERROR_MESSAGE(ER_INVALID_ENUM_VALUE, N_("Received an invalid enum value '%s'."));
581
  ADD_ERROR_MESSAGE(ER_NO_PRIMARY_KEY_ON_REPLICATED_TABLE, N_("Tables which are replicated require a primary key."));
2017.2.1 by Brian Aker
Cleanup error messages around bad table definitions.
582
2068.7.6 by Brian Aker
Fix interface for create table such that it issues error and returns state
583
  ADD_ERROR_MESSAGE(ER_CORRUPT_SCHEMA_DEFINITION, N_("Corrupt or invalid schema definition for '%s' : %s"));
584
  ADD_ERROR_MESSAGE(ER_CORRUPT_TABLE_DEFINITION, N_("Corrupt or invalid table definition for '%s': %s"));
585
  ADD_ERROR_MESSAGE(ER_CORRUPT_TABLE_DEFINITION_ENUM, N_("The number of enum that were required was too high for table '%s'"));
586
  ADD_ERROR_MESSAGE(ER_CORRUPT_TABLE_DEFINITION_UNKNOWN, N_("Corrupt or invalid table definition for '%s'"));
2017.2.1 by Brian Aker
Cleanup error messages around bad table definitions.
587
  ADD_ERROR_MESSAGE(ER_CORRUPT_TABLE_DEFINITION_UNKNOWN_COLLATION, N_("Collation '%s' for table %s is invalid/unknown"));
588
2041.3.7 by Brian Aker
Cleanup for error, there is still a failure of all temp tables being closed
589
  ADD_ERROR_MESSAGE(ER_TABLE_DROP, N_("Cannot drop table '%s'"));
2068.7.1 by Brian Aker
First pass through error correction in SE interface for drop table.
590
  ADD_ERROR_MESSAGE(ER_TABLE_DROP_ERROR_OCCURRED, N_("Error occurred while dropping table '%s'"));
591
  ADD_ERROR_MESSAGE(ER_TABLE_PERMISSION_DENIED, N_("Permission denied to create '%s'"));
2079.3.1 by Brian Aker
Rework the CREATE TABLE LIKE call.
592
  ADD_ERROR_MESSAGE(ER_TABLE_UNKNOWN, N_("Unknown table '%s'"));
2041.3.7 by Brian Aker
Cleanup for error, there is still a failure of all temp tables being closed
593
2126.2.1 by Brian Aker
Merge in changes for catalogs usage of constants for identifier.
594
  ADD_ERROR_MESSAGE(ER_SCHEMA_CANNOT_CREATE, N_("Cannot create schema '%s'"));
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
595
  ADD_ERROR_MESSAGE(ER_SCHEMA_DOES_NOT_EXIST, N_("Schema does not exist: %s"));
596
  ADD_ERROR_MESSAGE(ER_ALTER_SCHEMA, N_("Error altering schema: %s"));
597
  ADD_ERROR_MESSAGE(ER_DROP_SCHEMA, +N_("Error droppping Schema : %s"));
2126.2.1 by Brian Aker
Merge in changes for catalogs usage of constants for identifier.
598
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
599
  ADD_ERROR_MESSAGE(ER_USE_SQL_BIG_RESULT, N_("Temporary table too large, rerun with SQL_BIG_RESULT."));
600
  ADD_ERROR_MESSAGE(ER_UNKNOWN_ENGINE_OPTION, N_("Unknown table engine option key/pair %s = %s."));
601
  ADD_ERROR_MESSAGE(ER_UNKNOWN_SCHEMA_OPTION, N_("Unknown schema engine option key/pair %s = %s."));
2141.4.2 by Andrew Hutchings
Implicit joins of the form "SELECT * FROM t1, t2" without WHERE or ON now error.
602
  ADD_ERROR_MESSAGE(ER_CARTESIAN_JOIN_ATTEMPTED, N_("Implicit cartesian join attempted."));
1960.2.14 by Andrew Hutchings
Merge trunk into branch
603
  ADD_ERROR_MESSAGE(ER_ADMIN_ACCESS, N_("Admin access not allowed from this username/IP address."));
1271.7.4 by Tim Penhey
Another incremental commit.
604
1933.1.3 by Brian Aker
First pass though barriers.
605
  // User lock/barrier error messages
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
606
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_CANT_WAIT_ON_OWN_BARRIER, N_("wait() can not be called on session owning user defined barrier."));
607
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_UNKNOWN_BARRIER, N_("Unknown user defined barrier requested."));
608
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_NOT_OWNER_OF_BARRIER, N_("Session does not own user defined barrier."));
609
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_CANT_WAIT_ON_OWN_LOCK, N_("Session can not wait on a user defined lock owned by the session."));
610
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_NOT_OWNER_OF_LOCK, N_("Session does not own user defined lock."));
611
612
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_INVALID_NAME_BARRIER, N_("Invalid name for user defined barrier."));
613
  ADD_ERROR_MESSAGE(ER_USER_LOCKS_INVALID_NAME_LOCK, N_("Invalid name for user defined lock."));
614
615
  ADD_ERROR_MESSAGE(ER_INVALID_ALTER_TABLE_FOR_NOT_NULL, N_("Either a DEFAULt value or NULL NULL description is required for a new column if table is not empty"));
616
2015.1.3 by Brian Aker
Merge in CAST operators for SIGNED/UNSIGNED
617
  // Cast errors
618
  ADD_ERROR_MESSAGE(ER_INVALID_CAST_TO_UNSIGNED, N_("Cast to unsigned converted negative integer to it's positive complement: %s"));
619
  ADD_ERROR_MESSAGE(ER_INVALID_CAST_TO_SIGNED, N_("Invalid cast to signed integer: %s"));
620
2029.1.26 by Brian Aker
Merge in work for reserved words in SQL standard.
621
  ADD_ERROR_MESSAGE(ER_SQL_KEYWORD, N_("Identifier '%.*s' is a SQL keyword."));
622
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
623
624
  ADD_ERROR_MESSAGE(EE_CANTUNLOCK, N_("Can't unlock file (Errcode: %d)"));
625
  ADD_ERROR_MESSAGE(EE_CANT_CHSIZE, N_("Can't change size of file (Errcode: %d)"));
626
  ADD_ERROR_MESSAGE(EE_CANT_OPEN_STREAM, N_("Can't open stream from handle (Errcode: %d)"));
627
  ADD_ERROR_MESSAGE(EE_LINK_WARNING, N_("Warning: '%s' had %d links"));
628
  ADD_ERROR_MESSAGE(EE_OPEN_WARNING, N_("Warning: %d files and %d streams is left open\n"));
629
  ADD_ERROR_MESSAGE(EE_CANT_MKDIR, N_("Can't create directory '%s' (Errcode: %d)"));
630
  ADD_ERROR_MESSAGE(EE_UNKNOWN_CHARSET, N_("Character set '%s' is not a compiled character set and is not specified in the %s file"));
631
  ADD_ERROR_MESSAGE(EE_OUT_OF_FILERESOURCES, N_("Out of resources when opening file '%s' (Errcode: %d)"));
632
  ADD_ERROR_MESSAGE(EE_CANT_READLINK, N_("Can't read value for symlink '%s' (Error %d)"));
633
  ADD_ERROR_MESSAGE(EE_CANT_SYMLINK, N_("Can't create symlink '%s' pointing at '%s' (Error %d)"));
634
  ADD_ERROR_MESSAGE(EE_REALPATH, N_("Error on realpath() on '%s' (Error %d)"));
635
  ADD_ERROR_MESSAGE(EE_SYNC, N_("Can't sync file '%s' to disk (Errcode: %d)"));
636
  ADD_ERROR_MESSAGE(EE_UNKNOWN_COLLATION, N_("Collation '%s' is not a compiled collation and is not specified in the %s file"));
637
  ADD_ERROR_MESSAGE(EE_FILE_NOT_CLOSED, N_("File '%s' (fileno: %d) was not closed"));
1271.7.4 by Tim Penhey
Another incremental commit.
638
1996.2.1 by Brian Aker
uuid type code.
639
  // For UUID type
1999.1.2 by Brian Aker
Fix compile issue because of new error messages.
640
  ADD_ERROR_MESSAGE(ER_INVALID_UUID_VALUE, N_("Received an invalid UUID value"));
641
  ADD_ERROR_MESSAGE(ER_INVALID_UUID_TIME, N_("The UUID was not created with a valid time"));
1996.2.1 by Brian Aker
uuid type code.
642
2023.2.1 by Brian Aker
Merge in BOOL type.
643
  // For BOOL type
2023.2.2 by Brian Aker
Merge in BOOL change to BOOLEAN.
644
  ADD_ERROR_MESSAGE(ER_INVALID_BOOLEAN_VALUE, N_("Received an invalid BOOLEAN value '%s'."));
2023.2.4 by Brian Aker
Merge in cast() for BOOLEAN.
645
  ADD_ERROR_MESSAGE(ER_INVALID_CAST_TO_BOOLEAN, N_("Invalid cast to BOOLEAN: '%s'."));
2023.2.1 by Brian Aker
Merge in BOOL type.
646
1890.2.2 by Stewart Smith
merge trunk
647
  // Transactional DDL
648
  ADD_ERROR_MESSAGE(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, N_("Transactional DDL not supported"));
2039.3.1 by Brian Aker
Create a user available assert() function.
649
  // ASSERT Message
2039.3.2 by Brian Aker
Update assert() to display what was being evaluated.
650
  ADD_ERROR_MESSAGE(ER_ASSERT, N_("Assertion '%s' failed."));
651
  ADD_ERROR_MESSAGE(ER_ASSERT_NULL, N_("Assertion '%s' failed, the result was NULL."));
2039.3.1 by Brian Aker
Create a user available assert() function.
652
1271.7.4 by Tim Penhey
Another incremental commit.
653
  // Some old error values use the same strings as some new error values.
1996.3.1 by Monty Taylor
Add error code name into ErrorMap.
654
  ADD_ERROR_MESSAGE(EE_FILENOTFOUND, find(ER_FILE_NOT_FOUND));
655
  ADD_ERROR_MESSAGE(EE_CANTCREATEFILE, find(ER_CANT_CREATE_FILE));
656
  ADD_ERROR_MESSAGE(EE_READ, find(ER_ERROR_ON_READ));
657
  ADD_ERROR_MESSAGE(EE_WRITE, find(ER_ERROR_ON_WRITE));
658
  ADD_ERROR_MESSAGE(EE_BADCLOSE, find(ER_ERROR_ON_CLOSE));
659
  ADD_ERROR_MESSAGE(EE_OUTOFMEMORY, find(ER_OUTOFMEMORY));
660
  ADD_ERROR_MESSAGE(EE_DELETE, find(ER_CANT_DELETE_FILE));
661
  ADD_ERROR_MESSAGE(EE_LINK, find(ER_ERROR_ON_RENAME));
662
  ADD_ERROR_MESSAGE(EE_EOFERR, find(ER_UNEXPECTED_EOF));
663
  ADD_ERROR_MESSAGE(EE_CANTLOCK, find(ER_CANT_LOCK));
664
  ADD_ERROR_MESSAGE(EE_DIR, find(ER_CANT_READ_DIR));
665
  ADD_ERROR_MESSAGE(EE_STAT, find(ER_CANT_GET_STAT));
666
  ADD_ERROR_MESSAGE(EE_DISK_FULL, find(ER_DISK_FULL));
2017.3.1 by Brian Aker
Merge catalog with current trunk.
667
  
668
  // Catalog related errors
2039.6.2 by Brian Aker
Update code to test/handle conflicting create/drop schema.
669
  ADD_ERROR_MESSAGE(ER_CATALOG_CANNOT_CREATE, N_("Cannot create catalog '%s'."));
2073.1.2 by Brian Aker
Basic DDL for catalog.
670
  ADD_ERROR_MESSAGE(ER_CATALOG_CANNOT_CREATE_PERMISSION, N_("Permission is denied to create '%s' catalog."));
2039.6.2 by Brian Aker
Update code to test/handle conflicting create/drop schema.
671
  ADD_ERROR_MESSAGE(ER_CATALOG_CANNOT_DROP, N_("Cannot drop catalog '%s'."));
2073.1.2 by Brian Aker
Basic DDL for catalog.
672
  ADD_ERROR_MESSAGE(ER_CATALOG_CANNOT_DROP_PERMISSION, N_("Permission is denied to drop '%s' catalog."));
673
  ADD_ERROR_MESSAGE(ER_CATALOG_DOES_NOT_EXIST, N_("Catalog '%s' does not exist."));
674
  ADD_ERROR_MESSAGE(ER_CATALOG_NO_DROP_LOCAL, N_("You cannot drop the 'local' catalog."));
2039.6.2 by Brian Aker
Update code to test/handle conflicting create/drop schema.
675
  ADD_ERROR_MESSAGE(ER_CATALOG_NO_LOCK, N_("Could not gain lock on '%s'."));
2073.1.2 by Brian Aker
Basic DDL for catalog.
676
  ADD_ERROR_MESSAGE(ER_CORRUPT_CATALOG_DEFINITION, N_("Corrupt or invalid catalog definition for '%s' : '%s'."));
677
  ADD_ERROR_MESSAGE(ER_WRONG_NAME_FOR_CATALOG, N_("Invalid catalog name."));
2131.3.1 by Andrew Hutchings
Add error telling the user to use data_dictionary for SHOW engine_name STATUS
678
  ADD_ERROR_MESSAGE(ER_USE_DATA_DICTIONARY, N_("Engine status is now stored in the data_dictionary tables, please use these instead."));
2131.9.1 by Stewart Smith
on START TRANSACTION being called during a transaction, output a warning that a transaction is already in progress. This is the same behaviour as PostgreSQL. We used to do an implicit commit. This is totally not the right thing to do.
679
  ADD_ERROR_MESSAGE(ER_TRANSACTION_ALREADY_STARTED, N_("There is already a transaction in progress"));
2196.2.2 by Stewart Smith
add ER_NO_LOCK_HELD error code, and expect it in case of UNLOCK TABLES without any locks held.
680
  ADD_ERROR_MESSAGE(ER_NO_LOCK_HELD, N_("No lock is held by this connection."));
1271.7.4 by Tim Penhey
Another incremental commit.
681
}
1271.5.7 by Monty Taylor
Merged up with trunk.
682
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
683
} /* namespace drizzled */