This is an automated email from the ASF dual-hosted git repository.
hongzhigao pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git
The following commit(s) were added to refs/heads/develop by this push:
new 6df6112b The TsFile-CPP query interface now validates column names
before querying. (#516)
6df6112b is described below
commit 6df6112b64b783dd05379c86dda98cd3d42eabd8
Author: Hongzhi Gao <[email protected]>
AuthorDate: Wed Jun 18 10:59:10 2025 +0800
The TsFile-CPP query interface now validates column names before querying.
(#516)
---
cpp/src/reader/table_query_executor.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/cpp/src/reader/table_query_executor.cc
b/cpp/src/reader/table_query_executor.cc
index c097c360..6249f9e7 100644
--- a/cpp/src/reader/table_query_executor.cc
+++ b/cpp/src/reader/table_query_executor.cc
@@ -49,6 +49,9 @@ int TableQueryExecutor::query(const std::string &table_name,
data_types.reserve(columns.size());
for (size_t i = 0; i < columns.size(); ++i) {
auto ind = table_schema->find_column_index(columns[i]);
+ if (ind < 0) {
+ return common::E_COLUMN_NOT_EXIST;
+ }
data_types.push_back(table_schema->get_data_types()[ind]);
}
// column_mapping.add(*measurement_filter);