Skip to content

Commit 23368b7

Browse files
committed
Merge 10.4 into 10.5
2 parents a112a80 + 4676465 commit 23368b7

File tree

5 files changed

+19
-17
lines changed

5 files changed

+19
-17
lines changed

sql/sql_class.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,8 +706,8 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
706706

707707
/* wsrep-lib */
708708
m_wsrep_next_trx_id(WSREP_UNDEFINED_TRX_ID),
709-
m_wsrep_mutex(LOCK_thd_data),
710-
m_wsrep_cond(COND_wsrep_thd),
709+
m_wsrep_mutex(&LOCK_thd_data),
710+
m_wsrep_cond(&COND_wsrep_thd),
711711
m_wsrep_client_service(this, m_wsrep_client_state),
712712
m_wsrep_client_state(this,
713713
m_wsrep_mutex,

sql/wsrep_condition_variable.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,29 @@ class Wsrep_condition_variable : public wsrep::condition_variable
2626
{
2727
public:
2828

29-
Wsrep_condition_variable(mysql_cond_t& cond)
29+
Wsrep_condition_variable(mysql_cond_t* cond)
3030
: m_cond(cond)
3131
{ }
3232
~Wsrep_condition_variable()
3333
{ }
3434

3535
void notify_one()
3636
{
37-
mysql_cond_signal(&m_cond);
37+
mysql_cond_signal(m_cond);
3838
}
3939

4040
void notify_all()
4141
{
42-
mysql_cond_broadcast(&m_cond);
42+
mysql_cond_broadcast(m_cond);
4343
}
4444

4545
void wait(wsrep::unique_lock<wsrep::mutex>& lock)
4646
{
4747
mysql_mutex_t* mutex= static_cast<mysql_mutex_t*>(lock.mutex()->native());
48-
mysql_cond_wait(&m_cond, mutex);
48+
mysql_cond_wait(m_cond, mutex);
4949
}
5050
private:
51-
mysql_cond_t& m_cond;
51+
mysql_cond_t* m_cond;
5252
};
5353

5454
#endif /* WSREP_CONDITION_VARIABLE_H */

sql/wsrep_mutex.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@
2525
class Wsrep_mutex : public wsrep::mutex
2626
{
2727
public:
28-
Wsrep_mutex(mysql_mutex_t& mutex)
28+
Wsrep_mutex(mysql_mutex_t* mutex)
2929
: m_mutex(mutex)
3030
{ }
3131

3232
void lock()
3333
{
34-
mysql_mutex_lock(&m_mutex);
34+
mysql_mutex_lock(m_mutex);
3535
}
3636

3737
void unlock()
3838
{
39-
mysql_mutex_unlock(&m_mutex);
39+
mysql_mutex_unlock(m_mutex);
4040
}
4141

4242
void* native()
4343
{
44-
return &m_mutex;
44+
return m_mutex;
4545
}
4646
private:
47-
mysql_mutex_t& m_mutex;
47+
mysql_mutex_t* m_mutex;
4848
};
4949

5050
#endif /* WSREP_MUTEX_H */

sql/wsrep_server_state.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Wsrep_server_state::Wsrep_server_state(const std::string& name,
4343
initial_position,
4444
max_protocol_version,
4545
wsrep::server_state::rm_sync)
46-
, m_mutex(LOCK_wsrep_server_state)
47-
, m_cond(COND_wsrep_server_state)
46+
, m_mutex(&LOCK_wsrep_server_state)
47+
, m_cond(&COND_wsrep_server_state)
4848
, m_service(*this)
4949
{ }
5050

storage/innobase/dict/dict0mem.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2012, Facebook Inc.
5-
Copyright (c) 2013, 2021, MariaDB Corporation.
5+
Copyright (c) 2013, 2022, MariaDB Corporation.
66
77
This program is free software; you can redistribute it and/or modify it under
88
the terms of the GNU General Public License as published by the Free Software
@@ -1216,6 +1216,8 @@ inline bool dict_index_t::reconstruct_fields()
12161216
{
12171217
DBUG_ASSERT(is_primary());
12181218

1219+
const auto old_n_fields = n_fields;
1220+
12191221
n_fields = (n_fields + table->instant->n_dropped)
12201222
& dict_index_t::MAX_N_FIELDS;
12211223
n_def = (n_def + table->instant->n_dropped)
@@ -1243,11 +1245,11 @@ inline bool dict_index_t::reconstruct_fields()
12431245
} else {
12441246
DBUG_ASSERT(!c.is_not_null());
12451247
const auto old = std::find_if(
1246-
fields + n_first, fields + n_fields,
1248+
fields + n_first, fields + old_n_fields,
12471249
[c](const dict_field_t& o)
12481250
{ return o.col->ind == c.ind(); });
12491251

1250-
if (old >= fields + n_fields
1252+
if (old >= fields + old_n_fields
12511253
|| old->prefix_len
12521254
|| old->col != &table->cols[c.ind()]) {
12531255
return true;

0 commit comments

Comments
 (0)