| 1 | /* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
| 2 | |
| 3 | This program is free software; you can redistribute it and/or modify |
| 4 | it under the terms of the GNU General Public License as published by |
| 5 | the Free Software Foundation. |
| 6 | |
| 7 | There are special exceptions to the terms and conditions of the GPL as it |
| 8 | is applied to this software. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with this program; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
| 18 | |
| 19 | /* Error messages for MySQL clients */ |
| 20 | /* (Error messages for the daemon are in share/language/errmsg.sys) */ |
| 21 | |
| 22 | #include <my_global.h> |
| 23 | #include <my_sys.h> |
| 24 | #include "errmsg.h" |
| 25 | |
| 26 | const char *client_errors[]= |
| 27 | { |
| 28 | "Unknown MySQL error" , |
| 29 | "Can't create UNIX socket (%d)" , |
| 30 | "Can't connect to local MySQL server through socket '%-.100s' (%M)" , |
| 31 | "Can't connect to MySQL server on '%-.100s' (%M)" , |
| 32 | "Can't create TCP/IP socket (%M)" , |
| 33 | "Unknown MySQL server host '%-.100s' (%d)" , |
| 34 | "MySQL server has gone away" , |
| 35 | "Protocol mismatch; server version = %d, client version = %d" , |
| 36 | "MySQL client ran out of memory" , |
| 37 | "Wrong host info" , |
| 38 | "Localhost via UNIX socket" , |
| 39 | "%-.100s via TCP/IP" , |
| 40 | "Error in server handshake" , |
| 41 | "Lost connection to MySQL server during query" , |
| 42 | "Commands out of sync; you can't run this command now" , |
| 43 | "Named pipe: %-.32s" , |
| 44 | "Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)" , |
| 45 | "Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)" , |
| 46 | "Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)" , |
| 47 | "Can't initialize character set %-.32s (path: %-.100s)" , |
| 48 | "Got packet bigger than 'max_allowed_packet' bytes" , |
| 49 | "Embedded server" , |
| 50 | "Error on SHOW SLAVE STATUS:" , |
| 51 | "Error on SHOW SLAVE HOSTS:" , |
| 52 | "Error connecting to slave:" , |
| 53 | "Error connecting to master:" , |
| 54 | "SSL connection error: %-.100s" , |
| 55 | "Malformed packet" , |
| 56 | "This client library is licensed only for use with MySQL servers having '%s' license" , |
| 57 | "Invalid use of null pointer" , |
| 58 | "Statement not prepared" , |
| 59 | "No data supplied for parameters in prepared statement" , |
| 60 | "Data truncated" , |
| 61 | "No parameters exist in the statement" , |
| 62 | "Invalid parameter number" , |
| 63 | "Can't send long data for non-string/non-binary data types (parameter: %d)" , |
| 64 | "Using unsupported buffer type: %d (parameter: %d)" , |
| 65 | "Shared memory: %-.100s" , |
| 66 | "Can't open shared memory; client could not create request event (%lu)" , |
| 67 | "Can't open shared memory; no answer event received from server (%lu)" , |
| 68 | "Can't open shared memory; server could not allocate file mapping (%lu)" , |
| 69 | "Can't open shared memory; server could not get pointer to file mapping (%lu)" , |
| 70 | "Can't open shared memory; client could not allocate file mapping (%lu)" , |
| 71 | "Can't open shared memory; client could not get pointer to file mapping (%lu)" , |
| 72 | "Can't open shared memory; client could not create %s event (%lu)" , |
| 73 | "Can't open shared memory; no answer from server (%lu)" , |
| 74 | "Can't open shared memory; cannot send request event to server (%lu)" , |
| 75 | "Wrong or unknown protocol" , |
| 76 | "Invalid connection handle" , |
| 77 | "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)" , |
| 78 | "Row retrieval was canceled by mysql_stmt_close() call" , |
| 79 | "Attempt to read column without prior row fetch" , |
| 80 | "Prepared statement contains no metadata" , |
| 81 | "Attempt to read a row while there is no result set associated with the statement" , |
| 82 | "This feature is not implemented yet" , |
| 83 | "Lost connection to MySQL server at '%s', system error: %M" , |
| 84 | "Statement closed indirectly because of a preceding %s() call" , |
| 85 | "The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again" , |
| 86 | "This handle is already connected. Use a separate handle for each connection." , |
| 87 | "Authentication plugin '%s' cannot be loaded: %s" , |
| 88 | "There is an attribute with the same name already" , |
| 89 | "Authentication plugin '%s' reported error: %s" , |
| 90 | "" |
| 91 | }; |
| 92 | |
| 93 | const char** get_client_errmsgs(int nr __attribute__((unused))) |
| 94 | { |
| 95 | return client_errors; |
| 96 | } |
| 97 | |
| 98 | /* |
| 99 | Register client error messages for use with my_error(). |
| 100 | |
| 101 | SYNOPSIS |
| 102 | init_client_errs() |
| 103 | |
| 104 | RETURN |
| 105 | void |
| 106 | */ |
| 107 | |
| 108 | void init_client_errs(void) |
| 109 | { |
| 110 | compile_time_assert(array_elements(client_errors) == |
| 111 | (CR_ERROR_LAST - CR_ERROR_FIRST + 2)); |
| 112 | (void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST); |
| 113 | } |
| 114 | |
| 115 | |
| 116 | /* |
| 117 | Unregister client error messages. |
| 118 | |
| 119 | SYNOPSIS |
| 120 | finish_client_errs() |
| 121 | |
| 122 | RETURN |
| 123 | void |
| 124 | */ |
| 125 | |
| 126 | void finish_client_errs(void) |
| 127 | { |
| 128 | (void) my_error_unregister(CR_ERROR_FIRST, CR_ERROR_LAST); |
| 129 | } |
| 130 | |