feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters#17956
Conversation
Introduce TSDate_C for typed DATE inserts, ts_row_record_get_date_int32 and ts_row_record_get_string_byte_length, and expand c_rowDelete IT to cover DATE/BLOB readback and deletion paths.
Add TS_TYPE_STRING readback assertions alongside explicit TEXT checks in the RowRecord integration test.
There was a problem hiding this comment.
I found two issues before this is ready:
-
TS_TYPE_BLOBis still serialized throughstrlen(src)intoCharPtrVec, and the downstream insert buffer path also usesstrlen(values[i]). That silently truncates real binary payloads containing\0, while the PR title/API suggests BLOB support. The new test only uses the ASCII valueblobXY, so it does not catch this. Please add a length-aware BLOB write path/API, or narrow the claim and add coverage for embedded-NUL data. -
ts_row_record_get_date_int32can throw through the C ABI for the valid boundary date1000-01-01.parseDateExpressionToIntallows year 1000, butparseIntToDate(10000101)treats that same value as the empty-date sentinel, so reading that date back produces an invalidIoTDBDate; calling the new getter then callsparseDateExpressionToIntand may throw out of a C-linkage function. The getter should not throw, or the sentinel/range conflict should be fixed, with a regression test for1000-01-01.
apache#17956) * feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters Introduce TSDate_C for typed DATE inserts, ts_row_record_get_date_int32 and ts_row_record_get_string_byte_length, and expand c_rowDelete IT to cover DATE/BLOB readback and deletion paths. * test(client-cpp): cover TEXT and STRING in c_rowDelete IT Add TS_TYPE_STRING readback assertions alongside explicit TEXT checks in the RowRecord integration test. * chore(client-cpp): remove redundant TSDate_C comment
#17956) * feat(client-cpp): add SessionC DATE/BLOB support and RowRecord getters Introduce TSDate_C for typed DATE inserts, ts_row_record_get_date_int32 and ts_row_record_get_string_byte_length, and expand c_rowDelete IT to cover DATE/BLOB readback and deletion paths. * test(client-cpp): cover TEXT and STRING in c_rowDelete IT Add TS_TYPE_STRING readback assertions alongside explicit TEXT checks in the RowRecord integration test. * chore(client-cpp): remove redundant TSDate_C comment
Summary
TSDate_Cfor typedTS_TYPE_DATEinserts in the C APIts_row_record_get_date_int32andts_row_record_get_string_byte_lengthfor query result readbackTS_TYPE_DATEhandling in typed insert (toCharPtrVec/freeCharPtrVec)c_rowDeleteIT to cover DATE/BLOB and the new RowRecord gettersTest plan
./session_c_tests "[c_rowDelete]"mvn -P with-cpp -pl iotdb-client/client-cpp -am verify(sessionCIT passed)