Skip to content

Commit 6df6112

Browse files
authored
The TsFile-CPP query interface now validates column names before querying. (#516)
1 parent 2995362 commit 6df6112

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cpp/src/reader/table_query_executor.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ int TableQueryExecutor::query(const std::string &table_name,
4949
data_types.reserve(columns.size());
5050
for (size_t i = 0; i < columns.size(); ++i) {
5151
auto ind = table_schema->find_column_index(columns[i]);
52+
if (ind < 0) {
53+
return common::E_COLUMN_NOT_EXIST;
54+
}
5255
data_types.push_back(table_schema->get_data_types()[ind]);
5356
}
5457
// column_mapping.add(*measurement_filter);

0 commit comments

Comments
 (0)