fixed: in 'left join' statements there were not table indices used

added: now we set flag save_mode = DO_NOTHING_ON_SAVE for objects for which
       all fields from a database result set are null



git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1210 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2019-09-18 12:29:20 +00:00
parent afce2234c3
commit ba5f702257
11 changed files with 126 additions and 62 deletions

View File

@@ -203,9 +203,13 @@ public:
{
if( query_result->cur_row < query_result->result_rows )
{
result.set_save_mode(Model::DO_UPDATE_ON_SAVE); // IMPROVE ME check if there is a primary key
result.map_values_from_query();
result.after_select();
if( result.found() )
{
result.after_select();
}
query_result->cur_row += 1;
}
else
@@ -320,7 +324,6 @@ protected:
{
result.emplace_back(); // it returns a reference from c++17
ModelClass & added_model = result.back();
ModelEnv model_env_local;
try
@@ -338,7 +341,6 @@ protected:
added_model.model_env = &model_env_local;
added_model.model_env->cursor_helper = &cursor_helper;
added_model.model_env->finder_helper = &finder_helper;
added_model.set_save_mode(Model::DO_UPDATE_ON_SAVE); // IMPROVE ME check if there is a primary key
added_model.model_env->model_data = model_data;
if( !cursor_helper.has_autogenerated_select && cursor_helper.use_table_prefix_for_fetching_values )
@@ -348,7 +350,11 @@ protected:
added_model.before_select();
added_model.map_values_from_query();
added_model.after_select();
if( added_model.found() )
{
added_model.after_select();
}
}
catch(...)
{