Skip to content

Commit

Permalink
Update to version v3.28.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MadSchemas committed Sep 19, 2024
1 parent 58055c4 commit 5cb8d1f
Show file tree
Hide file tree
Showing 42 changed files with 543 additions and 382 deletions.
4 changes: 2 additions & 2 deletions bindings/builtin/reindexer_cgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
extern "C" {
#endif

void reindexer_enable_go_logger();
void reindexer_disable_go_logger();
void reindexer_enable_go_logger(void);
void reindexer_disable_go_logger(void);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/builtin/symbolizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package builtin

// extern void cgoTraceback(void*);
// extern void cgoSymbolizer(void*);
// extern void cgoSignalsInit();
// extern void cgoSignalsInit(void);
import "C"
import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion bindings/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package bindings

const CInt32Max = int(^uint32(0) >> 1)

const ReindexerVersion = "v3.28.1"
const ReindexerVersion = "v3.28.2"

// public go consts from type_consts.h and reindexer_ctypes.h
const (
Expand Down
17 changes: 17 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Version 3.28.2 (19.09.2024)
## Core
- [fix] Fixed data race in cached comparators (`joins cache` may cause incorrect comparators deletion)
- [fix] Changed `select fields filters` behavior: incorrect fields in the filter will be ignored (instead of full filter reset)

## Go connector
- [fix] Unexported fields and fields, marked with `"json":-`, will not create indexes anymore (including nested ones). Check updated example [here](readme.md#nested-structs)
- [fix] Unexported fields, makred with `joined` now produce explicit error (previously such fields silently did not work)

## Deploy
- [fea] Added `RedOS 8` prebuilt packages

## Face
- [fea] Changed column tooltips on `Statistics->Queries` page
- [fea] Grouped slow log settings on `Database config` page
- [fix] Fixed the `JOIN` links in `Explain result` table

# Version 3.28.1 (05.09.2024)
## Core
- [fix] Fixed pagination for `MERGE` fulltext queries. Previously those queries could return duplicates on different pages due to missing ordering guarantees
Expand Down
2 changes: 1 addition & 1 deletion cpp_src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ else()
option(LINK_RESOURCES "Link web resources as binary data" ON)
endif()

set(REINDEXER_VERSION_DEFAULT "3.28.1")
set(REINDEXER_VERSION_DEFAULT "3.28.2")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
Expand Down
7 changes: 7 additions & 0 deletions cpp_src/cmake/modules/RxPrepareInstallFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ endif()
function(generate_libs_list INPUT_LIBS OUTPUT_LIST_NAME)
set (flibs ${${OUTPUT_LIST_NAME}})
foreach(lib ${INPUT_LIBS})
get_filename_component(lib_dir ${lib} DIRECTORY)
if (NOT ${lib_dir} STREQUAL "")
set(lib_dir " -L${lib_dir}")
if (NOT (${lib_dir} IN_LIST flibs))
list(APPEND flibs ${lib_dir})
endif()
endif()
if (${lib} MATCHES "jemalloc" OR ${lib} MATCHES "tcmalloc")
elseif(${lib} STREQUAL "-pthread")
list(APPEND flibs " -lpthread")
Expand Down
13 changes: 8 additions & 5 deletions cpp_src/cmd/reindexer_tool/commandsprocessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Error CommandsProcessor<DBInterface>::process(const std::string& command) {
template <typename DBInterface>
template <typename T>
void CommandsProcessor<DBInterface>::setCompletionCallback(T& rx, void (T::*set_completion_callback)(const new_v_callback_t&)) {
(rx.*set_completion_callback)([this](const std::string& input, int) -> replxx::Replxx::completions_t {
(rx.*set_completion_callback)([this](const std::string& input, int) {
std::vector<std::string> completions;
const auto err = executor_.GetSuggestions(input, completions);
replxx::Replxx::completions_t result;
Expand All @@ -47,13 +47,16 @@ template <typename DBInterface>
template <typename T>
void CommandsProcessor<DBInterface>::setCompletionCallback(T& rx, void (T::*set_completion_callback)(const old_v_callback_t&, void*)) {
(rx.*set_completion_callback)(
[this](const std::string& input, int, void*) -> replxx::Replxx::completions_t {
[this](const std::string& input, int, void*) {
std::vector<std::string> completions;
const auto err = executor_.GetSuggestions(input, completions);
if (!err.ok()) {
return {};
replxx::Replxx::completions_t result;
if (err.ok()) {
for (const std::string& suggestion : completions) {
result.emplace_back(suggestion);
}
}
return completions;
return result;
},
nullptr);
}
Expand Down
6 changes: 3 additions & 3 deletions cpp_src/core/cbinding/reindexer_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern "C" {
#include "core/type_consts.h"
#include "reindexer_ctypes.h"

uintptr_t init_reindexer();
uintptr_t init_reindexer(void);
uintptr_t init_reindexer_with_config(reindexer_config config);

void destroy_reindexer(uintptr_t rx);
Expand Down Expand Up @@ -66,9 +66,9 @@ reindexer_error reindexer_delete_meta(uintptr_t rx, reindexer_string ns, reindex
reindexer_error reindexer_cancel_context(reindexer_ctx_info ctx_info, ctx_cancel_type how);

void reindexer_enable_logger(void (*logWriter)(int level, char* msg));
void reindexer_disable_logger();
void reindexer_disable_logger(void);

void reindexer_init_locale();
void reindexer_init_locale(void);

#ifdef __cplusplus
}
Expand Down
3 changes: 2 additions & 1 deletion cpp_src/core/indexdef.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ bool isStore(IndexType type) noexcept {

Error IndexDef::FromJSON(span<char> json) {
try {
IndexDef::FromJSON(gason::JsonParser().Parse(json));
gason::JsonParser parser;
IndexDef::FromJSON(parser.Parse(json));
} catch (const gason::Exception& ex) {
return Error(errParseJson, "IndexDef: %s", ex.what());
} catch (const Error& err) {
Expand Down
3 changes: 2 additions & 1 deletion cpp_src/core/namespacedef.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ namespace reindexer {

Error NamespaceDef::FromJSON(span<char> json) {
try {
FromJSON(gason::JsonParser().Parse(json));
gason::JsonParser parser;
FromJSON(parser.Parse(json));
} catch (const gason::Exception& ex) {
return Error(errParseJson, "NamespaceDef: %s", ex.what());
} catch (const Error& err) {
Expand Down
56 changes: 27 additions & 29 deletions cpp_src/core/nsselecter/comparator/comparator_indexed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,31 @@ typename reindexer::comparators::ValuesHolder<reindexer::key_string, Cond>::Type
}
}

template <typename T, CondType Cond>
void initComparator(const reindexer::VariantArray& from, typename reindexer::comparators::ValuesHolder<T, Cond>::Type& to) {
if constexpr (Cond == CondSet) {
for (const reindexer::Variant& v : from) {
to.insert(reindexer::comparators::GetValue<T>(v));
}
} else if constexpr (Cond == CondAllSet) {
int i = 0;
for (const reindexer::Variant& v : from) {
to.values_.emplace(reindexer::comparators::GetValue<T>(v), i);
++i;
}
template <typename T, typename SetT>
void initComparatorSet(const reindexer::VariantArray& from, reindexer::comparators::DataHolder<T>& to, SetT&& set) {
for (const reindexer::Variant& v : from) {
set.insert(reindexer::comparators::GetValue<T>(v));
}
using SetWrpType = typename reindexer::comparators::DataHolder<T>::SetWrpType;
to.setPtr_ = reindexer::make_intrusive<SetWrpType>(std::forward<SetT>(set));
}

template <typename T, typename SetT>
void initComparatorAllSet(const reindexer::VariantArray& from, reindexer::comparators::DataHolder<T>& to, SetT&& set) {
int i = 0;
for (const reindexer::Variant& v : from) {
set.values_.emplace(reindexer::comparators::GetValue<T>(v), i);
++i;
}
using AllSetType = typename reindexer::comparators::DataHolder<T>::AllSetType;
to.allSetPtr_ = std::make_unique<AllSetType>(std::forward<SetT>(set));
}

template <typename T>
void initComparator(CondType cond, const reindexer::VariantArray& from, reindexer::comparators::DataHolder<T>& to) {
using namespace reindexer::comparators;
using SetWrpType = typename DataHolder<T>::SetWrpType;
using AllSetWrpType = typename DataHolder<T>::AllSetWrpType;
using SetType = typename DataHolder<T>::SetType;
using AllSetType = typename DataHolder<T>::AllSetType;
switch (cond) {
case CondEq:
case CondLt:
Expand All @@ -118,12 +123,10 @@ void initComparator(CondType cond, const reindexer::VariantArray& from, reindexe
to.value2_ = GetValue<T>(cond, from, 1);
break;
case CondSet:
to.setPtr_ = make_intrusive<SetWrpType>();
initComparator<T, CondSet>(from, *to.setPtr_);
initComparatorSet(from, to, SetType{});
break;
case CondAllSet:
to.allSetPtr_ = make_intrusive<AllSetWrpType>();
initComparator<T, CondAllSet>(from, *to.allSetPtr_);
initComparatorAllSet(from, to, AllSetType{});
break;
case CondAny:
case CondEmpty:
Expand All @@ -139,8 +142,6 @@ void initStringComparator(CondType cond, const reindexer::VariantArray& from, re
using namespace reindexer::comparators;
using SetType = DataHolder<reindexer::key_string>::SetType;
using AllSetType = DataHolder<reindexer::key_string>::AllSetType;
using SetWrpType = DataHolder<reindexer::key_string>::SetWrpType;
using AllSetWrpType = DataHolder<reindexer::key_string>::AllSetWrpType;
switch (cond) {
case CondEq:
case CondLt:
Expand All @@ -155,12 +156,10 @@ void initStringComparator(CondType cond, const reindexer::VariantArray& from, re
to.value2_ = GetValue<reindexer::key_string>(cond, from, 1);
break;
case CondSet:
to.setPtr_ = make_intrusive<SetWrpType>(SetType{collate});
initComparator<reindexer::key_string, CondSet>(from, *to.setPtr_);
initComparatorSet(from, to, SetType{collate});
break;
case CondAllSet:
to.allSetPtr_ = make_intrusive<AllSetWrpType>(AllSetType{collate, {}});
initComparator<reindexer::key_string, CondAllSet>(from, *to.allSetPtr_);
initComparatorAllSet(from, to, AllSetType{collate, {}});
break;
case CondAny:
case CondEmpty:
Expand Down Expand Up @@ -499,13 +498,12 @@ ComparatorIndexedComposite::ComparatorIndexedComposite(const VariantArray& value
value2_ = GetValue<PayloadValue>(cond, values, 1);
break;
case CondSet:
setPtr_ = make_intrusive<SetWrpType>(SetType{values.size(), reindexer::hash_composite_ref{payloadType, fields},
reindexer::equal_composite_ref{payloadType, fields}});
initComparator<PayloadValue, CondSet>(values, *setPtr_);
initComparatorSet(values, *this,
SetType{values.size(), reindexer::hash_composite_ref{payloadType, fields},
reindexer::equal_composite_ref{payloadType, fields}});
break;
case CondAllSet:
allSetPtr_ = make_intrusive<AllSetWrpType>(AllSetType{{reindexer::PayloadType{payloadType}, reindexer::FieldsSet{fields}}, {}});
initComparator<PayloadValue, CondAllSet>(values, *allSetPtr_);
initComparatorAllSet(values, *this, AllSetType{{reindexer::PayloadType{payloadType}, reindexer::FieldsSet{fields}}, {}});
break;
case CondAny:
case CondEmpty:
Expand Down
Loading

0 comments on commit 5cb8d1f

Please sign in to comment.