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 MySQL 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 #ifdef GERMAN
29 const char *client_errors[]=
30 {
31   "Unbekannter MySQL Fehler",
32   "Kann UNIX-Socket nicht anlegen (%d)",
33   "Keine Verbindung zu lokalem MySQL Server, socket: '%-.64s' (%d)",
34   "Keine Verbindung zu MySQL Server auf %-.64s (%d)",
35   "Kann TCP/IP-Socket nicht anlegen (%d)",
36   "Unbekannter MySQL Server Host (%-.64s) (%d)",
37   "MySQL Server nicht vorhanden",
38   "Protokolle ungleich. Server Version = % d Client Version = %d",
39   "MySQL client got out of memory",
40   "Wrong host info",
41   "Localhost via UNIX socket",
42   "%-.64s via TCP/IP",
43   "Error in server handshake",
44   "Lost connection to MySQL server during query",
45   "Commands out of sync; you can't run this command now",
46   "Verbindung ueber Named Pipe; Host: %-.64s",
47   "Kann nicht auf Named Pipe warten. Host: %-.64s  pipe: %-.32s (%lu)",
add_cfg_dir(char ** cfg_dirs,const char * directory)48   "Kann Named Pipe nicht oeffnen. Host: %-.64s  pipe: %-.32s (%lu)",
49   "Kann den Status der Named Pipe nicht setzen.  Host: %-.64s  pipe: %-.32s (%lu)",
50   "Can't initialize character set %-.64s (path: %-.64s)",
51   "Got packet bigger than 'max_allowed_packet'"
52 };
53 
54 /* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
55 
56 #elif defined PORTUGUESE
57 const char *client_errors[]=
58 {
59   "Erro desconhecido do MySQL",
60   "N�o pode criar 'UNIX socket' (%d)",
61   "N�o pode se conectar ao servidor MySQL local atrav�s do 'socket' '%-.64s' (%d)",
62   "N�o pode se conectar ao servidor MySQL em '%-.64s' (%d)",
release_configuration_dirs()63   "N�o pode criar 'socket TCP/IP' (%d)",
64   "'Host' servidor MySQL '%-.64s' (%d) desconhecido",
65   "Servidor MySQL desapareceu",
66   "Incompatibilidade de protocolos. Vers�o do Servidor: %d - Vers�o do Cliente: %d",
67   "Cliente do MySQL com falta de mem�ria",
68   "Informa��o inv�lida de 'host'",
69   "Localhost via 'UNIX socket'",
70   "%-.64s via 'TCP/IP'",
71   "Erro na negocia��o de acesso ao servidor",
72   "Conex�o perdida com servidor MySQL durante 'query'",
73   "Comandos fora de sincronismo. Voc� n�o pode executar este comando agora",
74   "%-.64s via 'named pipe'",
75   "N�o pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
76   "N�o pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
77   "N�o pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)",
78   "N�o pode inicializar conjunto de caracteres %-.64s (caminho %-.64s)",
79   "Obteve pacote maior do que 'max_allowed_packet'"
80 };
81 
82 #else /* ENGLISH */
83 const char *client_errors[]=
84 {
85 /* 2000 */  "Unknown MySQL error",
86 /* 2001 */  "Can't create UNIX socket (%d)",
87 /* 2002 */  "Can't connect to local MySQL server through socket '%-.64s' (%d)",
88 /* 2003 */  "Can't connect to MySQL server on '%-.64s' (%d)",
89 /* 2004 */  "Can't create TCP/IP socket (%d)",
90 /* 2005 */  "Unknown MySQL server host '%-.100s' (%d)",
91 /* 2006 */  "MySQL server has gone away",
92 /* 2007 */  "Protocol mismatch. Server Version = %d Client Version = %d",
93 /* 2008 */  "MySQL client run out of memory",
94 /* 2009 */  "Wrong host info",
95 /* 2010 */  "Localhost via UNIX socket",
96 /* 2011 */  "%-.64s via TCP/IP",
97 /* 2012 */  "Error in server handshake",
98 /* 2013 */  "Lost connection to MySQL server during query",
99 /* 2014 */  "Commands out of sync; you can't run this command now",
100 /* 2015 */  "%-.64s via named pipe",
101 /* 2016 */  "Can't wait for named pipe to host: %-.64s  pipe: %-.32s (%lu)",
102 /* 2017 */  "Can't open named pipe to host: %-.64s  pipe: %-.32s (%lu)",
103 /* 2018 */  "Can't set state of named pipe to host: %-.64s  pipe: %-.32s (%lu)",
104 /* 2019 */  "Can't initialize character set %-.64s (path: %-.64s)",
105 /* 2020 */  "Got packet bigger than 'max_allowed_packet'",
106 /* 2021 */  "",
107 /* 2022 */  "",
108 /* 2023 */  "",
109 /* 2024 */  "",
110 /* 2025 */  "",
111 /* 2026 */  "SSL connection error: %-.100s",
112 /* 2027 */  "received malformed packet",
113 /* 2028 */  "",
114 /* 2029 */  "",
115 /* 2030 */  "Statement is not prepared",
116 /* 2031 */  "No data supplied for parameters in prepared statement",
117 /* 2032 */  "Data truncated",
118 /* 2033 */  "",
119 /* 2034 */  "Invalid parameter number",
120 /* 2035 */  "Invalid buffer type: %d (parameter: %d)",
121 /* 2036 */  "Buffer type is not supported",
122 /* 2037 */  "Shared memory: %-.64s",
123 /* 2038 */  "Shared memory connection failed during %s. (%lu)",
124 /* 2039 */  "",
125 /* 2040 */  "",
126 /* 2041 */  "",
127 /* 2042 */  "",
128 /* 2043 */  "",
129 /* 2044 */  "",
130 /* 2045 */  "",
131 /* 2046 */  "",
132 /* 2047 */  "Wrong or unknown protocol",
133 /* 2048 */  "",
134 /* 2049 */  "Connection with old authentication protocol refused.",
135 /* 2050 */  "",
136 /* 2051 */  "",
137 /* 2052 */  "Prepared statement contains no metadata",
138 /* 2053 */  "",
139 /* 2054 */  "This feature is not implemented or disabled",
140 /* 2055 */  "Lost connection to MySQL server at '%s', system error: %d",
is_group(char * ptr,const char ** groups)141 /* 2056 */  "Server closed statement due to a prior %s function call",
142 /* 2057 */  "The number of parameters in bound buffers differs from number of columns in resultset",
143 /* 2059 */  "Can't connect twice. Already connected",
144 /* 2058 */  "Plugin %s could not be loaded: %s",
145 /* 2059 */  "An attribute with same name already exists",
146 /* 2060 */  "Plugin doesn't support this function",
147             ""
148 };
149 #endif
150 
151 const char *mariadb_client_errors[] =
_mariadb_read_options_from_file(MYSQL * mysql,const char * config_file,const char * group,unsigned int recursion)152 {
153   /* 5000 */ "Creating an event failed (Errorcode: %d)",
154   /* 5001 */ "Bind to local interface '-.%64s' failed (Errorcode: %d)",
155   /* 5002 */ "Connection type doesn't support asynchronous IO operations",
156   /* 5003 */ "Server doesn't support function '%s'",
157   /* 5004 */ "File '%s' not found (Errcode: %d)",
158   /* 5005 */ "Error reading file '%s' (Errcode: %d)",
159   /* 5006 */ "Bulk operation without parameters is not supported",
160   /* 5007 */ "Invalid statement handle",
161   /* 5008 */ "Unsupported version %d. Supported versions are in the range %d - %d",
162   ""
163 };
164 
165 const char ** NEAR my_errmsg[MAXMAPS]={0,0,0,0};
166 char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
167 
168 void init_client_errs(void)
169 {
170   my_errmsg[CLIENT_ERRMAP] = &client_errors[0];
171 }
172 
173