diff --git a/pyreindexer/lib/include/queryresults_wrapper.h b/pyreindexer/lib/include/queryresults_wrapper.h index c907ed5..df26bc5 100644 --- a/pyreindexer/lib/include/queryresults_wrapper.h +++ b/pyreindexer/lib/include/queryresults_wrapper.h @@ -52,10 +52,8 @@ class QueryResultsWrapper { void FetchResults() { assert(wrap_); + // when results are fetched iterator closes and frees a memory of results buffer of Reindexer ++it_; - if (it_ == qres_.end()) { - it_ = qres_.begin(); - } } const std::vector& GetAggregationResults() & { return qres_.GetAggregationResults(); } diff --git a/pyreindexer/lib/src/rawpyreindexer.cc b/pyreindexer/lib/src/rawpyreindexer.cc index ab89279..8a54453 100644 --- a/pyreindexer/lib/src/rawpyreindexer.cc +++ b/pyreindexer/lib/src/rawpyreindexer.cc @@ -227,8 +227,7 @@ static PyObject* itemModify(PyObject* self, PyObject* args, ItemModifyMode mode) Py_DECREF(itemDefDict); - char* json = const_cast(wrSer.c_str()); - err = item.Unsafe().FromJSON(json, 0, mode == ModeDelete); + err = item.Unsafe().FromJSON(wrSer.c_str(), 0, mode == ModeDelete); if (!err.ok()) { Py_XDECREF(preceptsList); @@ -246,7 +245,7 @@ static PyObject* itemModify(PyObject* self, PyObject* args, ItemModifyMode mode) return pyErr(err); } - item.SetPrecepts(itemPrecepts); + item.SetPrecepts(itemPrecepts); // ToDo after migrate on v.4, do std::move } Py_XDECREF(preceptsList); @@ -515,8 +514,7 @@ static PyObject* itemModifyTransaction(PyObject* self, PyObject* args, ItemModif Py_DECREF(itemDefDict); - char* json = const_cast(wrSer.c_str()); - err = item.Unsafe().FromJSON(json, 0, mode == ModeDelete); + err = item.Unsafe().FromJSON(wrSer.c_str(), 0, mode == ModeDelete); if (!err.ok()) { Py_XDECREF(preceptsList); @@ -534,7 +532,7 @@ static PyObject* itemModifyTransaction(PyObject* self, PyObject* args, ItemModif return pyErr(err); } - item.SetPrecepts(itemPrecepts); + item.SetPrecepts(itemPrecepts); // ToDo after migrate on v.4, do std::move } Py_XDECREF(preceptsList); @@ -566,7 +564,6 @@ static PyObject* CommitTransaction(PyObject* self, PyObject* args) { auto transaction = getWrapper(transactionWrapperAddr); - assert((StopTransactionMode::Commit == stopMode) || (StopTransactionMode::Rollback == stopMode)); size_t count = 0; Error err = transaction->Commit(count); @@ -583,7 +580,6 @@ static PyObject* RollbackTransaction(PyObject* self, PyObject* args) { auto transaction = getWrapper(transactionWrapperAddr); - assert((StopTransactionMode::Commit == stopMode) || (StopTransactionMode::Rollback == stopMode)); Error err = transaction->Rollback(); wrapperDelete(transactionWrapperAddr); diff --git a/setup.py b/setup.py index e96db81..4219978 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,7 @@ def build_cmake(self, ext): setup(name=PACKAGE_NAME, - version='0.2.44', + version='0.2.45', description='A connector that allows to interact with Reindexer', author='Igor Tulmentyev', author_email='igtulm@gmail.com',