Skip to content

Commit 762fe01

Browse files
committed
MDEV-30558: ER_KILL_{,QUERY_}DENIED_ERROR - normalize id type
The error string from ER_KILL_QUERY_DENIED_ERROR took a different type to ER_KILL_DENIED_ERROR for the thread id. This shows up in differences on 32 big endian arches like powerpc (Deb notation). Normalize the passing of the THD->id to its real type of my_thread_id, and cast to (long long) on output. As such normalize the ER_KILL_QUERY_DENIED_ERROR to that convention too. Note for upwards merge, convert the type to %lld on new translations of ER_KILL_QUERY_DENIED_ERROR.
1 parent 40adf52 commit 762fe01

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

sql/share/errmsg-utf8.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8268,11 +8268,11 @@ ER_INVALID_DEFAULT_VALUE_FOR_FIELD 22007
82688268
eng "Incorrect default value '%-.128T' for column '%.192s'"
82698269
hindi "गलत डिफ़ॉल्ट मान '%-.128T' कॉलम '%.192s' के लिए"
82708270
ER_KILL_QUERY_DENIED_ERROR
8271-
chi "你不是查询%lu的所有者"
8272-
eng "You are not owner of query %lu"
8273-
ger "Sie sind nicht Eigentümer von Abfrage %lu"
8274-
hindi "आप क्वेरी %lu के OWNER नहीं हैं"
8275-
rus "Вы не являетесь владельцем запроса %lu"
8271+
chi "你不是查询%lld的所有者"
8272+
eng "You are not owner of query %lld"
8273+
ger "Sie sind nicht Eigentümer von Abfrage %lld"
8274+
hindi "आप क्वेरी %lld के OWNER नहीं हैं"
8275+
rus "Вы не являетесь владельцем запроса %lld"
82768276
ER_NO_EIS_FOR_FIELD
82778277
chi "没有收集无关的统计信息列'%s'"
82788278
eng "Engine-independent statistics are not collected for column '%s'"

sql/sql_parse.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
130130
*/
131131

132132
static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables);
133-
static void sql_kill(THD *thd, longlong id, killed_state state, killed_type type);
133+
static void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type);
134134
static void sql_kill_user(THD *thd, LEX_USER *user, killed_state state);
135135
static bool lock_tables_precheck(THD *thd, TABLE_LIST *tables);
136136
static bool execute_show_status(THD *, TABLE_LIST *);
@@ -5616,7 +5616,7 @@ mysql_execute_command(THD *thd)
56165616
MYF(0));
56175617
goto error;
56185618
}
5619-
sql_kill(thd, it->val_int(), lex->kill_signal, lex->kill_type);
5619+
sql_kill(thd, (my_thread_id) it->val_int(), lex->kill_signal, lex->kill_type);
56205620
}
56215621
else
56225622
sql_kill_user(thd, get_current_user(thd, lex->users_list.head()),
@@ -9146,12 +9146,12 @@ THD *find_thread_by_id(longlong id, bool query_id)
91469146
*/
91479147

91489148
uint
9149-
kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type type)
9149+
kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type type)
91509150
{
91519151
THD *tmp;
91529152
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
91539153
DBUG_ENTER("kill_one_thread");
9154-
DBUG_PRINT("enter", ("id: %lld signal: %d", id, kill_signal));
9154+
DBUG_PRINT("enter", ("id: %lld signal: %d", (long long) id, kill_signal));
91559155
tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY);
91569156
if (!tmp)
91579157
DBUG_RETURN(error);
@@ -9323,7 +9323,7 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user,
93239323
*/
93249324

93259325
static
9326-
void sql_kill(THD *thd, longlong id, killed_state state, killed_type type)
9326+
void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type)
93279327
{
93289328
uint error;
93299329
#ifdef WITH_WSREP
@@ -9352,7 +9352,7 @@ void sql_kill(THD *thd, longlong id, killed_state state, killed_type type)
93529352
wsrep_error_label:
93539353
error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR :
93549354
ER_KILL_DENIED_ERROR);
9355-
my_error(error, MYF(0), id);
9355+
my_error(error, MYF(0), (long long) id);
93569356
#endif /* WITH_WSREP */
93579357
}
93589358

0 commit comments

Comments
 (0)