errmsg.h 4.7 KB

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