Skip to content

Commit 765458c

Browse files
committed
fix my_error usage
1 parent e7cc1a3 commit 765458c

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

sql/item_strfunc.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5327,7 +5327,7 @@ String *Item_func_wsrep_last_written_gtid::val_str_ascii(String *str)
53275327
{
53285328
if (gtid_str.alloc(WSREP_MAX_WSREP_SERVER_GTID_STR_LEN+1))
53295329
{
5330-
my_error(ER_OUTOFMEMORY, WSREP_MAX_WSREP_SERVER_GTID_STR_LEN);
5330+
my_error(ER_OUTOFMEMORY, MYF(0), WSREP_MAX_WSREP_SERVER_GTID_STR_LEN);
53315331
null_value= TRUE;
53325332
return 0;
53335333
}
@@ -5352,7 +5352,7 @@ String *Item_func_wsrep_last_seen_gtid::val_str_ascii(String *str)
53525352
{
53535353
if (gtid_str.alloc(WSREP_MAX_WSREP_SERVER_GTID_STR_LEN+1))
53545354
{
5355-
my_error(ER_OUTOFMEMORY, WSREP_MAX_WSREP_SERVER_GTID_STR_LEN);
5355+
my_error(ER_OUTOFMEMORY, MYF(0), WSREP_MAX_WSREP_SERVER_GTID_STR_LEN);
53565356
null_value= TRUE;
53575357
return 0;
53585358
}
@@ -5397,7 +5397,7 @@ longlong Item_func_wsrep_sync_wait_upto::val_int()
53975397
if (!(gtid_list= gtid_parse_string_to_list(gtid_str->ptr(), gtid_str->length(),
53985398
&count)))
53995399
{
5400-
my_error(ER_INCORRECT_GTID_STATE, MYF(0), func_name());
5400+
my_error(ER_INCORRECT_GTID_STATE, MYF(0));
54015401
null_value= TRUE;
54025402
return 0;
54035403
}
@@ -5409,12 +5409,12 @@ longlong Item_func_wsrep_sync_wait_upto::val_int()
54095409
wait_gtid_ret= wsrep_gtid_server.wait_gtid_upto(gtid_list[0].seq_no, timeout);
54105410
if ((wait_gtid_ret == ETIMEDOUT) || (wait_gtid_ret == ETIME))
54115411
{
5412-
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), func_name());
5412+
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0));
54135413
ret= 0;
54145414
}
54155415
else if (wait_gtid_ret == ENOMEM)
54165416
{
5417-
my_error(ER_OUTOFMEMORY, MYF(0), func_name());
5417+
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(std::pair<uint64, mysql_cond_t*>));
54185418
ret= 0;
54195419
}
54205420
}

sql/sql_acl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3345,7 +3345,7 @@ static int check_user_can_set_role(THD *thd, const char *user,
33453345
switch (result)
33463346
{
33473347
case ER_INVALID_CURRENT_USER:
3348-
my_error(ER_INVALID_CURRENT_USER, MYF(0), rolename);
3348+
my_error(ER_INVALID_CURRENT_USER, MYF(0));
33493349
break;
33503350
case ER_INVALID_ROLE:
33513351
/* Role doesn't exist at all */

sql/wsrep_mysqld.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,8 +2468,11 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table,
24682468

24692469
if (!thd->is_error())
24702470
{
2471-
my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check "
2472-
"your wsrep connection state and retry the query.");
2471+
push_warning_printf(thd, Sql_state_errno_level::WARN_LEVEL_ERROR,
2472+
ER_LOCK_DEADLOCK,
2473+
"WSREP replication failed. Check "
2474+
"your wsrep connection state and retry the query.");
2475+
my_error(ER_LOCK_DEADLOCK, MYF(0));
24732476
}
24742477
}
24752478
rc= -1;

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9530,8 +9530,7 @@ ha_innobase::ft_init_ext(
95309530

95319531
/* If tablespace is discarded, we should return here */
95329532
if (!ft_table->space) {
9533-
my_error(ER_TABLESPACE_MISSING, MYF(0), table->s->db.str,
9534-
table->s->table_name.str);
9533+
my_error(ER_TABLESPACE_MISSING, MYF(0), ft_table->name.m_name);
95359534
return(NULL);
95369535
}
95379536

@@ -13892,7 +13891,7 @@ ha_innobase::rename_table(
1389213891

1389313892
error = DB_ERROR;
1389413893
} else if (error == DB_LOCK_WAIT_TIMEOUT) {
13895-
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to);
13894+
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0));
1389613895

1389713896
error = DB_LOCK_WAIT;
1389813897
}

0 commit comments

Comments
 (0)