mirror of
https://github.com/MariaDB/server.git
synced 2025-01-26 08:44:33 +01:00
Fixed wrong arguments to printf and related functions
Other things, mainly to get create_mysqld_error_find_printf_error tool to work: - Added protection to not include mysqld_error.h twice - Include "unireg.h" instead of "mysqld_error.h" in server - Added protection if ER_XX messages are already defined - Removed wrong calls to my_error(ER_OUTOFMEMORY) as my_malloc() and my_alloc will do this automatically - Added missing %s to ER_DUP_QUERY_NAME - Removed old and wrong calls to my_strerror() when using MY_ERROR_ON_RENAME (wrong merge) - Fixed deadlock error message from Galera. Before the extra information given to ER_LOCK_DEADLOCK was missing because ER_LOCK_DEADLOCK doesn't provide any extra information. I kept #ifdef mysqld_error_find_printf_error_used in sql_acl.h to make it easy to do this kind of check again in the future
This commit is contained in:
parent
c584a496d7
commit
5e0b13d173
47 changed files with 91 additions and 101 deletions
extra
include
mysql-test
r
suite/galera/r
galera_bf_abort.resultgalera_bf_abort_get_lock.resultgalera_bf_abort_sleep.resultgalera_enum.resultgalera_fk_conflict.resultgalera_insert_multi.resultgalera_many_indexes.resultgalera_mdl_race.resultgalera_nopk_bit.resultgalera_nopk_blob.resultgalera_nopk_large_varchar.resultgalera_nopk_unicode.resultgalera_pk_bigint_signed.resultgalera_pk_bigint_unsigned.resultgalera_serializable.resultgalera_split_brain.resultgalera_toi_drop_database.resultgalera_toi_lock_exclusive.resultgalera_toi_truncate.resultgalera_unicode_pk.resultgalera_var_auto_inc_control_off.resultgalera_wsrep_log_conficts.result
sql
field.cclog_event.ccmdl.ccopt_range.ccrpl_gtid.cc
share
slave.ccsql_acl.ccsql_acl.hsql_connect.ccsql_digest.ccsql_parse.ccsql_partition_admin.ccsql_prepare.ccsql_repl.ccsql_show.ccsql_table.ccsql_yacc.yysys_vars.ccwsrep_mysqld.ccwsrep_var.ccstorage/innobase/handler
|
@ -267,6 +267,7 @@ static int create_header_files(struct errors *error_head)
|
|||
fprintf(sql_statef, "/* Autogenerated file, please don't edit */\n\n");
|
||||
fprintf(er_namef, "/* Autogenerated file, please don't edit */\n\n");
|
||||
|
||||
fprintf(er_definef, "#ifndef ER_ERROR_FIRST\n");
|
||||
fprintf(er_definef, "#define ER_ERROR_FIRST %d\n", error_head->d_code);
|
||||
|
||||
current_d_code= error_head->d_code -1;
|
||||
|
@ -314,6 +315,7 @@ static int create_header_files(struct errors *error_head)
|
|||
}
|
||||
/* finishing off with mysqld_error.h */
|
||||
fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last);
|
||||
fprintf(er_definef, "#endif /* ER_ERROR_FIRST */\n");
|
||||
my_fclose(er_definef, MYF(0));
|
||||
my_fclose(sql_statef, MYF(0));
|
||||
my_fclose(er_namef, MYF(0));
|
||||
|
|
|
@ -173,8 +173,10 @@ static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
|
|||
}
|
||||
|
||||
/* Can't include mysqld_error.h, it needs mysys to build, thus hardcode 2 error values here. */
|
||||
#ifndef ER_WARN_DATA_OUT_OF_RANGE
|
||||
#define ER_WARN_DATA_OUT_OF_RANGE 1264
|
||||
#define ER_WARN_INVALID_TIMESTAMP 1299
|
||||
#endif
|
||||
|
||||
my_time_t
|
||||
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, uint *error_code);
|
||||
|
|
|
@ -705,7 +705,7 @@ ERROR 42S21: Duplicate column name 'f1'
|
|||
with t as (select * from t2 where c>3),
|
||||
t as (select a from t1 where a>2)
|
||||
select * from t,t1 where t1.a=t.c;
|
||||
ERROR HY000: Duplicate query name in WITH clause
|
||||
ERROR HY000: Duplicate query name in WITH clause 't'
|
||||
with t as (select a from s where a<5),
|
||||
s as (select a from t1 where b>='d')
|
||||
select * from t,s where t.a=s.a;
|
||||
|
|
|
@ -9,7 +9,7 @@ INSERT INTO t1 VALUES (1,'node_1');
|
|||
connection node_2a;
|
||||
connection node_2;
|
||||
INSERT INTO t1 VALUES (2, 'node_2');
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
wsrep_local_aborts_increment
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -10,7 +10,7 @@ SELECT GET_LOCK("foo", 1000);;
|
|||
connection node_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
wsrep_local_aborts_increment
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -6,7 +6,7 @@ SELECT SLEEP(1000);;
|
|||
connection node_1;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
connection node_2;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
wsrep_local_aborts_increment
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -38,7 +38,7 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three';
|
||||
COUNT(*) = 1
|
||||
|
|
|
@ -22,6 +22,6 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
DROP TABLE child;
|
||||
DROP TABLE parent;
|
||||
|
|
|
@ -51,7 +51,7 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
ROLLBACK;
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
|
|
|
@ -129,5 +129,5 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -28,7 +28,7 @@ SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
|
|||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
|
||||
UNLOCK TABLES;
|
||||
connection node_1;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
|
||||
COUNT(*) = 1
|
||||
1
|
||||
|
|
|
@ -28,6 +28,6 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
|
|
@ -28,6 +28,6 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
|
|
@ -31,6 +31,6 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
|
|
@ -19,7 +19,7 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
SELECT f1 = 'текст2' FROM t1;
|
||||
f1 = 'текст2'
|
||||
1
|
||||
|
|
|
@ -27,6 +27,6 @@ COMMIT;
|
|||
SET AUTOCOMMIT=ON;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
SET AUTOCOMMIT=ON;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -24,6 +24,6 @@ COMMIT;
|
|||
SET AUTOCOMMIT=ON;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
SET AUTOCOMMIT=ON;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -9,7 +9,7 @@ connection node_2;
|
|||
INSERT INTO t1 VALUES (1,1);
|
||||
connection node_1;
|
||||
SELECT * FROM t1;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
ROLLBACK;
|
||||
DELETE FROM t1;
|
||||
connection node_1;
|
||||
|
@ -22,7 +22,7 @@ connection node_2;
|
|||
UPDATE t1 SET f2 = 2;
|
||||
connection node_1;
|
||||
UPDATE t1 SET f2 = 3;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
ROLLBACK;
|
||||
DELETE FROM t1;
|
||||
connection node_1;
|
||||
|
@ -33,5 +33,5 @@ connection node_2;
|
|||
INSERT INTO t1 VALUES (1,2);
|
||||
connection node_1;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -6,7 +6,7 @@ connection node_2;
|
|||
Killing server ...
|
||||
connection node_1;
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: WSREP replication failed. Check your wsrep connection state and retry the query.
|
||||
connection node_2;
|
||||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
disconnect node_2;
|
||||
|
|
|
@ -14,9 +14,9 @@ INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, te
|
|||
connection node_2;
|
||||
DROP DATABASE database1;;
|
||||
connection node_1;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
connection node_1a;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
|
||||
|
|
|
@ -8,7 +8,7 @@ connection node_2a;
|
|||
ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
connection node_1;
|
||||
INSERT INTO t1 VALUES (2, 2);
|
||||
SELECT COUNT(*) = 2 FROM t1;
|
||||
|
|
|
@ -9,7 +9,7 @@ connection node_1;
|
|||
TRUNCATE TABLE t1;;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
connection node_2;
|
||||
SELECT COUNT(*) = 0 FROM t1;
|
||||
COUNT(*) = 0
|
||||
|
|
|
@ -18,7 +18,7 @@ connection node_1;
|
|||
COMMIT;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
SELECT f1 = 'текст2' FROM t1;
|
||||
f1 = 'текст2'
|
||||
1
|
||||
|
@ -35,6 +35,6 @@ connection node_2;
|
|||
COMMIT;
|
||||
connection node_1;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
COMMIT;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -59,7 +59,7 @@ connection node_1a;
|
|||
COMMIT;
|
||||
connection node_2a;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
connection node_1a;
|
||||
SELECT * FROM t1;
|
||||
f1 node
|
||||
|
|
|
@ -20,6 +20,6 @@ connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
|||
connection node_2a;
|
||||
connection node_2;
|
||||
COMMIT;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR 40001: Deadlock: wsrep aborted transaction
|
||||
include/assert_grep.inc [cluster conflict due to high priority abort for threads]
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -9948,7 +9948,7 @@ bool Column_definition::check(THD *thd)
|
|||
if (decimals >= NOT_FIXED_DEC)
|
||||
{
|
||||
my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast<ulonglong>(decimals),
|
||||
field_name, static_cast<ulong>(NOT_FIXED_DEC - 1));
|
||||
field_name, static_cast<uint>(NOT_FIXED_DEC - 1));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
my_decimal_trim(&length, &decimals);
|
||||
|
@ -10006,7 +10006,7 @@ bool Column_definition::check(THD *thd)
|
|||
if (decimals != NOT_FIXED_DEC && decimals >= FLOATING_POINT_DECIMALS)
|
||||
{
|
||||
my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast<ulonglong>(decimals),
|
||||
field_name, static_cast<ulong>(FLOATING_POINT_DECIMALS-1));
|
||||
field_name, static_cast<uint>(FLOATING_POINT_DECIMALS-1));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
break;
|
||||
|
@ -10026,7 +10026,7 @@ bool Column_definition::check(THD *thd)
|
|||
if (decimals != NOT_FIXED_DEC && decimals >= FLOATING_POINT_DECIMALS)
|
||||
{
|
||||
my_error(ER_TOO_BIG_SCALE, MYF(0), static_cast<ulonglong>(decimals),
|
||||
field_name, static_cast<ulong>(FLOATING_POINT_DECIMALS-1));
|
||||
field_name, static_cast<uint>(FLOATING_POINT_DECIMALS-1));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
#include <my_global.h>
|
||||
#include "sql_priv.h"
|
||||
#include "mysqld_error.h"
|
||||
|
||||
#ifndef MYSQL_CLIENT
|
||||
#include "unireg.h"
|
||||
|
@ -44,6 +43,8 @@
|
|||
#include <strfunc.h>
|
||||
#include "compat56.h"
|
||||
#include "wsrep_mysqld.h"
|
||||
#else
|
||||
#include "mysqld_error.h"
|
||||
#endif /* MYSQL_CLIENT */
|
||||
|
||||
#include <my_bitmap.h>
|
||||
|
@ -1914,9 +1915,9 @@ err:
|
|||
#endif
|
||||
if (event.length() >= OLD_HEADER_LEN)
|
||||
sql_print_error("Error in Log_event::read_log_event(): '%s',"
|
||||
" data_len: %lu, event_type: %d", error,
|
||||
uint4korr(&event[EVENT_LEN_OFFSET]),
|
||||
(uchar)event[EVENT_TYPE_OFFSET]);
|
||||
" data_len: %lu, event_type: %u", error,
|
||||
(ulong) uint4korr(&event[EVENT_LEN_OFFSET]),
|
||||
(uint) (uchar)event[EVENT_TYPE_OFFSET]);
|
||||
else
|
||||
sql_print_error("Error in Log_event::read_log_event(): '%s'", error);
|
||||
/*
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "sql_array.h"
|
||||
#include "rpl_rli.h"
|
||||
#include <lf.h>
|
||||
#include <mysqld_error.h>
|
||||
#include "unireg.h"
|
||||
#include <mysql/plugin.h>
|
||||
#include <mysql/service_thd_wait.h>
|
||||
#include <mysql/psi/mysql_stage.h>
|
||||
|
|
|
@ -10241,8 +10241,8 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
|
|||
ulong count=count_key_part_usage(root,pos->next_key_part);
|
||||
if (count > pos->next_key_part->use_count)
|
||||
{
|
||||
sql_print_information("Use_count: Wrong count for key at %p, %lu "
|
||||
"should be %lu", (long unsigned int)pos,
|
||||
sql_print_information("Use_count: Wrong count for key at %p: %lu "
|
||||
"should be %lu", pos,
|
||||
pos->next_key_part->use_count, count);
|
||||
return;
|
||||
}
|
||||
|
@ -10251,7 +10251,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
|
|||
}
|
||||
if (e_count != elements)
|
||||
sql_print_warning("Wrong use count: %u (should be %u) for tree at %p",
|
||||
e_count, elements, (long unsigned int) this);
|
||||
e_count, elements, this);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1927,10 +1927,7 @@ slave_connection_state::load(char *slave_request, size_t len)
|
|||
for (;;)
|
||||
{
|
||||
if (!(rec= (uchar *)my_malloc(sizeof(entry), MYF(MY_WME))))
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(*gtid));
|
||||
return 1;
|
||||
}
|
||||
gtid= &((entry *)rec)->gtid;
|
||||
if (gtid_parser_helper(&p, end, gtid))
|
||||
{
|
||||
|
@ -2547,10 +2544,7 @@ gtid_waiting::get_entry(uint32 domain_id)
|
|||
return e;
|
||||
|
||||
if (!(e= (hash_element *)my_malloc(sizeof(*e), MYF(MY_WME))))
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(*e));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (init_queue(&e->queue, 8, offsetof(queue_element, wait_seq_no), 0,
|
||||
cmp_queue_elem, NULL, 1+offsetof(queue_element, queue_idx), 1))
|
||||
|
|
|
@ -7570,7 +7570,7 @@ ER_WITH_COL_WRONG_LIST
|
|||
ER_TOO_MANY_DEFINITIONS_IN_WITH_CLAUSE
|
||||
eng "Too many WITH elements in WITH clause"
|
||||
ER_DUP_QUERY_NAME
|
||||
eng "Duplicate query name in WITH clause"
|
||||
eng "Duplicate query name in WITH clause '%s'"
|
||||
ER_RECURSIVE_WITHOUT_ANCHORS
|
||||
eng "No anchors for recursive WITH element '%s'"
|
||||
ER_UNACCEPTABLE_MUTUAL_RECURSION
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <sql_common.h>
|
||||
#include <errmsg.h>
|
||||
#include <ssl_compat.h>
|
||||
#include <mysqld_error.h>
|
||||
#include "unireg.h"
|
||||
#include <mysys_err.h>
|
||||
#include "rpl_handler.h"
|
||||
#include <signal.h>
|
||||
|
|
|
@ -1651,7 +1651,7 @@ static bool fix_lex_user(THD *thd, LEX_USER *user)
|
|||
|
||||
if (user->pwhash.length && user->pwhash.length != check_length)
|
||||
{
|
||||
my_error(ER_PASSWD_LENGTH, MYF(0), check_length);
|
||||
my_error(ER_PASSWD_LENGTH, MYF(0), (int) check_length);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2610,7 +2610,7 @@ static int check_user_can_set_role(const char *user, const char *host,
|
|||
acl_user= find_user_wild(host, user, ip);
|
||||
if (acl_user == NULL)
|
||||
{
|
||||
my_error(ER_INVALID_CURRENT_USER, MYF(0), rolename);
|
||||
my_error(ER_INVALID_CURRENT_USER, MYF(0));
|
||||
result= -1;
|
||||
}
|
||||
else if (access)
|
||||
|
@ -8557,10 +8557,7 @@ bool mysql_show_create_user(THD *thd, LEX_USER *lex_user)
|
|||
strxmov(buff, "CREATE USER for ", username, "@", hostname, NullS);
|
||||
Item_string *field = new (thd->mem_root) Item_string_ascii(thd, "", 0);
|
||||
if (!field)
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0));
|
||||
DBUG_RETURN(true);
|
||||
}
|
||||
DBUG_RETURN(true); // Error given my my_alloc()
|
||||
|
||||
field->name= buff;
|
||||
field->max_length= sizeof(buff);
|
||||
|
|
|
@ -190,8 +190,12 @@ extern LEX_STRING current_user_and_current_role;
|
|||
|
||||
static inline int access_denied_error_code(int passwd_used)
|
||||
{
|
||||
#ifdef mysqld_error_find_printf_error_used
|
||||
return 0;
|
||||
#else
|
||||
return passwd_used == 2 ? ER_ACCESS_DENIED_NO_PASSWORD_ERROR
|
||||
: ER_ACCESS_DENIED_ERROR;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1089,7 +1089,7 @@ bool login_connection(THD *thd)
|
|||
/* Updates global user connection stats. */
|
||||
if (increment_connection_count(thd, TRUE))
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), 2*sizeof(USER_STATS));
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), (int) (2*sizeof(USER_STATS)));
|
||||
error= 1;
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "my_global.h"
|
||||
#include "my_md5.h"
|
||||
#include "mysqld_error.h"
|
||||
#include "unireg.h"
|
||||
|
||||
#include "sql_string.h"
|
||||
#include "sql_class.h"
|
||||
|
|
|
@ -1562,7 +1562,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
if (thd->wsrep_conflict_state == ABORTED &&
|
||||
command != COM_STMT_CLOSE && command != COM_QUIT)
|
||||
{
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction");
|
||||
my_message(ER_LOCK_DEADLOCK, "Deadlock: wsrep aborted transaction",
|
||||
MYF(0));
|
||||
WSREP_DEBUG("Deadlock error for: %s", thd->query());
|
||||
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
|
||||
thd->reset_killed();
|
||||
|
@ -2285,7 +2286,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
|||
|
||||
if (server_command_flags[subcommand] & CF_NO_COM_MULTI)
|
||||
{
|
||||
my_error(ER_BAD_COMMAND_IN_MULTI, MYF(0), command_name[subcommand]);
|
||||
my_error(ER_BAD_COMMAND_IN_MULTI, MYF(0),
|
||||
command_name[subcommand].str);
|
||||
goto com_multi_end;
|
||||
}
|
||||
|
||||
|
@ -7760,7 +7762,8 @@ static void wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
|
|||
(longlong) thd->thread_id, is_autocommit,
|
||||
thd->wsrep_retry_counter,
|
||||
thd->variables.wsrep_retry_autocommit, thd->query());
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction");
|
||||
my_message(ER_LOCK_DEADLOCK, "Deadlock: wsrep aborted transaction",
|
||||
MYF(0));
|
||||
thd->reset_killed();
|
||||
thd->wsrep_conflict_state= NO_CONFLICT;
|
||||
if (thd->wsrep_conflict_state != REPLAYING)
|
||||
|
|
|
@ -378,17 +378,13 @@ static bool exchange_name_with_ddl_log(THD *thd,
|
|||
*/
|
||||
/* call rename table from table to tmp-name */
|
||||
DBUG_EXECUTE_IF("exchange_partition_fail_3",
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0),
|
||||
name, tmp_name, 0, "n/a");
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), name, tmp_name, 0);
|
||||
error_set= TRUE;
|
||||
goto err_rename;);
|
||||
DBUG_EXECUTE_IF("exchange_partition_abort_3", DBUG_SUICIDE(););
|
||||
if (file->ha_rename_table(name, tmp_name))
|
||||
{
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf), my_errno);
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), name, tmp_name,
|
||||
my_errno, errbuf);
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), name, tmp_name, my_errno);
|
||||
error_set= TRUE;
|
||||
goto err_rename;
|
||||
}
|
||||
|
@ -399,17 +395,13 @@ static bool exchange_name_with_ddl_log(THD *thd,
|
|||
|
||||
/* call rename table from partition to table */
|
||||
DBUG_EXECUTE_IF("exchange_partition_fail_5",
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0),
|
||||
from_name, name, 0, "n/a");
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), from_name, name, 0);
|
||||
error_set= TRUE;
|
||||
goto err_rename;);
|
||||
DBUG_EXECUTE_IF("exchange_partition_abort_5", DBUG_SUICIDE(););
|
||||
if (file->ha_rename_table(from_name, name))
|
||||
{
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf), my_errno);
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), from_name, name,
|
||||
my_errno, errbuf);
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), from_name, name, my_errno);
|
||||
error_set= TRUE;
|
||||
goto err_rename;
|
||||
}
|
||||
|
@ -420,17 +412,13 @@ static bool exchange_name_with_ddl_log(THD *thd,
|
|||
|
||||
/* call rename table from tmp-nam to partition */
|
||||
DBUG_EXECUTE_IF("exchange_partition_fail_7",
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0),
|
||||
tmp_name, from_name, 0, "n/a");
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), tmp_name, from_name, 0);
|
||||
error_set= TRUE;
|
||||
goto err_rename;);
|
||||
DBUG_EXECUTE_IF("exchange_partition_abort_7", DBUG_SUICIDE(););
|
||||
if (file->ha_rename_table(tmp_name, from_name))
|
||||
{
|
||||
char errbuf[MYSYS_STRERROR_SIZE];
|
||||
my_strerror(errbuf, sizeof(errbuf), my_errno);
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), tmp_name, from_name,
|
||||
my_errno, errbuf);
|
||||
my_error(ER_ERROR_ON_RENAME, MYF(0), tmp_name, from_name, my_errno);
|
||||
error_set= TRUE;
|
||||
goto err_rename;
|
||||
}
|
||||
|
|
|
@ -2287,10 +2287,8 @@ static int mysql_test_handler_read(Prepared_statement *stmt,
|
|||
if (!stmt->is_sql_prepare())
|
||||
{
|
||||
if (!lex->result && !(lex->result= new (stmt->mem_root) select_send(thd)))
|
||||
{
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(select_send));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
if (send_prep_stmt(stmt, ha_table->fields.elements) ||
|
||||
lex->result->send_result_set_metadata(ha_table->fields, Protocol::SEND_EOF) ||
|
||||
thd->protocol->flush())
|
||||
|
|
|
@ -865,7 +865,6 @@ get_binlog_list(MEM_ROOT *memroot)
|
|||
!(e->name= strmake_root(memroot, fname, length)))
|
||||
{
|
||||
mysql_bin_log.unlock_index();
|
||||
my_error(ER_OUTOFMEMORY, MYF(0), length + 1 + sizeof(*e));
|
||||
DBUG_RETURN(NULL);
|
||||
}
|
||||
e->next= current_list;
|
||||
|
@ -2979,7 +2978,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
|
|||
{
|
||||
/* connection was deleted while we waited for lock_slave_threads */
|
||||
mi->unlock_slave_threads();
|
||||
my_error(WARN_NO_MASTER_INFO, mi->connection_name.length,
|
||||
my_error(WARN_NO_MASTER_INFO, MYF(0), (int) mi->connection_name.length,
|
||||
mi->connection_name.str);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
@ -3237,7 +3236,7 @@ int reset_slave(THD *thd, Master_info* mi)
|
|||
{
|
||||
/* connection was deleted while we waited for lock_slave_threads */
|
||||
mi->unlock_slave_threads();
|
||||
my_error(WARN_NO_MASTER_INFO, mi->connection_name.length,
|
||||
my_error(WARN_NO_MASTER_INFO, MYF(0), (int) mi->connection_name.length,
|
||||
mi->connection_name.str);
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
@ -3380,7 +3379,8 @@ static bool get_string_parameter(char *to, const char *from, size_t length,
|
|||
uint from_numchars= cs->cset->numchars(cs, from, from + from_length);
|
||||
if (from_numchars > length / cs->mbmaxlen)
|
||||
{
|
||||
my_error(ER_WRONG_STRING_LENGTH, MYF(0), from, name, length / cs->mbmaxlen);
|
||||
my_error(ER_WRONG_STRING_LENGTH, MYF(0), from, name,
|
||||
(int) (length / cs->mbmaxlen));
|
||||
return 1;
|
||||
}
|
||||
memcpy(to, from, from_length+1);
|
||||
|
@ -3449,7 +3449,7 @@ bool change_master(THD* thd, Master_info* mi, bool *master_info_added)
|
|||
{
|
||||
/* connection was deleted while we waited for lock_slave_threads */
|
||||
mi->unlock_slave_threads();
|
||||
my_error(WARN_NO_MASTER_INFO, mi->connection_name.length,
|
||||
my_error(WARN_NO_MASTER_INFO, MYF(0), (int) mi->connection_name.length,
|
||||
mi->connection_name.str);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
|
|
@ -2949,7 +2949,7 @@ int fill_show_explain(THD *thd, TABLE_LIST *table, COND *cond)
|
|||
}
|
||||
else
|
||||
{
|
||||
my_error(ER_NO_SUCH_THREAD, MYF(0), thread_id);
|
||||
my_error(ER_NO_SUCH_THREAD, MYF(0), (ulong) thread_id);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4999,7 +4999,8 @@ int mysql_create_table_no_lock(THD *thd,
|
|||
// Check if we hit FN_REFLEN bytes along with file extension.
|
||||
if (length+reg_ext_length > FN_REFLEN)
|
||||
{
|
||||
my_error(ER_IDENT_CAUSES_TOO_LONG_PATH, MYF(0), sizeof(path)-1, path);
|
||||
my_error(ER_IDENT_CAUSES_TOO_LONG_PATH, MYF(0), (int) sizeof(path)-1,
|
||||
path);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -5263,7 +5264,7 @@ mysql_rename_table(handlerton *base, const char *old_db,
|
|||
// Check if we hit FN_REFLEN bytes along with file extension.
|
||||
if (length+reg_ext_length > FN_REFLEN)
|
||||
{
|
||||
my_error(ER_IDENT_CAUSES_TOO_LONG_PATH, MYF(0), sizeof(to)-1, to);
|
||||
my_error(ER_IDENT_CAUSES_TOO_LONG_PATH, MYF(0), (int) sizeof(to)-1, to);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
|
@ -10348,7 +10349,7 @@ bool check_engine(THD *thd, const char *db_name,
|
|||
if (no_substitution)
|
||||
{
|
||||
const char *engine_name= ha_resolve_storage_engine_name(req_engine);
|
||||
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), engine_name, engine_name);
|
||||
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), engine_name);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
*new_engine= enf_engine;
|
||||
|
|
|
@ -2335,7 +2335,7 @@ master_def:
|
|||
if ($3 > MASTER_DELAY_MAX)
|
||||
{
|
||||
my_error(ER_MASTER_DELAY_VALUE_OUT_OF_RANGE, MYF(0),
|
||||
$3, MASTER_DELAY_MAX);
|
||||
(uint) $3, (uint) MASTER_DELAY_MAX);
|
||||
}
|
||||
else
|
||||
Lex->mi.sql_delay = $3;
|
||||
|
|
|
@ -1959,7 +1959,7 @@ Sys_var_slave_parallel_mode::global_update(THD *thd, set_var *var)
|
|||
if (mi->rli.slave_running)
|
||||
{
|
||||
my_error(ER_SLAVE_MUST_STOP, MYF(0),
|
||||
mi->connection_name.length, mi->connection_name.str);
|
||||
(int) mi->connection_name.length, mi->connection_name.str);
|
||||
res= true;
|
||||
}
|
||||
else
|
||||
|
@ -4461,7 +4461,7 @@ bool Sys_var_rpl_filter::global_update(THD *thd, set_var *var)
|
|||
if (mi->rli.slave_running)
|
||||
{
|
||||
my_error(ER_SLAVE_MUST_STOP, MYF(0),
|
||||
mi->connection_name.length,
|
||||
(int) mi->connection_name.length,
|
||||
mi->connection_name.str);
|
||||
result= true;
|
||||
}
|
||||
|
@ -4664,7 +4664,7 @@ static bool update_slave_skip_counter(sys_var *self, THD *thd, Master_info *mi)
|
|||
{
|
||||
if (mi->rli.slave_running)
|
||||
{
|
||||
my_error(ER_SLAVE_MUST_STOP, MYF(0), mi->connection_name.length,
|
||||
my_error(ER_SLAVE_MUST_STOP, MYF(0), (int) mi->connection_name.length,
|
||||
mi->connection_name.str);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1553,8 +1553,8 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
|
|||
ret,
|
||||
(thd->db ? thd->db : "(null)"),
|
||||
(thd->query()) ? thd->query() : "void");
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check "
|
||||
"your wsrep connection state and retry the query.");
|
||||
my_message(ER_LOCK_DEADLOCK, "WSREP replication failed. Check "
|
||||
"your wsrep connection state and retry the query.", MYF(0));
|
||||
wsrep_keys_free(&key_arr);
|
||||
rc= -1;
|
||||
}
|
||||
|
|
|
@ -348,7 +348,7 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type)
|
|||
|
||||
if (wsrep_init())
|
||||
{
|
||||
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp);
|
||||
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp, my_error, "wsrep_init failed");
|
||||
rcode = true;
|
||||
}
|
||||
free(tmp);
|
||||
|
|
|
@ -15052,7 +15052,7 @@ ha_innobase::defragment_table(
|
|||
"Table %s is encrypted but encryption service or"
|
||||
" used key_id is not available. "
|
||||
" Can't continue checking table.",
|
||||
index->table->name);
|
||||
index->table->name.m_name);
|
||||
|
||||
ret = convert_error_code_to_mysql(err, 0, current_thd);
|
||||
break;
|
||||
|
@ -15272,7 +15272,7 @@ ha_innobase::check(
|
|||
"Table %s is encrypted but encryption service or"
|
||||
" used key_id is not available. "
|
||||
" Can't continue checking table.",
|
||||
index->table->name);
|
||||
index->table->name.m_name);
|
||||
} else {
|
||||
push_warning_printf(
|
||||
thd,
|
||||
|
@ -22970,7 +22970,7 @@ ib_push_frm_error(
|
|||
"InnoDB: Table %s has a "
|
||||
"primary key in InnoDB data "
|
||||
"dictionary, but not in "
|
||||
"MariaDB!", ib_table->name);
|
||||
"MariaDB!", ib_table->name.m_name);
|
||||
}
|
||||
break;
|
||||
case DICT_NO_PK_FRM_HAS:
|
||||
|
@ -22983,7 +22983,7 @@ ib_push_frm_error(
|
|||
"columns, then MariaDB internally treats that "
|
||||
"key as the primary key. You can fix this "
|
||||
"error by dump + DROP + CREATE + reimport "
|
||||
"of the table.", ib_table->name);
|
||||
"of the table.", ib_table->name.m_name);
|
||||
|
||||
if (push_warning) {
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
|
@ -22992,7 +22992,7 @@ ib_push_frm_error(
|
|||
"primary key in InnoDB data "
|
||||
"dictionary, but has one in "
|
||||
"MariaDB!",
|
||||
ib_table->name);
|
||||
ib_table->name.m_name);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -23016,7 +23016,7 @@ ib_push_frm_error(
|
|||
"indexes inside InnoDB, which "
|
||||
"is different from the number of "
|
||||
"indexes %u defined in the MariaDB ",
|
||||
ib_table->name, n_keys,
|
||||
ib_table->name.m_name, n_keys,
|
||||
table->s->keys);
|
||||
}
|
||||
break;
|
||||
|
@ -23026,7 +23026,7 @@ ib_push_frm_error(
|
|||
sql_print_error("InnoDB: Table %s is consistent "
|
||||
"on InnoDB data dictionary and MariaDB "
|
||||
" FRM file.",
|
||||
ib_table->name);
|
||||
ib_table->name.m_name);
|
||||
ut_error;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue