Skip to content

Commit

Permalink
Update to version v3.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MadSchemas committed Aug 16, 2024
1 parent 07a1dff commit f058ec1
Show file tree
Hide file tree
Showing 608 changed files with 40,947 additions and 19,503 deletions.
8 changes: 4 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
Expand Down Expand Up @@ -136,7 +136,7 @@ IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertBraces: false
InsertBraces: true
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Expand Down Expand Up @@ -175,12 +175,12 @@ PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Leave
QualifierAlignment: Left
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
RemoveSemicolon: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
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.27.0"
const ReindexerVersion = "v3.28.0"

// public go consts from type_consts.h and reindexer_ctypes.h
const (
Expand Down
24 changes: 24 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# Version 3.28.0 (16.08.2024)
## Core
- [fea] Updated [logging library](https://github.com/gabime/spdlog) to v1.14.1 and [formatting library](https://github.com/fmtlib/fmt) to v11.0.2
- [fea] Optimized log level checks to avoid excessive serializtion in core logs
- [fea] Added support for [array_remove](readme.md#remove-array-elements-by-values) with scalar values in SQL
- [fea] Added support for [array_remove](readme.md#remove-array-elements-by-values) with non-integral values
- [fix] Disabled default values creation for object array indexes to avoid Go/Java connectors incompatibility
- [fix] Fixed sorted JOIN-subqueries over optimized `tree`-indexes with unordered conditions

## Reindexer server
- [fix] Fixed [docker's](https://hub.docker.com/r/reindexer/reindexer) SEGFAULT on M1 CPU

## Reindexer tool
- [fix] Fixed possible stucking in interactive mode on Windows

## Face
- [fea] Changed default value for `rtree` fields in 'new item' modal (now it's zero point instead of empty array)
- [fix] Fixed items table view (previously it could disapear in some rare cases depending on items contents)
- [fix] Fixed 'delete database' button
- [fix] Fixed `default stop words` behavior in fulltext index settings
- [fix] Fixed rendering of the last namespace in namespaces list
- [fix] Fixed links to the docs depending on the current chosen interface language
- [ref] Changed `bm25` grouping in fulltext index settings

# Version 3.27.0 (09.07.2024)
## Core
- [fea] Decreased heap allocations count in general selection pipeline
Expand Down
12 changes: 7 additions & 5 deletions 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.27.0")
set(REINDEXER_VERSION_DEFAULT "3.28.0")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
Expand Down Expand Up @@ -86,8 +86,8 @@ if(NOT MSVC AND NOT APPLE)
endif()

if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4244 -wd4267 -wd4996 -wd4717 -MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4244 -wd4267 -wd4996 -wd4717 -wd4800 -wd4396 -wd4503 -MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd4244 -wd4267 -wd4996 -wd4717 -MP -MD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4244 -wd4267 -wd4996 -wd4717 -wd4800 -wd4396 -wd4503 -MP -MD")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -SAFESEH:NO")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wswitch-enum")
Expand Down Expand Up @@ -296,7 +296,8 @@ set_source_files_properties (${REINDEXER_SOURCE_PATH}/core/storage/leveldblogger
list(APPEND REINDEXER_LIBRARIES reindexer)
add_library(${TARGET} STATIC ${HDRS} ${SRCS} ${VENDORS})
add_definitions(-DREINDEX_CORE_BUILD=1)

add_definitions(-DFMT_HEADER_ONLY=1)
add_definitions(-DSPDLOG_FMT_EXTERNAL=1)

# add_definitions(-DREINDEX_FT_EXTRA_DEBUG=1)

Expand Down Expand Up @@ -567,9 +568,10 @@ endif()

include_directories(${PROJECT_BINARY_DIR})

string ( REGEX REPLACE "(.*)([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)" "\\2.\\3.\\4" REINDEXER_VERSION ${REINDEXER_VERSION_FULL})
string ( REGEX REPLACE "v([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)" "\\1.\\2.\\3" REINDEXER_VERSION ${REINDEXER_VERSION_FULL})
string ( REGEX REPLACE ".*-([0-9]+)-(.*)" "\\1.\\2" REINDEXER_RELEASE ${REINDEXER_VERSION_FULL})
set(REINDEXER_VERSION_REDUCED ${REINDEXER_VERSION})

if(CMAKE_MATCH_1)
set(REINDEXER_VERSION ${REINDEXER_VERSION}.${REINDEXER_RELEASE})
endif()
Expand Down
46 changes: 25 additions & 21 deletions cpp_src/client/coroqueryresults.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ using namespace reindexer::net;
CoroQueryResults::CoroQueryResults(int fetchFlags)
: conn_(nullptr), fetchOffset_(0), fetchFlags_(fetchFlags), fetchAmount_(0), requestTimeout_(0) {}

CoroQueryResults::CoroQueryResults(net::cproto::CoroClientConnection *conn, NsArray &&nsArray, int fetchFlags, int fetchAmount,
CoroQueryResults::CoroQueryResults(net::cproto::CoroClientConnection* conn, NsArray&& nsArray, int fetchFlags, int fetchAmount,
seconds timeout)
: conn_(conn),
nsArray_(std::move(nsArray)),
Expand All @@ -21,7 +21,7 @@ CoroQueryResults::CoroQueryResults(net::cproto::CoroClientConnection *conn, NsAr
fetchAmount_(fetchAmount),
requestTimeout_(timeout) {}

CoroQueryResults::CoroQueryResults(net::cproto::CoroClientConnection *conn, NsArray &&nsArray, std::string_view rawResult, RPCQrId id,
CoroQueryResults::CoroQueryResults(net::cproto::CoroClientConnection* conn, NsArray&& nsArray, std::string_view rawResult, RPCQrId id,
int fetchFlags, int fetchAmount, seconds timeout)
: CoroQueryResults(conn, std::move(nsArray), fetchFlags, fetchAmount, timeout) {
Bind(rawResult, id);
Expand Down Expand Up @@ -61,7 +61,7 @@ void CoroQueryResults::Bind(std::string_view rawResult, RPCQrId id) {
RawResBufT::max_size(), rawResLen, fetchAmount_);
}
rawResult_.assign(copyStart, rawResult.end());
} catch (const Error &err) {
} catch (const Error& err) {
status_ = err;
}
}
Expand Down Expand Up @@ -98,7 +98,9 @@ void CoroQueryResults::fetchNextResults() {
h_vector<std::string_view, 1> CoroQueryResults::GetNamespaces() const {
h_vector<std::string_view, 1> ret;
ret.reserve(nsArray_.size());
for (auto &ns : nsArray_) ret.push_back(ns->name_);
for (auto& ns : nsArray_) {
ret.push_back(ns->name_);
}
return ret;
}

Expand All @@ -107,14 +109,14 @@ TagsMatcher CoroQueryResults::getTagsMatcher(int nsid) const { return nsArray_[n
class AdditionalRank : public IAdditionalDatasource<JsonBuilder> {
public:
AdditionalRank(double r) noexcept : rank_(r) {}
void PutAdditionalFields(JsonBuilder &builder) const override final { builder.Put("rank()", rank_); }
IEncoderDatasourceWithJoins *GetJoinsDatasource() noexcept override final { return nullptr; }
void PutAdditionalFields(JsonBuilder& builder) const override final { builder.Put("rank()", rank_); }
IEncoderDatasourceWithJoins* GetJoinsDatasource() noexcept override final { return nullptr; }

private:
double rank_;
};

void CoroQueryResults::Iterator::getJSONFromCJSON(std::string_view cjson, WrSerializer &wrser, bool withHdrLen) {
void CoroQueryResults::Iterator::getJSONFromCJSON(std::string_view cjson, WrSerializer& wrser, bool withHdrLen) {
auto tm = qr_->getTagsMatcher(itemParams_.nsid);
JsonEncoder enc(&tm);
JsonBuilder builder(wrser, ObjType::TypePlain);
Expand All @@ -136,7 +138,7 @@ void CoroQueryResults::Iterator::getJSONFromCJSON(std::string_view cjson, WrSeri
}
}

Error CoroQueryResults::Iterator::GetMsgPack(WrSerializer &wrser, bool withHdrLen) {
Error CoroQueryResults::Iterator::GetMsgPack(WrSerializer& wrser, bool withHdrLen) {
readNext();
int type = qr_->queryParams_.flags & kResultsFormatMask;
if (type == kResultsMsgPack) {
Expand All @@ -151,7 +153,7 @@ Error CoroQueryResults::Iterator::GetMsgPack(WrSerializer &wrser, bool withHdrLe
return errOK;
}

Error CoroQueryResults::Iterator::GetJSON(WrSerializer &wrser, bool withHdrLen) {
Error CoroQueryResults::Iterator::GetJSON(WrSerializer& wrser, bool withHdrLen) {
readNext();
try {
switch (qr_->queryParams_.flags & kResultsFormatMask) {
Expand All @@ -169,13 +171,13 @@ Error CoroQueryResults::Iterator::GetJSON(WrSerializer &wrser, bool withHdrLen)
default:
return Error(errParseBin, "Server returned data in unknown format %d", qr_->queryParams_.flags & kResultsFormatMask);
}
} catch (const Error &err) {
} catch (const Error& err) {
return err;
}
return errOK;
}

Error CoroQueryResults::Iterator::GetCJSON(WrSerializer &wrser, bool withHdrLen) {
Error CoroQueryResults::Iterator::GetCJSON(WrSerializer& wrser, bool withHdrLen) {
readNext();
try {
switch (qr_->queryParams_.flags & kResultsFormatMask) {
Expand All @@ -193,7 +195,7 @@ Error CoroQueryResults::Iterator::GetCJSON(WrSerializer &wrser, bool withHdrLen)
default:
return Error(errParseBin, "Server returned data in unknown format %d", qr_->queryParams_.flags & kResultsFormatMask);
}
} catch (const Error &err) {
} catch (const Error& err) {
return err;
}
return errOK;
Expand All @@ -215,7 +217,7 @@ Item CoroQueryResults::Iterator::GetItem() {
break;
}
case kResultsJson: {
char *endp = nullptr;
char* endp = nullptr;
err = item.FromJSON(itemParams_.data, &endp);
break;
}
Expand All @@ -226,7 +228,7 @@ Item CoroQueryResults::Iterator::GetItem() {
return item;
}
return Item();
} catch (const Error &) {
} catch (const Error&) {
return Item();
}
}
Expand All @@ -248,7 +250,9 @@ std::string_view CoroQueryResults::Iterator::GetRaw() {
}

void CoroQueryResults::Iterator::readNext() {
if (nextPos_ != 0) return;
if (nextPos_ != 0) {
return;
}

std::string_view rawResult(qr_->rawResult_.data(), qr_->rawResult_.size());

Expand All @@ -261,24 +265,24 @@ void CoroQueryResults::Iterator::readNext() {
(void)joinedCnt;
}
nextPos_ = pos_ + ser.Pos();
} catch (const Error &err) {
const_cast<CoroQueryResults *>(qr_)->status_ = err;
} catch (const Error& err) {
const_cast<CoroQueryResults*>(qr_)->status_ = err;
}
}

CoroQueryResults::Iterator &CoroQueryResults::Iterator::operator++() {
CoroQueryResults::Iterator& CoroQueryResults::Iterator::operator++() {
try {
readNext();
idx_++;
pos_ = nextPos_;
nextPos_ = 0;

if (idx_ != qr_->queryParams_.qcount && idx_ == qr_->queryParams_.count + qr_->fetchOffset_) {
const_cast<CoroQueryResults *>(qr_)->fetchNextResults();
const_cast<CoroQueryResults*>(qr_)->fetchNextResults();
pos_ = 0;
}
} catch (const Error &err) {
const_cast<CoroQueryResults *>(qr_)->status_ = err;
} catch (const Error& err) {
const_cast<CoroQueryResults*>(qr_)->status_ = err;
}

return *this;
Expand Down
2 changes: 1 addition & 1 deletion cpp_src/client/coroqueryresults.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CoroQueryResults {
Iterator& operator++();
Error Status() const noexcept { return qr_->status_; }
bool operator!=(const Iterator& other) const noexcept { return idx_ != other.idx_; }
bool operator==(const Iterator& other) const noexcept { return idx_ == other.idx_; };
bool operator==(const Iterator& other) const noexcept { return idx_ == other.idx_; }
Iterator& operator*() { return *this; }
void readNext();
void getJSONFromCJSON(std::string_view cjson, WrSerializer& wrser, bool withHdrLen = true);
Expand Down
8 changes: 2 additions & 6 deletions cpp_src/client/cororeindexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ Error CoroReindexer::GetMeta(std::string_view nsName, const std::string& key, st
Error CoroReindexer::PutMeta(std::string_view nsName, const std::string& key, std::string_view data) {
return impl_->PutMeta(nsName, key, data, ctx_);
}
Error CoroReindexer::EnumMeta(std::string_view nsName, std::vector<std::string>& keys) {
return impl_->EnumMeta(nsName, keys, ctx_);
}
Error CoroReindexer::DeleteMeta(std::string_view nsName, const std::string& key) {
return impl_->DeleteMeta(nsName, key, ctx_);
}
Error CoroReindexer::EnumMeta(std::string_view nsName, std::vector<std::string>& keys) { return impl_->EnumMeta(nsName, keys, ctx_); }
Error CoroReindexer::DeleteMeta(std::string_view nsName, const std::string& key) { return impl_->DeleteMeta(nsName, key, ctx_); }
Error CoroReindexer::Delete(const Query& q, CoroQueryResults& result) { return impl_->Delete(q, result, ctx_); }
Error CoroReindexer::Select(std::string_view query, CoroQueryResults& result) { return impl_->Select(query, result, ctx_); }
Error CoroReindexer::Select(const Query& q, CoroQueryResults& result) { return impl_->Select(q, result, ctx_); }
Expand Down
Loading

0 comments on commit f058ec1

Please sign in to comment.