errmsg.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* Copyright (C) 2000 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. /* Error messages for MySQL clients */
  13. /* (Error messages for the daemon are in sql/share/errmsg.txt) */
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. void init_client_errs(void);
  18. void finish_client_errs(void);
  19. extern const char *client_errors[]; /* Error messages */
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #define CR_MIN_ERROR 2000 /* For easier client code */
  24. #define CR_MAX_ERROR 2999
  25. #if !defined(ER)
  26. #define ER(X) client_errors[(X)-CR_MIN_ERROR]
  27. #endif
  28. #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
  29. /* Do not add error numbers before CR_ERROR_FIRST. */
  30. /* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
  31. #define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
  32. #define CR_UNKNOWN_ERROR 2000
  33. #define CR_SOCKET_CREATE_ERROR 2001
  34. #define CR_CONNECTION_ERROR 2002
  35. #define CR_CONN_HOST_ERROR 2003
  36. #define CR_IPSOCK_ERROR 2004
  37. #define CR_UNKNOWN_HOST 2005
  38. #define CR_SERVER_GONE_ERROR 2006
  39. #define CR_VERSION_ERROR 2007
  40. #define CR_OUT_OF_MEMORY 2008
  41. #define CR_WRONG_HOST_INFO 2009
  42. #define CR_LOCALHOST_CONNECTION 2010
  43. #define CR_TCP_CONNECTION 2011
  44. #define CR_SERVER_HANDSHAKE_ERR 2012
  45. #define CR_SERVER_LOST 2013
  46. #define CR_COMMANDS_OUT_OF_SYNC 2014
  47. #define CR_NAMEDPIPE_CONNECTION 2015
  48. #define CR_NAMEDPIPEWAIT_ERROR 2016
  49. #define CR_NAMEDPIPEOPEN_ERROR 2017
  50. #define CR_NAMEDPIPESETSTATE_ERROR 2018
  51. #define CR_CANT_READ_CHARSET 2019
  52. #define CR_NET_PACKET_TOO_LARGE 2020
  53. #define CR_EMBEDDED_CONNECTION 2021
  54. #define CR_PROBE_SLAVE_STATUS 2022
  55. #define CR_PROBE_SLAVE_HOSTS 2023
  56. #define CR_PROBE_SLAVE_CONNECT 2024
  57. #define CR_PROBE_MASTER_CONNECT 2025
  58. #define CR_SSL_CONNECTION_ERROR 2026
  59. #define CR_MALFORMED_PACKET 2027
  60. #define CR_WRONG_LICENSE 2028
  61. /* new 4.1 error codes */
  62. #define CR_NULL_POINTER 2029
  63. #define CR_NO_PREPARE_STMT 2030
  64. #define CR_PARAMS_NOT_BOUND 2031
  65. #define CR_DATA_TRUNCATED 2032
  66. #define CR_NO_PARAMETERS_EXISTS 2033
  67. #define CR_INVALID_PARAMETER_NO 2034
  68. #define CR_INVALID_BUFFER_USE 2035
  69. #define CR_UNSUPPORTED_PARAM_TYPE 2036
  70. #define CR_SHARED_MEMORY_CONNECTION 2037
  71. #define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
  72. #define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
  73. #define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
  74. #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
  75. #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
  76. #define CR_SHARED_MEMORY_MAP_ERROR 2043
  77. #define CR_SHARED_MEMORY_EVENT_ERROR 2044
  78. #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
  79. #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
  80. #define CR_CONN_UNKNOW_PROTOCOL 2047
  81. #define CR_INVALID_CONN_HANDLE 2048
  82. #define CR_SECURE_AUTH 2049
  83. #define CR_FETCH_CANCELED 2050
  84. #define CR_NO_DATA 2051
  85. #define CR_NO_STMT_METADATA 2052
  86. #define CR_NO_RESULT_SET 2053
  87. #define CR_NOT_IMPLEMENTED 2054
  88. #define CR_SERVER_LOST_EXTENDED 2055
  89. #define CR_STMT_CLOSED 2056
  90. #define CR_NEW_STMT_METADATA 2057
  91. #define CR_ERROR_LAST /*Copy last error nr:*/ 2057
  92. /* Add error numbers before CR_ERROR_LAST and change it accordingly. */