提交 3fadb431 编写于 作者: G Ganlin Zhao

[TD-10532]<enhance>: schemaless fix test cases

上级 c387f9a7
...@@ -1408,8 +1408,12 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType, SSml ...@@ -1408,8 +1408,12 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType, SSml
//Default no appendix //Default no appendix
if (isdigit(pVal[len - 1]) && isdigit(pVal[len - 2])) { if (isdigit(pVal[len - 1]) && isdigit(pVal[len - 2])) {
if (info->protocol == SML_LINE_PROTOCOL && info->tsType != SML_TIME_STAMP_NOT_CONFIGURED) { if (info->protocol == SML_LINE_PROTOCOL) {
*tsType = info->tsType; 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 == SML_TELNET_PROTOCOL) {
if (len == SML_TIMESTAMP_SECOND_DIGITS) { if (len == SML_TIMESTAMP_SECOND_DIGITS) {
*tsType = SML_TIME_STAMP_SECONDS; *tsType = SML_TIME_STAMP_SECONDS;
...@@ -1421,6 +1425,7 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType, SSml ...@@ -1421,6 +1425,7 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType, SSml
} }
return true; return true;
} }
if (pVal[len - 1] == 's') { if (pVal[len - 1] == 's') {
switch (pVal[len - 2]) { switch (pVal[len - 2]) {
case 'm': case 'm':
...@@ -1716,7 +1721,7 @@ static int32_t getTimeStampValue(char *value, uint16_t len, ...@@ -1716,7 +1721,7 @@ static int32_t getTimeStampValue(char *value, uint16_t len,
} }
//No appendix or no timestamp given (len = 0) //No appendix or no timestamp given (len = 0)
if (len >= 1 && isdigit(value[len - 1]) && type != SML_TIME_STAMP_NOW) { if (len != 0 && type != SML_TIME_STAMP_NOW) {
*ts = (int64_t)strtoll(value, NULL, 10); *ts = (int64_t)strtoll(value, NULL, 10);
} else { } else {
type = SML_TIME_STAMP_NOW; type = SML_TIME_STAMP_NOW;
......
...@@ -984,7 +984,7 @@ int32_t verify_schema_less(TAOS* taos) { ...@@ -984,7 +984,7 @@ int32_t verify_schema_less(TAOS* taos) {
char* lines2[] = { char* lines2[] = {
"stg,t1=3i64,t2=4f64,t3=\"t3\" c1=3i64,c3=L\"passit\",c2=false,c4=4f64 1626006833639000000", "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 1626006833640000000" "stg,t1=4i64,t3=\"t4\",t2=5f64,t4=5f64 c1=3i64,c3=L\"passitagin\",c2=true,c4=5f64,c5=5f64 1626006833641000000"
}; };
code = taos_schemaless_insert(taos, &lines2[0], 1, 0, "ns"); code = taos_schemaless_insert(taos, &lines2[0], 1, 0, "ns");
code = taos_schemaless_insert(taos, &lines2[1], 1, 0, "ns"); code = taos_schemaless_insert(taos, &lines2[1], 1, 0, "ns");
...@@ -1036,7 +1036,6 @@ int main(int argc, char *argv[]) { ...@@ -1036,7 +1036,6 @@ int main(int argc, char *argv[]) {
printf("************ verify schema-less *************\n"); printf("************ verify schema-less *************\n");
verify_schema_less(taos); verify_schema_less(taos);
return 0;
printf("************ verify query *************\n"); printf("************ verify query *************\n");
verify_query(taos); verify_query(taos);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册