c language sample program modification
This commit is contained in:
parent
c1e5a6e6f9
commit
42c7b6ca33
|
@ -92,7 +92,6 @@ void* prepare_data(void* arg) {
|
||||||
|
|
||||||
// ANCHOR: msg_process
|
// ANCHOR: msg_process
|
||||||
int32_t msg_process(TAOS_RES* msg) {
|
int32_t msg_process(TAOS_RES* msg) {
|
||||||
char buf[1024]; // buf to store the row content
|
|
||||||
int32_t rows = 0;
|
int32_t rows = 0;
|
||||||
const char* topicName = tmq_get_topic_name(msg);
|
const char* topicName = tmq_get_topic_name(msg);
|
||||||
const char* dbName = tmq_get_db_name(msg);
|
const char* dbName = tmq_get_db_name(msg);
|
||||||
|
@ -371,8 +370,8 @@ void consume_repeatly(tmq_t* tmq) {
|
||||||
|
|
||||||
code = tmq_offset_seek(tmq, topic_name, p->vgId, p->begin);
|
code = tmq_offset_seek(tmq, topic_name, p->vgId, p->begin);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
fprintf(stderr, "Failed to seek offset, topic: %s, groupId: %s, clientId: %s, ErrCode: 0x%x, ErrMessage: %s.\n",
|
fprintf(stderr, "Failed to seek offset, topic: %s, groupId: %s, clientId: %s, vgId: %d, ErrCode: 0x%x, ErrMessage: %s.\n",
|
||||||
topic_name, config.group_id, config.client_id, code, tmq_err2str(code));
|
topic_name, config.group_id, config.client_id, p->vgId, code, tmq_err2str(code));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,6 @@ static int DemoWithReqId() {
|
||||||
|
|
||||||
fprintf(stdout, "query successfully, got %d fields, the sql is: %s.\n", num_fields, sql);
|
fprintf(stdout, "query successfully, got %d fields, the sql is: %s.\n", num_fields, sql);
|
||||||
|
|
||||||
|
|
||||||
// fetch the records row by row
|
// fetch the records row by row
|
||||||
while ((row = taos_fetch_row(result))) {
|
while ((row = taos_fetch_row(result))) {
|
||||||
// Add your data processing logic here
|
// Add your data processing logic here
|
||||||
|
|
Loading…
Reference in New Issue