1 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
2 
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 
8    This library is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11    Library General Public License for more details.
12 
13    You should have received a copy of the GNU Library General Public
14    License along with this library; if not, write to the Free
15    Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16    MA 02111-1301, USA */
17 
18 /* Error messages for clients */
19 /* error messages for the demon is in share/language/errmsg.sys */
20 
21 #include <ma_global.h>
22 #include <ma_sys.h>
23 #include "errmsg.h"
24 #include <stdarg.h>
25 
26 const char *SQLSTATE_UNKNOWN= "HY000";
27 
28 const char *client_errors[]=
29 {
30 /* 2000 */  "Unknown error",
31 /* 2001 */  "Can't create UNIX socket (%d)",
32 /* 2002 */  "Can't connect to local server through socket '%-.64s' (%d)",
33 /* 2003 */  "Can't connect to server on '%-.64s' (%d)",
34 /* 2004 */  "Can't create TCP/IP socket (%d)",
35 /* 2005 */  "Unknown server host '%-.100s' (%d)",
36 /* 2006 */  "Server has gone away",
37 /* 2007 */  "Protocol mismatch. Server Version = %d Client Version = %d",
38 /* 2008 */  "Client run out of memory",
39 /* 2009 */  "Wrong host info",
40 /* 2010 */  "Localhost via UNIX socket",
41 /* 2011 */  "%-.64s via TCP/IP",
42 /* 2012 */  "Error in server handshake",
43 /* 2013 */  "Lost connection to server during query",
44 /* 2014 */  "Commands out of sync; you can't run this command now",
45 /* 2015 */  "%-.64s via named pipe",
46 /* 2016 */  "Can't wait for named pipe to host: %-.64s  pipe: %-.32s (%lu)",
47 /* 2017 */  "Can't open named pipe to host: %-.64s  pipe: %-.32s (%lu)",
48 /* 2018 */  "Can't set state of named pipe to host: %-.64s  pipe: %-.32s (%lu)",
49 /* 2019 */  "Can't initialize character set %-.64s (path: %-.64s)",
50 /* 2020 */  "Got packet bigger than 'max_allowed_packet'",
51 /* 2021 */  "",
52 /* 2022 */  "",
53 /* 2023 */  "",
54 /* 2024 */  "",
55 /* 2025 */  "",
56 /* 2026 */  "SSL connection error: %-.100s",
57 /* 2027 */  "Received malformed packet",
58 /* 2028 */  "",
59 /* 2029 */  "",
60 /* 2030 */  "Statement is not prepared",
61 /* 2031 */  "No data supplied for parameters in prepared statement",
62 /* 2032 */  "Data truncated",
63 /* 2033 */  "",
64 /* 2034 */  "Invalid parameter number",
65 /* 2035 */  "Invalid buffer type: %d (parameter: %d)",
66 /* 2036 */  "Buffer type is not supported",
67 /* 2037 */  "Shared memory: %-.64s",
68 /* 2038 */  "Shared memory connection failed during %s. (%lu)",
69 /* 2039 */  "",
70 /* 2040 */  "",
71 /* 2041 */  "",
72 /* 2042 */  "",
73 /* 2043 */  "",
74 /* 2044 */  "",
75 /* 2045 */  "",
76 /* 2046 */  "",
77 /* 2047 */  "Wrong or unknown protocol",
78 /* 2048 */  "",
79 /* 2049 */  "Connection with old authentication protocol refused.",
80 /* 2050 */  "",
81 /* 2051 */  "",
82 /* 2052 */  "Prepared statement contains no metadata",
83 /* 2053 */  "",
84 /* 2054 */  "This feature is not implemented or disabled",
85 /* 2055 */  "Lost connection to server at '%s', system error: %d",
86 /* 2056 */  "Server closed statement due to a prior %s function call",
87 /* 2057 */  "The number of parameters in bound buffers differs from number of columns in resultset",
88 /* 2059 */  "Can't connect twice. Already connected",
89 /* 2058 */  "Plugin %s could not be loaded: %s",
90 /* 2059 */  "An attribute with same name already exists",
91 /* 2060 */  "Plugin doesn't support this function",
92             ""
93 };
94 
95 const char *mariadb_client_errors[] =
96 {
97   /* 5000 */ "Creating an event failed (Errorcode: %d)",
98   /* 5001 */ "Bind to local interface '-.%64s' failed (Errorcode: %d)",
99   /* 5002 */ "Connection type doesn't support asynchronous IO operations",
100   /* 5003 */ "Server doesn't support function '%s'",
101   /* 5004 */ "File '%s' not found (Errcode: %d)",
102   /* 5005 */ "Error reading file '%s' (Errcode: %d)",
103   /* 5006 */ "Bulk operation without parameters is not supported",
104   /* 5007 */ "Invalid statement handle",
105   /* 5008 */ "Unsupported version %d. Supported versions are in the range %d - %d",
106   ""
107 };
108 
109 const char ** NEAR my_errmsg[MAXMAPS]={0,0,0,0};
110 char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
111 
init_client_errs(void)112 void init_client_errs(void)
113 {
114   my_errmsg[CLIENT_ERRMAP] = &client_errors[0];
115 }
116 
117