opti:parse value in schemaless
This commit is contained in:
parent
efee9afad9
commit
bc8eb40f5f
|
@ -148,8 +148,8 @@ static int32_t smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pVal->value[0] == 't' || pVal->value[0] == 'T'){
|
if (pVal->value[0] == 't' || pVal->value[0] == 'T'){
|
||||||
if(pVal->length == 1 || (pVal->length == 4 && (pVal->value[1] == 'u' || pVal->value[1] == 'U')
|
if(pVal->length == 1 || (pVal->length == 4 && (pVal->value[1] == 'r' || pVal->value[1] == 'R')
|
||||||
&& (pVal->value[2] == 'r' || pVal->value[2] == 'R')
|
&& (pVal->value[2] == 'u' || pVal->value[2] == 'U')
|
||||||
&& (pVal->value[3] == 'e' || pVal->value[3] == 'E'))){
|
&& (pVal->value[3] == 'e' || pVal->value[3] == 'E'))){
|
||||||
pVal->i = TSDB_TRUE;
|
pVal->i = TSDB_TRUE;
|
||||||
pVal->type = TSDB_DATA_TYPE_BOOL;
|
pVal->type = TSDB_DATA_TYPE_BOOL;
|
||||||
|
@ -492,6 +492,7 @@ static int32_t smlParseColKv(SSmlHandle *info, char **sql, char *sqlEnd,
|
||||||
SSmlKv kv = {.key = key, .keyLen = keyLen, .value = value, .length = valueLen};
|
SSmlKv kv = {.key = key, .keyLen = keyLen, .value = value, .length = valueLen};
|
||||||
int32_t ret = smlParseValue(&kv, &info->msgBuf);
|
int32_t ret = smlParseValue(&kv, &info->msgBuf);
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
|
smlBuildInvalidDataMsg(&info->msgBuf, "smlParseValue error", value);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,7 @@ TEST(testCase, smlParseCols_Test) {
|
||||||
info->protocol = TSDB_SML_LINE_PROTOCOL;
|
info->protocol = TSDB_SML_LINE_PROTOCOL;
|
||||||
info->dataFormat = false;
|
info->dataFormat = false;
|
||||||
SSmlLineInfo elements = {0};
|
SSmlLineInfo elements = {0};
|
||||||
|
info->msgBuf = msgBuf;
|
||||||
|
|
||||||
const char *data =
|
const char *data =
|
||||||
"st,t=1 cb\\=in=\"pass\\,it "
|
"st,t=1 cb\\=in=\"pass\\,it "
|
||||||
|
|
Loading…
Reference in New Issue