未验证 提交 4ebdb936 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #12448 from taosdata/feature/TD-14761

fea: add test case for schemaless
......@@ -201,18 +201,17 @@ typedef struct SExprInfo {
} SExprInfo;
typedef struct {
const char* key;
int32_t keyLen;
uint8_t type;
int16_t length;
const char* key;
int32_t keyLen;
uint8_t type;
union{
const char* value;
int64_t i;
uint64_t u;
double d;
float f;
int64_t i;
uint64_t u;
double d;
float f;
};
int32_t valueLen;
int32_t length;
} SSmlKv;
#define QUERY_ASC_FORWARD_STEP 1
......
此差异已折叠。
此差异已折叠。
......@@ -317,7 +317,11 @@ void buildChildTableName(RandTableName* rName) {
for (int j = 0; j < size; ++j) {
SSmlKv* tagKv = taosArrayGetP(rName->tags, j);
taosStringBuilderAppendStringLen(&sb, tagKv->key, tagKv->keyLen);
taosStringBuilderAppendStringLen(&sb, tagKv->value, tagKv->valueLen);
if(IS_VAR_DATA_TYPE(tagKv->type)){
taosStringBuilderAppendStringLen(&sb, tagKv->value, tagKv->length);
}else{
taosStringBuilderAppendStringLen(&sb, (char*)(&(tagKv->value)), tagKv->length);
}
}
size_t len = 0;
char* keyJoined = taosStringBuilderGetResult(&sb, &len);
......
......@@ -758,7 +758,7 @@ static int32_t KvRowAppend(SMsgBuf* pMsgBuf, const void* value, int32_t len, voi
int32_t output = 0;
if (!taosMbsToUcs4(value, len, (TdUcs4*)varDataVal(pa->buf), pa->schema->bytes - VARSTR_HEADER_SIZE, &output)) {
char buf[512] = {0};
snprintf(buf, tListLen(buf), "%s", strerror(errno));
snprintf(buf, tListLen(buf), " taosMbsToUcs4 error:%s", strerror(errno));
return buildSyntaxErrMsg(pMsgBuf, buf, value);
}
......@@ -1668,7 +1668,11 @@ static int32_t smlBuildTagRow(SArray* cols, SKVRowBuilder* tagsBuilder, SParsedD
SSchema* pTagSchema = &pSchema[tags->boundColumns[i] - 1]; // colId starts with 1
param.schema = pTagSchema;
SSmlKv* kv = taosArrayGetP(cols, i);
KvRowAppend(msg, kv->value, kv->valueLen, &param);
if(IS_VAR_DATA_TYPE(kv->type)){
KvRowAppend(msg, kv->value, kv->length, &param);
}else{
KvRowAppend(msg, &(kv->value), kv->length, &param);
}
}
*row = tdGetKVRowFromBuilder(tagsBuilder);
......@@ -1766,14 +1770,16 @@ int32_t smlBindData(void *handle, SArray *tags, SArray *colsSchema, SArray *cols
if (!kv || kv->length == 0) {
MemRowAppend(&pBuf, NULL, 0, &param);
} else {
int32_t colLen = pColSchema->bytes;
if (IS_VAR_DATA_TYPE(pColSchema->type)) {
colLen = kv->length;
} else if (pColSchema->type == TSDB_DATA_TYPE_TIMESTAMP) {
int32_t colLen = kv->length;
if (pColSchema->type == TSDB_DATA_TYPE_TIMESTAMP) {
kv->i = convertTimePrecision(kv->i, TSDB_TIME_PRECISION_NANO, pTableMeta->tableInfo.precision);
}
MemRowAppend(&pBuf, &(kv->value), colLen, &param);
if(IS_VAR_DATA_TYPE(kv->type)){
MemRowAppend(&pBuf, kv->value, colLen, &param);
}else{
MemRowAppend(&pBuf, &(kv->value), colLen, &param);
}
}
if (PRIMARYKEY_TIMESTAMP_COL_ID == pColSchema->colId) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册