ColinLeeo commented on code in PR #418:
URL: https://github.com/apache/tsfile/pull/418#discussion_r1972984870


##########
cpp/src/cwrapper/tsfile_cwrapper.cc:
##########
@@ -344,73 +429,106 @@ ResultSetMetaData 
tsfile_result_set_get_metadata(ResultSet result_set) {
     return meta_data;
 }
 
-char *tsfile_result_set_meta_get_column_name(ResultSetMetaData result_set,
-                                             uint32_t column_index) {
+char *tsfile_result_set_metadata_get_column_name(ResultSetMetaData result_set,
+                                                 uint32_t column_index) {
+    if (column_index >= result_set.column_num) {
+        return nullptr;
+    }
     return result_set.column_names[column_index];
 }
 
-TSDataType tsfile_result_set_meta_get_data_type(ResultSetMetaData result_set,
-                                                uint32_t column_index) {
+TSDataType tsfile_result_set_metadata_get_data_type(
+    ResultSetMetaData result_set, uint32_t column_index) {
+    if (column_index < 0 || column_index >= result_set.column_num) {
+        return TS_DATATYPE_INVALID;
+    }

Review Comment:
   Well, this func only can return TSDataType.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@tsfile.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to