mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-05 22:43:15 +00:00
cql3: fix query_options::DEFAULT not smp safe
Contains a shared_ptr (inside specific_options), so cannot be global. Make it thread_local instead.
This commit is contained in:
committed by
Tomasz Grabiec
parent
d81320a2dd
commit
538c7fdf2a
@@ -26,9 +26,9 @@
|
||||
|
||||
namespace cql3 {
|
||||
|
||||
const query_options::specific_options query_options::specific_options::DEFAULT{-1, {}, {}, api::missing_timestamp};
|
||||
thread_local const query_options::specific_options query_options::specific_options::DEFAULT{-1, {}, {}, api::missing_timestamp};
|
||||
|
||||
default_query_options query_options::DEFAULT{db::consistency_level::ONE,
|
||||
thread_local default_query_options query_options::DEFAULT{db::consistency_level::ONE,
|
||||
{}, false, query_options::specific_options::DEFAULT, 3, serialization_format::use_32_bit()};
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
explicit query_options(serialization_format sf) : _serialization_format(sf) {}
|
||||
// Options that are likely to not be present in most queries
|
||||
struct specific_options final {
|
||||
static const specific_options DEFAULT;
|
||||
static thread_local const specific_options DEFAULT;
|
||||
|
||||
const int32_t page_size;
|
||||
const ::shared_ptr<service::pager::paging_state> state;
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
};
|
||||
|
||||
// It can't be const because of prepare()
|
||||
static default_query_options DEFAULT;
|
||||
static thread_local default_query_options DEFAULT;
|
||||
|
||||
virtual ~query_options() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user