mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@@ -706,8 +706,8 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
|
||||
|
||||
/* wsrep-lib */
|
||||
m_wsrep_next_trx_id(WSREP_UNDEFINED_TRX_ID),
|
||||
m_wsrep_mutex(LOCK_thd_data),
|
||||
m_wsrep_cond(COND_wsrep_thd),
|
||||
m_wsrep_mutex(&LOCK_thd_data),
|
||||
m_wsrep_cond(&COND_wsrep_thd),
|
||||
m_wsrep_client_service(this, m_wsrep_client_state),
|
||||
m_wsrep_client_state(this,
|
||||
m_wsrep_mutex,
|
||||
|
@@ -26,7 +26,7 @@ class Wsrep_condition_variable : public wsrep::condition_variable
|
||||
{
|
||||
public:
|
||||
|
||||
Wsrep_condition_variable(mysql_cond_t& cond)
|
||||
Wsrep_condition_variable(mysql_cond_t* cond)
|
||||
: m_cond(cond)
|
||||
{ }
|
||||
~Wsrep_condition_variable()
|
||||
@@ -34,21 +34,21 @@ public:
|
||||
|
||||
void notify_one()
|
||||
{
|
||||
mysql_cond_signal(&m_cond);
|
||||
mysql_cond_signal(m_cond);
|
||||
}
|
||||
|
||||
void notify_all()
|
||||
{
|
||||
mysql_cond_broadcast(&m_cond);
|
||||
mysql_cond_broadcast(m_cond);
|
||||
}
|
||||
|
||||
void wait(wsrep::unique_lock<wsrep::mutex>& lock)
|
||||
{
|
||||
mysql_mutex_t* mutex= static_cast<mysql_mutex_t*>(lock.mutex()->native());
|
||||
mysql_cond_wait(&m_cond, mutex);
|
||||
mysql_cond_wait(m_cond, mutex);
|
||||
}
|
||||
private:
|
||||
mysql_cond_t& m_cond;
|
||||
mysql_cond_t* m_cond;
|
||||
};
|
||||
|
||||
#endif /* WSREP_CONDITION_VARIABLE_H */
|
||||
|
@@ -25,26 +25,26 @@
|
||||
class Wsrep_mutex : public wsrep::mutex
|
||||
{
|
||||
public:
|
||||
Wsrep_mutex(mysql_mutex_t& mutex)
|
||||
Wsrep_mutex(mysql_mutex_t* mutex)
|
||||
: m_mutex(mutex)
|
||||
{ }
|
||||
|
||||
void lock()
|
||||
{
|
||||
mysql_mutex_lock(&m_mutex);
|
||||
mysql_mutex_lock(m_mutex);
|
||||
}
|
||||
|
||||
void unlock()
|
||||
{
|
||||
mysql_mutex_unlock(&m_mutex);
|
||||
mysql_mutex_unlock(m_mutex);
|
||||
}
|
||||
|
||||
void* native()
|
||||
{
|
||||
return &m_mutex;
|
||||
return m_mutex;
|
||||
}
|
||||
private:
|
||||
mysql_mutex_t& m_mutex;
|
||||
mysql_mutex_t* m_mutex;
|
||||
};
|
||||
|
||||
#endif /* WSREP_MUTEX_H */
|
||||
|
@@ -43,8 +43,8 @@ Wsrep_server_state::Wsrep_server_state(const std::string& name,
|
||||
initial_position,
|
||||
max_protocol_version,
|
||||
wsrep::server_state::rm_sync)
|
||||
, m_mutex(LOCK_wsrep_server_state)
|
||||
, m_cond(COND_wsrep_server_state)
|
||||
, m_mutex(&LOCK_wsrep_server_state)
|
||||
, m_cond(&COND_wsrep_server_state)
|
||||
, m_service(*this)
|
||||
{ }
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
|
||||
Copyright (c) 2012, Facebook Inc.
|
||||
Copyright (c) 2013, 2021, MariaDB Corporation.
|
||||
Copyright (c) 2013, 2022, MariaDB Corporation.
|
||||
|
||||
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
|
||||
@@ -1216,6 +1216,8 @@ inline bool dict_index_t::reconstruct_fields()
|
||||
{
|
||||
DBUG_ASSERT(is_primary());
|
||||
|
||||
const auto old_n_fields = n_fields;
|
||||
|
||||
n_fields = (n_fields + table->instant->n_dropped)
|
||||
& dict_index_t::MAX_N_FIELDS;
|
||||
n_def = (n_def + table->instant->n_dropped)
|
||||
@@ -1243,11 +1245,11 @@ inline bool dict_index_t::reconstruct_fields()
|
||||
} else {
|
||||
DBUG_ASSERT(!c.is_not_null());
|
||||
const auto old = std::find_if(
|
||||
fields + n_first, fields + n_fields,
|
||||
fields + n_first, fields + old_n_fields,
|
||||
[c](const dict_field_t& o)
|
||||
{ return o.col->ind == c.ind(); });
|
||||
|
||||
if (old >= fields + n_fields
|
||||
if (old >= fields + old_n_fields
|
||||
|| old->prefix_len
|
||||
|| old->col != &table->cols[c.ind()]) {
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user