From 0890f27fe5733ba8bcfe8ab13e3014b77659c7df Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 26 Sep 2019 17:15:00 +0000 Subject: [PATCH] fixed: Finder didn't use ModelData structure when creating the select query ModelData structure was used only later in Cursor fixed: in Finder::select(PT::TextStream & out_stream, ModelConnector & model_connector) and Finder::select(PT::TextStream & out_stream, ModelConnector * model_connector) there was 'out_stream' parameter ignored git-svn-id: svn://ttmath.org/publicrep/morm/branches/stable-2019-03-29@1222 e52654a7-88a9-db11-a3e9-0013d4bc506e --- src/finder.h | 7 +++++-- src/model.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/finder.h b/src/finder.h index 0fdb3a3..80e66ff 100644 --- a/src/finder.h +++ b/src/finder.h @@ -220,7 +220,6 @@ public: { this->out_stream = &out_stream; this->model_connector = &model_connector; - set_out_stream(); return select(); } @@ -229,7 +228,6 @@ public: { this->out_stream = &out_stream; this->model_connector = model_connector; - set_out_stream(); return select(); } @@ -242,6 +240,11 @@ public: prepare_to_select(); } + model.set_connector(model_connector); + model.model_data = model_data; + // we don't have to clear the model because it is not returned to the user + // the returned model is from Cursor + if( model_connector && out_stream ) { (*out_stream) << "SELECT "; diff --git a/src/model.h b/src/model.h index 730af48..bc37bcc 100644 --- a/src/model.h +++ b/src/model.h @@ -977,7 +977,7 @@ protected: virtual bool is_empty_field(const wchar_t * value); -// template friend class Finder; + template friend class Finder; template friend class Cursor; friend class BaseExpression;