mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
aa81e025a8
- Adding %M my_sprintf() modifier that prints error number - system-error-text - Modified mysys, mysql_client and SQL error messages to use %M instead of %d - Added my_strerror() Updated handler errors to 5.6 error numbers Updated text for a few error messages (to match 5.6) Increased length of command name in error output extra/comp_err.c: Added support for %M include/my_base.h: Updated handler errors to 5.6 error numbers include/my_sys.h: Added my_strerror() libmysql/errmsg.c: Updated error messages to use %M mysql-test/r/errors.result: Updated result as error message have changed mysql-test/r/innodb_mysql_sync.result: Updated result with text for errno mysql-test/r/myisam-system.result: Updated result with text for errno mysql-test/r/myisam.result: Updated result as error message have changed mysql-test/r/myisampack.result: Updated result with text for errno mysql-test/r/mysql.result: Updated result with text for errno mysql-test/r/mysql_upgrade.result: Updated result with text for errno mysql-test/r/partition_datatype.result: Updated result as error message have changed mysql-test/r/partition_innodb_plugin.result: Updated result with text for errno mysql-test/r/ps_1general.result: Updated result with text for errno mysql-test/r/trigger.result: Updated result with text for errno mysql-test/r/type_bit.result: Updated result as error message have changed mysql-test/r/type_bit_innodb.result: Updated result as error message have changed mysql-test/r/type_blob.result: Updated result as error message have changed mysql-test/suite/archive/archive.result: Updated result with text for errno mysql-test/suite/binlog/r/binlog_index.result: Updated result with text for errno mysql-test/suite/binlog/r/binlog_ioerr.result: Updated result with text for errno mysql-test/suite/csv/csv.result: Updated result with text for errno mysql-test/suite/federated/federated_bug_35333.result: Updated result with text for errno mysql-test/suite/innodb/r/innodb-create-options.result: Updated result with text for errno mysql-test/suite/innodb/r/innodb-index.result: Updated result with text for errno mysql-test/suite/innodb/r/innodb-zip.result: Updated result as error message have changed mysql-test/suite/innodb/r/innodb.result: Updated result with text for errno mysql-test/suite/innodb/r/innodb_bug21704.result: Updated result with text for errno mysql-test/suite/innodb/r/innodb_bug46000.result: Updated result with text for errno mysql-test/suite/innodb/r/innodb_bug53591.result: Updated result as error message have changed mysql-test/suite/innodb/r/innodb_corrupt_bit.result: New error numbers mysql-test/suite/innodb/r/innodb_prefix_index_liftedlimit.result: Updated result as error message have changed mysql-test/suite/innodb/t/innodb-create-options.test: Added regexp to avoid system error text mysql-test/suite/innodb/t/innodb-zip.test: Added regexp to avoid system error text mysql-test/suite/maria/maria-recovery2.result: Updated supression rule mysql-test/suite/maria/maria-recovery2.test: Updated supression rule mysql-test/suite/maria/maria.result: Updated result as error message have changed mysql-test/suite/parts/r/partition_bit_innodb.result: Updated result as error message have changed mysql-test/suite/parts/r/partition_bit_myisam.result: Updated result as error message have changed mysql-test/suite/percona/percona_innodb_fake_changes.result: Updated result with text for errno mysql-test/suite/perfschema/r/dml_cond_instances.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_events_waits_current.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_events_waits_history.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_events_waits_history_long.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_ews_by_instance.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_file_instances.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_mutex_instances.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_performance_timers.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_rwlock_instances.result: Updated result as error message have changed mysql-test/suite/perfschema/r/dml_threads.result: Updated result as error message have changed mysql-test/suite/perfschema/r/misc.result: Updated result with text for errno mysql-test/suite/perfschema/r/privilege.result: Updated result with text for errno mysql-test/suite/rpl/r/rpl_EE_err.result: Updated result with text for errno mysql-test/suite/rpl/r/rpl_binlog_errors.result: Updated result with text for errno mysql-test/suite/rpl/r/rpl_drop_db.result: Updated result with text for errno mysys/errors.c: Updated error messages to use %M Changed all errors to use Errcode: consistenly mysys/my_handler_errors.h: Updated handler errors to 5.6 error numbers sql/share/errmsg-utf8.txt: Updated error messages to use %M sql/sys_vars.cc: Added error number to ER_EVENT_SET_VAR_ERROR strings/my_vsnprintf.c: Added %M my_sprintf() modifier that prints error number - system-error-text Simplify code Movied common code to function Removed some casts that was not necessary when reading integer/unsigned int stored in longlong Added my_strerror() unittest/mysys/my_vsnprintf-t.c: Added testing of %M
125 lines
4.6 KiB
C
125 lines
4.6 KiB
C
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation.
|
|
|
|
There are special exceptions to the terms and conditions of the GPL as it
|
|
is applied to this software.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
|
|
/* Error messages for MySQL clients */
|
|
/* (Error messages for the daemon are in share/language/errmsg.sys) */
|
|
|
|
#include <my_global.h>
|
|
#include <my_sys.h>
|
|
#include "errmsg.h"
|
|
|
|
const char *client_errors[]=
|
|
{
|
|
"Unknown MySQL error",
|
|
"Can't create UNIX socket (%d)",
|
|
"Can't connect to local MySQL server through socket '%-.100s' (%M)",
|
|
"Can't connect to MySQL server on '%-.100s' (%M)",
|
|
"Can't create TCP/IP socket (%M)",
|
|
"Unknown MySQL server host '%-.100s' (%d)",
|
|
"MySQL server has gone away",
|
|
"Protocol mismatch; server version = %d, client version = %d",
|
|
"MySQL client ran out of memory",
|
|
"Wrong host info",
|
|
"Localhost via UNIX socket",
|
|
"%-.100s via TCP/IP",
|
|
"Error in server handshake",
|
|
"Lost connection to MySQL server during query",
|
|
"Commands out of sync; you can't run this command now",
|
|
"Named pipe: %-.32s",
|
|
"Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)",
|
|
"Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)",
|
|
"Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)",
|
|
"Can't initialize character set %-.32s (path: %-.100s)",
|
|
"Got packet bigger than 'max_allowed_packet' bytes",
|
|
"Embedded server",
|
|
"Error on SHOW SLAVE STATUS:",
|
|
"Error on SHOW SLAVE HOSTS:",
|
|
"Error connecting to slave:",
|
|
"Error connecting to master:",
|
|
"SSL connection error: %-.100s",
|
|
"Malformed packet",
|
|
"This client library is licensed only for use with MySQL servers having '%s' license",
|
|
"Invalid use of null pointer",
|
|
"Statement not prepared",
|
|
"No data supplied for parameters in prepared statement",
|
|
"Data truncated",
|
|
"No parameters exist in the statement",
|
|
"Invalid parameter number",
|
|
"Can't send long data for non-string/non-binary data types (parameter: %d)",
|
|
"Using unsupported buffer type: %d (parameter: %d)",
|
|
"Shared memory: %-.100s",
|
|
"Can't open shared memory; client could not create request event (%lu)",
|
|
"Can't open shared memory; no answer event received from server (%lu)",
|
|
"Can't open shared memory; server could not allocate file mapping (%lu)",
|
|
"Can't open shared memory; server could not get pointer to file mapping (%lu)",
|
|
"Can't open shared memory; client could not allocate file mapping (%lu)",
|
|
"Can't open shared memory; client could not get pointer to file mapping (%lu)",
|
|
"Can't open shared memory; client could not create %s event (%lu)",
|
|
"Can't open shared memory; no answer from server (%lu)",
|
|
"Can't open shared memory; cannot send request event to server (%lu)",
|
|
"Wrong or unknown protocol",
|
|
"Invalid connection handle",
|
|
"Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
|
|
"Row retrieval was canceled by mysql_stmt_close() call",
|
|
"Attempt to read column without prior row fetch",
|
|
"Prepared statement contains no metadata",
|
|
"Attempt to read a row while there is no result set associated with the statement",
|
|
"This feature is not implemented yet",
|
|
"Lost connection to MySQL server at '%s', system error: %M",
|
|
"Statement closed indirectly because of a preceeding %s() call",
|
|
"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",
|
|
"This handle is already connected. Use a separate handle for each connection.",
|
|
"Authentication plugin '%s' cannot be loaded: %s",
|
|
""
|
|
};
|
|
|
|
const char** get_client_errmsgs()
|
|
{
|
|
return client_errors;
|
|
}
|
|
|
|
/*
|
|
Register client error messages for use with my_error().
|
|
|
|
SYNOPSIS
|
|
init_client_errs()
|
|
|
|
RETURN
|
|
void
|
|
*/
|
|
|
|
void init_client_errs(void)
|
|
{
|
|
(void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST);
|
|
}
|
|
|
|
|
|
/*
|
|
Unregister client error messages.
|
|
|
|
SYNOPSIS
|
|
finish_client_errs()
|
|
|
|
RETURN
|
|
void
|
|
*/
|
|
|
|
void finish_client_errs(void)
|
|
{
|
|
(void) my_error_unregister(CR_ERROR_FIRST, CR_ERROR_LAST);
|
|
}
|