diff --git a/parser.cpp b/parser.cpp index d7334d7..c98b772 100644 --- a/parser.cpp +++ b/parser.cpp @@ -329,7 +329,7 @@ namespace usql { m_lexer.skipToken(TokenType::keyword_by); do { - int col_index = -1; + int col_index = FUNCTION_CALL; bool asc = true; auto token_type = m_lexer.tokenType(); diff --git a/parser.h b/parser.h index 763fdcd..a5f2d65 100644 --- a/parser.h +++ b/parser.h @@ -8,6 +8,8 @@ #include #include +static const int FUNCTION_CALL = -1; + namespace usql { enum class ColumnType { diff --git a/usql.cpp b/usql.cpp index d6d5c0c..84028b2 100644 --- a/usql.cpp +++ b/usql.cpp @@ -199,7 +199,7 @@ std::unique_ptr USql::execute_select(SelectFromTableNode &node) { for (auto idx = 0; idx < result->columns_count(); idx++) { auto row_col_index = source_table_col_index[idx]; - if (row_col_index == -1) { // TODO introduce constant here + if (row_col_index == FUNCTION_CALL) { auto evaluated_value = eval_value_node(table, *row, node.cols_names->operator[](idx).value.get()); ValueNode *col_value = evaluated_value.get();