1
0
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:
Marko Mäkelä
2022-02-23 15:31:36 +02:00
5 changed files with 19 additions and 17 deletions

View File

@@ -706,8 +706,8 @@ THD::THD(my_thread_id id, bool is_wsrep_applier)
/* wsrep-lib */ /* wsrep-lib */
m_wsrep_next_trx_id(WSREP_UNDEFINED_TRX_ID), m_wsrep_next_trx_id(WSREP_UNDEFINED_TRX_ID),
m_wsrep_mutex(LOCK_thd_data), m_wsrep_mutex(&LOCK_thd_data),
m_wsrep_cond(COND_wsrep_thd), m_wsrep_cond(&COND_wsrep_thd),
m_wsrep_client_service(this, m_wsrep_client_state), m_wsrep_client_service(this, m_wsrep_client_state),
m_wsrep_client_state(this, m_wsrep_client_state(this,
m_wsrep_mutex, m_wsrep_mutex,

View File

@@ -26,7 +26,7 @@ class Wsrep_condition_variable : public wsrep::condition_variable
{ {
public: public:
Wsrep_condition_variable(mysql_cond_t& cond) Wsrep_condition_variable(mysql_cond_t* cond)
: m_cond(cond) : m_cond(cond)
{ } { }
~Wsrep_condition_variable() ~Wsrep_condition_variable()
@@ -34,21 +34,21 @@ public:
void notify_one() void notify_one()
{ {
mysql_cond_signal(&m_cond); mysql_cond_signal(m_cond);
} }
void notify_all() void notify_all()
{ {
mysql_cond_broadcast(&m_cond); mysql_cond_broadcast(m_cond);
} }
void wait(wsrep::unique_lock<wsrep::mutex>& lock) void wait(wsrep::unique_lock<wsrep::mutex>& lock)
{ {
mysql_mutex_t* mutex= static_cast<mysql_mutex_t*>(lock.mutex()->native()); 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: private:
mysql_cond_t& m_cond; mysql_cond_t* m_cond;
}; };
#endif /* WSREP_CONDITION_VARIABLE_H */ #endif /* WSREP_CONDITION_VARIABLE_H */

View File

@@ -25,26 +25,26 @@
class Wsrep_mutex : public wsrep::mutex class Wsrep_mutex : public wsrep::mutex
{ {
public: public:
Wsrep_mutex(mysql_mutex_t& mutex) Wsrep_mutex(mysql_mutex_t* mutex)
: m_mutex(mutex) : m_mutex(mutex)
{ } { }
void lock() void lock()
{ {
mysql_mutex_lock(&m_mutex); mysql_mutex_lock(m_mutex);
} }
void unlock() void unlock()
{ {
mysql_mutex_unlock(&m_mutex); mysql_mutex_unlock(m_mutex);
} }
void* native() void* native()
{ {
return &m_mutex; return m_mutex;
} }
private: private:
mysql_mutex_t& m_mutex; mysql_mutex_t* m_mutex;
}; };
#endif /* WSREP_MUTEX_H */ #endif /* WSREP_MUTEX_H */

View File

@@ -43,8 +43,8 @@ Wsrep_server_state::Wsrep_server_state(const std::string& name,
initial_position, initial_position,
max_protocol_version, max_protocol_version,
wsrep::server_state::rm_sync) wsrep::server_state::rm_sync)
, m_mutex(LOCK_wsrep_server_state) , m_mutex(&LOCK_wsrep_server_state)
, m_cond(COND_wsrep_server_state) , m_cond(&COND_wsrep_server_state)
, m_service(*this) , m_service(*this)
{ } { }

View File

@@ -2,7 +2,7 @@
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. 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 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 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()); DBUG_ASSERT(is_primary());
const auto old_n_fields = n_fields;
n_fields = (n_fields + table->instant->n_dropped) n_fields = (n_fields + table->instant->n_dropped)
& dict_index_t::MAX_N_FIELDS; & dict_index_t::MAX_N_FIELDS;
n_def = (n_def + table->instant->n_dropped) n_def = (n_def + table->instant->n_dropped)
@@ -1243,11 +1245,11 @@ inline bool dict_index_t::reconstruct_fields()
} else { } else {
DBUG_ASSERT(!c.is_not_null()); DBUG_ASSERT(!c.is_not_null());
const auto old = std::find_if( 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) [c](const dict_field_t& o)
{ return o.col->ind == c.ind(); }); { return o.col->ind == c.ind(); });
if (old >= fields + n_fields if (old >= fields + old_n_fields
|| old->prefix_len || old->prefix_len
|| old->col != &table->cols[c.ind()]) { || old->col != &table->cols[c.ind()]) {
return true; return true;