errmsg.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
  2. 2012-2016 SkySQL AB, MariaDB Corporation AB
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with this library; if not, write to the Free
  13. Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  14. MA 02111-1301, USA */
  15. /* Error messages for mysql clients */
  16. /* error messages for the demon is in share/language/errmsg.sys */
  17. #ifndef _errmsg_h_
  18. #define _errmsg_h_
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. void init_client_errs(void);
  23. extern const char *client_errors[]; /* Error messages */
  24. extern const char *mariadb_client_errors[]; /* Error messages */
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #define CR_MIN_ERROR 2000 /* For easier client code */
  29. #define CR_MAX_ERROR 2999
  30. #define CER_MIN_ERROR 5000
  31. #define CER_MAX_ERROR 5999
  32. #define CER(X) mariadb_client_errors[(X)-CER_MIN_ERROR]
  33. #define ER(X) client_errors[(X)-CR_MIN_ERROR]
  34. #define CLIENT_ERRMAP 2 /* Errormap used by ma_error() */
  35. #define CR_UNKNOWN_ERROR 2000
  36. #define CR_SOCKET_CREATE_ERROR 2001
  37. #define CR_CONNECTION_ERROR 2002
  38. #define CR_CONN_HOST_ERROR 2003 /* never sent to a client, message only */
  39. #define CR_IPSOCK_ERROR 2004
  40. #define CR_UNKNOWN_HOST 2005
  41. #define CR_SERVER_GONE_ERROR 2006 /* disappeared _between_ queries */
  42. #define CR_VERSION_ERROR 2007
  43. #define CR_OUT_OF_MEMORY 2008
  44. #define CR_WRONG_HOST_INFO 2009
  45. #define CR_LOCALHOST_CONNECTION 2010
  46. #define CR_TCP_CONNECTION 2011
  47. #define CR_SERVER_HANDSHAKE_ERR 2012
  48. #define CR_SERVER_LOST 2013 /* disappeared _during_ a query */
  49. #define CR_COMMANDS_OUT_OF_SYNC 2014
  50. #define CR_NAMEDPIPE_CONNECTION 2015
  51. #define CR_NAMEDPIPEWAIT_ERROR 2016
  52. #define CR_NAMEDPIPEOPEN_ERROR 2017
  53. #define CR_NAMEDPIPESETSTATE_ERROR 2018
  54. #define CR_CANT_READ_CHARSET 2019
  55. #define CR_NET_PACKET_TOO_LARGE 2020
  56. #define CR_SSL_CONNECTION_ERROR 2026
  57. #define CR_MALFORMED_PACKET 2027
  58. #define CR_NO_PREPARE_STMT 2030
  59. #define CR_PARAMS_NOT_BOUND 2031
  60. #define CR_INVALID_PARAMETER_NO 2034
  61. #define CR_INVALID_BUFFER_USE 2035
  62. #define CR_UNSUPPORTED_PARAM_TYPE 2036
  63. #define CR_SHARED_MEMORY_CONNECTION 2037
  64. #define CR_SHARED_MEMORY_CONNECT_ERROR 2038
  65. #define CR_CONN_UNKNOWN_PROTOCOL 2047
  66. #define CR_SECURE_AUTH 2049
  67. #define CR_NO_DATA 2051
  68. #define CR_NO_STMT_METADATA 2052
  69. #define CR_NOT_IMPLEMENTED 2054
  70. #define CR_SERVER_LOST_EXTENDED 2055 /* never sent to a client, message only */
  71. #define CR_STMT_CLOSED 2056
  72. #define CR_NEW_STMT_METADATA 2057
  73. #define CR_ALREADY_CONNECTED 2058
  74. #define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
  75. #define CR_DUPLICATE_CONNECTION_ATTR 2060
  76. #define CR_AUTH_PLUGIN_ERR 2061
  77. /*
  78. * MariaDB Connector/C errors:
  79. */
  80. #define CR_EVENT_CREATE_FAILED 5000
  81. #define CR_BIND_ADDR_FAILED 5001
  82. #define CR_ASYNC_NOT_SUPPORTED 5002
  83. #define CR_FUNCTION_NOT_SUPPORTED 5003
  84. #define CR_FILE_NOT_FOUND 5004
  85. #define CR_FILE_READ 5005
  86. #define CR_BULK_WITHOUT_PARAMETERS 5006
  87. #endif