fixed: add_field_for_select from Model incorrectly escaped a field string (column name)

fixed: Finder didn't use full table name (schema.table) in "from" clause
This commit is contained in:
2021-04-12 18:53:55 +02:00
parent 79fd642ef7
commit 9a4fd9b050
6 changed files with 47 additions and 27 deletions

View File

@@ -63,7 +63,7 @@ public:
virtual DbExpression & page(PT::TextStream & stream, size_t page_number, size_t page_size);
template<typename FieldValue>
void add_field_for_select(const wchar_t * new_column_expression, const wchar_t * new_column_name, FieldValue & field_value)
void add_field_for_select(const wchar_t * new_column_expression, const wchar_t * new_column_name, FieldValue & field_value, FT field_type, ModelEnv * model_env)
{
std::wstring column_expression; // field() methods can be called recursively, so don't make it as class object
@@ -71,9 +71,7 @@ public:
column_expression += L" as ";
column_expression += new_column_name;
// put nullptr to ModelEnv* to not allow to use prefix
// or may better remember current value of use_prefix and set it to false for a while?
field(column_expression.c_str(), field_value, false, false, false, nullptr);
field(column_expression.c_str(), field_value, field_type, model_env);
}