提交 be8e2adc 编写于 作者: G Ganlin Zhao

fixed enum name with prefix TSDB

上级 219023f7
......@@ -23,7 +23,7 @@ extern "C" {
#define SML_TIMESTAMP_SECOND_DIGITS 10
#define SML_TIMESTAMP_MILLI_SECOND_DIGITS 13
typedef SML_PROTOCOL_TYPE SMLProtocolType;
typedef TSDB_SML_PROTOCOL_TYPE SMLProtocolType;
typedef struct {
char* key;
......
......@@ -1446,13 +1446,13 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType, SSml
//Default no appendix
if (isdigit(pVal[len - 1]) && isdigit(pVal[len - 2])) {
if (info->protocol == SML_LINE_PROTOCOL) {
if (info->protocol == TSDB_SML_LINE_PROTOCOL) {
if (info->tsType != SML_TIME_STAMP_NOT_CONFIGURED) {
*tsType = info->tsType;
} else {
*tsType = SML_TIME_STAMP_NANO_SECONDS;
}
} else if (info->protocol == SML_TELNET_PROTOCOL) {
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
if (len == SML_TIMESTAMP_SECOND_DIGITS) {
*tsType = SML_TIME_STAMP_SECONDS;
} else if (len == SML_TIMESTAMP_MILLI_SECOND_DIGITS) {
......@@ -2302,25 +2302,25 @@ cleanup:
static int32_t convertPrecisionType(int precision, SMLTimeStampType *tsType) {
switch (precision) {
case SML_TIMESTAMP_NOT_CONFIGURED:
case TSDB_SML_TIMESTAMP_NOT_CONFIGURED:
*tsType = SML_TIME_STAMP_NOT_CONFIGURED;
break;
case SML_TIMESTAMP_HOURS:
case TSDB_SML_TIMESTAMP_HOURS:
*tsType = SML_TIME_STAMP_HOURS;
break;
case SML_TIMESTAMP_MILLI_SECONDS:
case TSDB_SML_TIMESTAMP_MILLI_SECONDS:
*tsType = SML_TIME_STAMP_MILLI_SECONDS;
break;
case SML_TIMESTAMP_NANO_SECONDS:
case TSDB_SML_TIMESTAMP_NANO_SECONDS:
*tsType = SML_TIME_STAMP_NANO_SECONDS;
break;
case SML_TIMESTAMP_MICRO_SECONDS:
case TSDB_SML_TIMESTAMP_MICRO_SECONDS:
*tsType = SML_TIME_STAMP_MICRO_SECONDS;
break;
case SML_TIMESTAMP_SECONDS:
case TSDB_SML_TIMESTAMP_SECONDS:
*tsType = SML_TIME_STAMP_SECONDS;
break;
case SML_TIMESTAMP_MINUTES:
case TSDB_SML_TIMESTAMP_MINUTES:
*tsType = SML_TIME_STAMP_MINUTES;
break;
default:
......@@ -2376,7 +2376,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
int affected_rows = 0;
SMLTimeStampType tsType;
if (protocol == SML_LINE_PROTOCOL) {
if (protocol == TSDB_SML_LINE_PROTOCOL) {
code = convertPrecisionType(precision, &tsType);
if (code != TSDB_CODE_SUCCESS) {
return NULL;
......@@ -2384,13 +2384,13 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
}
switch (protocol) {
case SML_LINE_PROTOCOL:
case TSDB_SML_LINE_PROTOCOL:
code = taos_insert_lines(taos, lines, numLines, protocol, tsType, &affected_rows);
break;
case SML_TELNET_PROTOCOL:
case TSDB_SML_TELNET_PROTOCOL:
code = taos_insert_telnet_lines(taos, lines, numLines, protocol, tsType, &affected_rows);
break;
case SML_JSON_PROTOCOL:
case TSDB_SML_JSON_PROTOCOL:
code = taos_insert_json_payload(taos, *lines, protocol, tsType, &affected_rows);
break;
default:
......
......@@ -73,21 +73,21 @@ typedef enum {
} SET_CONF_RET_CODE;
typedef enum {
SML_UNKNOWN_PROTOCOL = 0,
SML_LINE_PROTOCOL = 1,
SML_TELNET_PROTOCOL = 2,
SML_JSON_PROTOCOL = 3,
} SML_PROTOCOL_TYPE;
TSDB_SML_UNKNOWN_PROTOCOL = 0,
TSDB_SML_LINE_PROTOCOL = 1,
TSDB_SML_TELNET_PROTOCOL = 2,
TSDB_SML_JSON_PROTOCOL = 3,
} TSDB_SML_PROTOCOL_TYPE;
typedef enum {
SML_TIMESTAMP_NOT_CONFIGURED = 0,
SML_TIMESTAMP_HOURS,
SML_TIMESTAMP_MINUTES,
SML_TIMESTAMP_SECONDS,
SML_TIMESTAMP_MILLI_SECONDS,
SML_TIMESTAMP_MICRO_SECONDS,
SML_TIMESTAMP_NANO_SECONDS,
} SML_TIMESTAMP_TYPE;
TSDB_SML_TIMESTAMP_NOT_CONFIGURED = 0,
TSDB_SML_TIMESTAMP_HOURS,
TSDB_SML_TIMESTAMP_MINUTES,
TSDB_SML_TIMESTAMP_SECONDS,
TSDB_SML_TIMESTAMP_MILLI_SECONDS,
TSDB_SML_TIMESTAMP_MICRO_SECONDS,
TSDB_SML_TIMESTAMP_NANO_SECONDS,
} TSDB_SML_TIMESTAMP_TYPE;
#define RET_MSG_LENGTH 1024
typedef struct setConfRet {
......
......@@ -316,7 +316,7 @@ void verify_schema_less(TAOS* taos) {
"stf,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 1626006933641000000"
};
result = taos_schemaless_insert(taos, lines , sizeof(lines)/sizeof(char*), SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, lines , sizeof(lines)/sizeof(char*), TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -328,7 +328,7 @@ void verify_schema_less(TAOS* taos) {
"stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000",
"stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833641000000"
};
result = taos_schemaless_insert(taos, &lines2[0], 1, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, &lines2[0], 1, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -336,7 +336,7 @@ void verify_schema_less(TAOS* taos) {
}
taos_free_result(result);
result = taos_schemaless_insert(taos, &lines2[1], 1, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, &lines2[1], 1, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -348,7 +348,7 @@ void verify_schema_less(TAOS* taos) {
"sth,t1=4i64,t2=5f64,t4=5f64,ID=childTable c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 1626006933641",
"sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin_stf\",c2=false,c5=5f64,c6=7u64 1626006933654"
};
result = taos_schemaless_insert(taos, lines3, 2, SML_LINE_PROTOCOL, SML_TIMESTAMP_MILLI_SECONDS);
result = taos_schemaless_insert(taos, lines3, 2, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_MILLI_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -360,7 +360,7 @@ void verify_schema_less(TAOS* taos) {
"st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000",
"dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532"
};
result = taos_schemaless_insert(taos, lines4, 2, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, lines4, 2, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -373,7 +373,7 @@ void verify_schema_less(TAOS* taos) {
"zqlbgs,id=zqlbgs_39302_21680,t0=f,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=f,c1=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000",
"zqlbgs,t9=f,id=zqlbgs_39302_21680,t0=f,t1=127i8,t11=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\",t10=L\"ncharTagValue\" c10=f,c0=f,c1=127i8,c12=127i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"binaryColValue\",c8=L\"ncharColValue\",c9=7u64,c11=L\"ncharColValue\" 1626006833639000000"
};
result = taos_schemaless_insert(taos, &lines5[0], 1, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, &lines5[0], 1, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -381,7 +381,7 @@ void verify_schema_less(TAOS* taos) {
}
taos_free_result(result);
result = taos_schemaless_insert(taos, &lines5[1], 1, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, &lines5[1], 1, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......@@ -393,7 +393,7 @@ void verify_schema_less(TAOS* taos) {
"st123456,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000",
"dgtyqodr,t2=5f64,t3=L\"ste\" c1=tRue,c2=4i64,c3=\"iam\" 1626056811823316532"
};
result = taos_schemaless_insert(taos, lines6, 2, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
result = taos_schemaless_insert(taos, lines6, 2, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
affected_rows = taos_affected_rows(result);
......
......@@ -99,8 +99,8 @@ int main(int argc, char* argv[]) {
int numFields = 13;
int maxLinesPerBatch = 16384;
int tsPrecision = SML_TIMESTAMP_NOT_CONFIGURED;
int lineProtocol = SML_UNKNOWN_PROTOCOL;
int tsPrecision = TSDB_SML_TIMESTAMP_NOT_CONFIGURED;
int lineProtocol = TSDB_SML_UNKNOWN_PROTOCOL;
int opt;
while ((opt = getopt(argc, argv, "s:c:r:f:t:m:p:P:h")) != -1) {
......
......@@ -26,7 +26,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb0_1 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"",
"stb0_2 1626006833639000000ns 4i8 host=\"host0\" interface=\"eth0\"",
};
result = taos_schemaless_insert(taos, lines0, 3, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines0, 3, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines0 code: %d, %s.\n", code, tstrerror(code));
......@@ -43,7 +43,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb1 1626006833651ms 6i8 host=\"host0\"",
"stb1 0 7i8 host=\"host0\"",
};
result = taos_schemaless_insert(taos, lines1, 7, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines1, 7, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines1 code: %d, %s.\n", code, tstrerror(code));
......@@ -56,7 +56,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_0 1626006833651ms -127i8 host=\"host0\"",
"stb2_0 1626006833652ms 127i8 host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_0, 2, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_0, 2, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_0 code: %d, %s.\n", code, tstrerror(code));
......@@ -68,7 +68,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_1 1626006833651ms -32767i16 host=\"host0\"",
"stb2_1 1626006833652ms 32767i16 host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_1, 2, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_1, 2, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_1 code: %d, %s.\n", code, tstrerror(code));
......@@ -80,7 +80,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_2 1626006833651ms -2147483647i32 host=\"host0\"",
"stb2_2 1626006833652ms 2147483647i32 host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_2, 2, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_2, 2, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_2 code: %d, %s.\n", code, tstrerror(code));
......@@ -92,7 +92,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_3 1626006833651ms -9223372036854775807i64 host=\"host0\"",
"stb2_3 1626006833652ms 9223372036854775807i64 host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_3, 2, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_3, 2, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_3 code: %d, %s.\n", code, tstrerror(code));
......@@ -112,7 +112,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_4 1626006833700ms 3.4E38f32 host=\"host0\"",
"stb2_4 1626006833710ms -3.4E38f32 host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_4, 10, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_4, 10, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_4 code: %d, %s.\n", code, tstrerror(code));
......@@ -133,7 +133,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_5 1626006833700ms -1.7E308f64 host=\"host0\"",
"stb2_5 1626006833710ms 3.15 host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_5, 11, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_5, 11, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_5 code: %d, %s.\n", code, tstrerror(code));
......@@ -153,7 +153,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_6 1626006833690ms False host=\"host0\"",
"stb2_6 1626006833700ms FALSE host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_6, 10, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_6, 10, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_6 code: %d, %s.\n", code, tstrerror(code));
......@@ -166,7 +166,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_7 1626006833620ms \"binary_val.:;,./?|+-=\" host=\"host0\"",
"stb2_7 1626006833630ms \"binary_val.()[]{}<>\" host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_7, 3, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_7, 3, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_7 code: %d, %s.\n", code, tstrerror(code));
......@@ -178,7 +178,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_8 1626006833610ms L\"nchar_val数值一\" host=\"host0\"",
"stb2_8 1626006833620ms L\"nchar_val数值二\" host=\"host0\""
};
result = taos_schemaless_insert(taos, lines2_8, 2, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines2_8, 2, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines2_8 code: %d, %s.\n", code, tstrerror(code));
......@@ -191,7 +191,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb3_0 1626006833610ms 1 t1=127i8 t2=32767i16 t3=2147483647i32 t4=9223372036854775807i64 t5=3.4E38f32 t6=1.7E308f64 t7=true t8=\"binary_val_1\" t9=L\"标签值1\"",
"stb3_0 1626006833610ms 2 t1=-127i8 t2=-32767i16 t3=-2147483647i32 t4=-9223372036854775807i64 t5=-3.4E38f32 t6=-1.7E308f64 t7=false t8=\"binary_val_2\" t9=L\"标签值2\""
};
result = taos_schemaless_insert(taos, lines3_0, 2, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines3_0, 2, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines3_0 code: %d, %s.\n", code, tstrerror(code));
......@@ -204,7 +204,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb3_1 1626006833610ms 2 host=host2 iD=child_table2",
"stb3_1 1626006833610ms 3 ID=child_table3 host=host3"
};
result = taos_schemaless_insert(taos, lines3_1, 3, SML_TELNET_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, lines3_1, 3, TSDB_SML_TELNET_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("lines3_1 code: %d, %s.\n", code, tstrerror(code));
......@@ -240,7 +240,7 @@ void verify_json_insert(TAOS* taos) {
} \
}"};
result = taos_schemaless_insert(taos, message, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, message, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload_0 code: %d, %s.\n", code, tstrerror(code));
......@@ -273,7 +273,7 @@ void verify_json_insert(TAOS* taos) {
} \
]"};
result = taos_schemaless_insert(taos, message1, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, message1, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload_1 code: %d, %s.\n", code, tstrerror(code));
......@@ -326,7 +326,7 @@ void verify_json_insert(TAOS* taos) {
} \
} \
]"};
result = taos_schemaless_insert(taos, message2, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, message2, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload_2 code: %d, %s.\n", code, tstrerror(code));
......@@ -352,7 +352,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload0_0 code: %d, %s.\n", code, tstrerror(code));
......@@ -375,7 +375,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload0_1 code: %d, %s.\n", code, tstrerror(code));
......@@ -398,7 +398,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload0_2 code: %d, %s.\n", code, tstrerror(code));
......@@ -421,7 +421,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload0_3 code: %d, %s.\n", code, tstrerror(code));
......@@ -444,7 +444,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload0_4 code: %d, %s.\n", code, tstrerror(code));
......@@ -475,7 +475,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload1_0 code: %d, %s.\n", code, tstrerror(code));
......@@ -503,7 +503,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload1_1 code: %d, %s.\n", code, tstrerror(code));
......@@ -531,7 +531,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload1_2 code: %d, %s.\n", code, tstrerror(code));
......@@ -559,7 +559,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload1_4 code: %d, %s.\n", code, tstrerror(code));
......@@ -593,7 +593,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_0 code: %d, %s.\n", code, tstrerror(code));
......@@ -625,7 +625,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_1 code: %d, %s.\n", code, tstrerror(code));
......@@ -657,7 +657,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_2 code: %d, %s.\n", code, tstrerror(code));
......@@ -689,7 +689,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_3 code: %d, %s.\n", code, tstrerror(code));
......@@ -721,7 +721,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_4 code: %d, %s.\n", code, tstrerror(code));
......@@ -753,7 +753,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_5 code: %d, %s.\n", code, tstrerror(code));
......@@ -785,7 +785,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_6 code: %d, %s.\n", code, tstrerror(code));
......@@ -817,7 +817,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_7 code: %d, %s.\n", code, tstrerror(code));
......@@ -849,7 +849,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload2_8 code: %d, %s.\n", code, tstrerror(code));
......@@ -931,7 +931,7 @@ void verify_json_insert(TAOS* taos) {
*payload_str = cJSON_Print(payload);
//printf("%s\n", payload_str);
result = taos_schemaless_insert(taos, payload_str, 0, SML_JSON_PROTOCOL, SML_TIMESTAMP_NOT_CONFIGURED);
result = taos_schemaless_insert(taos, payload_str, 0, TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_NOT_CONFIGURED);
code = taos_errno(result);
if (code) {
printf("payload3_0 code: %d, %s.\n", code, tstrerror(code));
......
......@@ -1085,7 +1085,7 @@ bool simExecuteLineInsertCmd(SScript *script, char *rest) {
simInfo("script:%s, %s", script->fileName, rest);
simLogSql(buf, true);
char* lines[] = {rest};
TAOS_RES *result = taos_schemaless_insert(script->taos, lines, 1, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
TAOS_RES *result = taos_schemaless_insert(script->taos, lines, 1, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
int32_t code = taos_errno(result);
if (code == TSDB_CODE_SUCCESS) {
simDebug("script:%s, taos:%p, %s executed. success.", script->fileName, script->taos, rest);
......@@ -1112,7 +1112,7 @@ bool simExecuteLineInsertErrorCmd(SScript *script, char *rest) {
simInfo("script:%s, %s", script->fileName, rest);
simLogSql(buf, true);
char * lines[] = {rest};
TAOS_RES *result = taos_schemaless_insert(script->taos, lines, 1, SML_LINE_PROTOCOL, SML_TIMESTAMP_NANO_SECONDS);
TAOS_RES *result = taos_schemaless_insert(script->taos, lines, 1, TSDB_SML_LINE_PROTOCOL, TSDB_SML_TIMESTAMP_NANO_SECONDS);
int32_t code = taos_errno(result);
if (code == TSDB_CODE_SUCCESS) {
sprintf(script->error, "script:%s, taos:%p, %s executed. expect failed, but success.", script->fileName, script->taos, rest);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册