提交 ee88b16a 编写于 作者: wmmhello's avatar wmmhello

fix:enable multi type for telnet

上级 284acb1f
......@@ -219,6 +219,7 @@ STableMeta* smlGetMeta(SSmlHandle *info, const void* measure, int32_t meas
int32_t is_same_child_table_telnet(const void *a, const void *b);
int64_t smlParseOpenTsdbTime(SSmlHandle *info, const char *data, int32_t len);
int32_t smlClearForRerun(SSmlHandle *info);
int32_t smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg);
int32_t smlParseInfluxString(SSmlHandle *info, char *sql, char *sqlEnd, SSmlLineInfo *elements);
int32_t smlParseTelnetString(SSmlHandle *info, char *sql, char *sqlEnd, SSmlLineInfo *elements);
......
......@@ -120,7 +120,7 @@ static int64_t smlParseInfluxTime(SSmlHandle *info, const char *data, int32_t le
return ts;
}
static int32_t smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) {
int32_t smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) {
if (pVal->value[0] == '"'){ // binary
if (pVal->length >= 2 && pVal->value[pVal->length - 1] == '"') {
pVal->type = TSDB_DATA_TYPE_BINARY;
......
......@@ -283,7 +283,7 @@ int32_t smlParseTelnetString(SSmlHandle *info, char *sql, char *sqlEnd, SSmlLine
}
SSmlKv kv = {.key = VALUE, .keyLen = VALUE_LEN, .value = elements->cols, .length = (size_t)elements->colsLen};
if (smlParseNumber(&kv, &info->msgBuf)) {
if (smlParseValue(&kv, &info->msgBuf)) {
kv.length = (int16_t)tDataTypes[kv.type].bytes;
}else{
return TSDB_CODE_TSC_INVALID_VALUE;
......
......@@ -76,13 +76,14 @@ class TDTestCase:
tdSql.query(f"select * from {dbname}.`sys.cpu.nice` order by _ts")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 9.000000000)
tdSql.checkData(0, 2, "lga")
tdSql.checkData(0, 3, "web02")
tdSql.checkData(0, 4, None)
tdSql.checkData(0, 2, "web02")
tdSql.checkData(0, 3, None)
tdSql.checkData(0, 4, "lga")
tdSql.checkData(1, 1, 18.000000000)
tdSql.checkData(1, 2, "lga")
tdSql.checkData(1, 3, "web01")
tdSql.checkData(1, 4, "t1")
tdSql.checkData(1, 2, "web01")
tdSql.checkData(1, 3, "t1")
tdSql.checkData(0, 4, "lga")
tdSql.query(f"select * from {dbname}.macylr")
tdSql.checkRows(2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册