~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/ha_commands.cc

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
35
35
#include "drizzled/lock.h"
36
36
#include "drizzled/item/int.h"
37
37
#include "drizzled/item/empty_string.h"
38
 
#include "drizzled/field/epoch.h"
 
38
#include "drizzled/field/timestamp.h"
39
39
#include "drizzled/plugin/client.h"
40
40
#include "drizzled/internal/my_sys.h"
41
41
 
59
59
void ha_init_errors(void)
60
60
{
61
61
  // Set the dedicated error messages.
62
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_KEY_NOT_FOUND,          ER(ER_KEY_NOT_FOUND));
63
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_FOUND_DUPP_KEY,         ER(ER_DUP_KEY));
64
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_RECORD_CHANGED,         "Update wich is recoverable");
65
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_WRONG_INDEX,            "Wrong index given to function");
66
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_CRASHED,                ER(ER_NOT_KEYFILE));
67
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_WRONG_IN_RECORD,        ER(ER_CRASHED_ON_USAGE));
68
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_OUT_OF_MEM,             "Table Cursor out of memory");
69
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NOT_A_TABLE,            "Incorrect file format '%.64s'");
70
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_WRONG_COMMAND,          "Command not supported");
71
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_OLD_FILE,               ER(ER_OLD_KEYFILE));
72
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NO_ACTIVE_RECORD,       "No record read in update");
73
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_RECORD_DELETED,         "Intern record deleted");
74
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_RECORD_FILE_FULL,       ER(ER_RECORD_FILE_FULL));
75
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_INDEX_FILE_FULL,        "No more room in index file '%.64s'");
76
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_END_OF_FILE,            "End in next/prev/first/last");
77
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_UNSUPPORTED,            ER(ER_ILLEGAL_HA));
78
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_TO_BIG_ROW,             "Too big row");
79
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_WRONG_CREATE_OPTION,        "Wrong create option");
80
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_FOUND_DUPP_UNIQUE,      ER(ER_DUP_UNIQUE));
81
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_UNKNOWN_CHARSET,        "Can't open charset");
82
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_WRONG_MRG_TABLE_DEF,    ER(ER_WRONG_MRG_TABLE));
83
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_CRASHED_ON_REPAIR,      ER(ER_CRASHED_ON_REPAIR));
84
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_CRASHED_ON_USAGE,       ER(ER_CRASHED_ON_USAGE));
85
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_LOCK_WAIT_TIMEOUT,      ER(ER_LOCK_WAIT_TIMEOUT));
86
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_LOCK_TABLE_FULL,        ER(ER_LOCK_TABLE_FULL));
87
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_READ_ONLY_TRANSACTION,  ER(ER_READ_ONLY_TRANSACTION));
88
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_LOCK_DEADLOCK,          ER(ER_LOCK_DEADLOCK));
89
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_CANNOT_ADD_FOREIGN,     ER(ER_CANNOT_ADD_FOREIGN));
90
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NO_REFERENCED_ROW,      ER(ER_NO_REFERENCED_ROW_2));
91
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_ROW_IS_REFERENCED,      ER(ER_ROW_IS_REFERENCED_2));
92
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NO_SAVEPOINT,           "No savepoint with that name");
93
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NON_UNIQUE_BLOCK_SIZE,  "Non unique key block size");
94
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NO_SUCH_TABLE,          "No such table: '%.64s'");
95
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_TABLE_EXIST,            ER(ER_TABLE_EXISTS_ERROR));
96
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_NO_CONNECTION,          "Could not connect to storage engine");
97
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_TABLE_DEF_CHANGED,      ER(ER_TABLE_DEF_CHANGED));
98
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_FOREIGN_DUPLICATE_KEY,  "FK constraint would lead to duplicate key");
99
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_TABLE_NEEDS_UPGRADE,    ER(ER_TABLE_NEEDS_UPGRADE));
100
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_TABLE_READONLY,         ER(ER_OPEN_AS_READONLY));
101
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_AUTOINC_READ_FAILED,    ER(ER_AUTOINC_READ_FAILED));
102
 
  DRIZZLE_ADD_ERROR_MESSAGE(HA_ERR_AUTOINC_ERANGE,         ER(ER_WARN_DATA_OUT_OF_RANGE));
 
62
  add_error_message(HA_ERR_KEY_NOT_FOUND,          ER(ER_KEY_NOT_FOUND));
 
63
  add_error_message(HA_ERR_FOUND_DUPP_KEY,         ER(ER_DUP_KEY));
 
64
  add_error_message(HA_ERR_RECORD_CHANGED,         "Update wich is recoverable");
 
65
  add_error_message(HA_ERR_WRONG_INDEX,            "Wrong index given to function");
 
66
  add_error_message(HA_ERR_CRASHED,                ER(ER_NOT_KEYFILE));
 
67
  add_error_message(HA_ERR_WRONG_IN_RECORD,        ER(ER_CRASHED_ON_USAGE));
 
68
  add_error_message(HA_ERR_OUT_OF_MEM,             "Table Cursor out of memory");
 
69
  add_error_message(HA_ERR_NOT_A_TABLE,            "Incorrect file format '%.64s'");
 
70
  add_error_message(HA_ERR_WRONG_COMMAND,          "Command not supported");
 
71
  add_error_message(HA_ERR_OLD_FILE,               ER(ER_OLD_KEYFILE));
 
72
  add_error_message(HA_ERR_NO_ACTIVE_RECORD,       "No record read in update");
 
73
  add_error_message(HA_ERR_RECORD_DELETED,         "Intern record deleted");
 
74
  add_error_message(HA_ERR_RECORD_FILE_FULL,       ER(ER_RECORD_FILE_FULL));
 
75
  add_error_message(HA_ERR_INDEX_FILE_FULL,        "No more room in index file '%.64s'");
 
76
  add_error_message(HA_ERR_END_OF_FILE,            "End in next/prev/first/last");
 
77
  add_error_message(HA_ERR_UNSUPPORTED,            ER(ER_ILLEGAL_HA));
 
78
  add_error_message(HA_ERR_TO_BIG_ROW,             "Too big row");
 
79
  add_error_message(HA_WRONG_CREATE_OPTION,        "Wrong create option");
 
80
  add_error_message(HA_ERR_FOUND_DUPP_UNIQUE,      ER(ER_DUP_UNIQUE));
 
81
  add_error_message(HA_ERR_UNKNOWN_CHARSET,        "Can't open charset");
 
82
  add_error_message(HA_ERR_WRONG_MRG_TABLE_DEF,    ER(ER_WRONG_MRG_TABLE));
 
83
  add_error_message(HA_ERR_CRASHED_ON_REPAIR,      ER(ER_CRASHED_ON_REPAIR));
 
84
  add_error_message(HA_ERR_CRASHED_ON_USAGE,       ER(ER_CRASHED_ON_USAGE));
 
85
  add_error_message(HA_ERR_LOCK_WAIT_TIMEOUT,      ER(ER_LOCK_WAIT_TIMEOUT));
 
86
  add_error_message(HA_ERR_LOCK_TABLE_FULL,        ER(ER_LOCK_TABLE_FULL));
 
87
  add_error_message(HA_ERR_READ_ONLY_TRANSACTION,  ER(ER_READ_ONLY_TRANSACTION));
 
88
  add_error_message(HA_ERR_LOCK_DEADLOCK,          ER(ER_LOCK_DEADLOCK));
 
89
  add_error_message(HA_ERR_CANNOT_ADD_FOREIGN,     ER(ER_CANNOT_ADD_FOREIGN));
 
90
  add_error_message(HA_ERR_NO_REFERENCED_ROW,      ER(ER_NO_REFERENCED_ROW_2));
 
91
  add_error_message(HA_ERR_ROW_IS_REFERENCED,      ER(ER_ROW_IS_REFERENCED_2));
 
92
  add_error_message(HA_ERR_NO_SAVEPOINT,           "No savepoint with that name");
 
93
  add_error_message(HA_ERR_NON_UNIQUE_BLOCK_SIZE,  "Non unique key block size");
 
94
  add_error_message(HA_ERR_NO_SUCH_TABLE,          "No such table: '%.64s'");
 
95
  add_error_message(HA_ERR_TABLE_EXIST,            ER(ER_TABLE_EXISTS_ERROR));
 
96
  add_error_message(HA_ERR_NO_CONNECTION,          "Could not connect to storage engine");
 
97
  add_error_message(HA_ERR_TABLE_DEF_CHANGED,      ER(ER_TABLE_DEF_CHANGED));
 
98
  add_error_message(HA_ERR_FOREIGN_DUPLICATE_KEY,  "FK constraint would lead to duplicate key");
 
99
  add_error_message(HA_ERR_TABLE_NEEDS_UPGRADE,    ER(ER_TABLE_NEEDS_UPGRADE));
 
100
  add_error_message(HA_ERR_TABLE_READONLY,         ER(ER_OPEN_AS_READONLY));
 
101
  add_error_message(HA_ERR_AUTOINC_READ_FAILED,    ER(ER_AUTOINC_READ_FAILED));
 
102
  add_error_message(HA_ERR_AUTOINC_ERANGE,         ER(ER_WARN_DATA_OUT_OF_RANGE));
103
103
}
104
104
 
105
105
} /* namespace drizzled */