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

TD-6129<feature> add tag-> select logic

上级 93997f8b
...@@ -106,10 +106,6 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) { ...@@ -106,10 +106,6 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
* @param type * @param type
*/ */
void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32_t type) { void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32_t type) {
if(type == TSDB_DATA_TYPE_JSON){
if(JSON_TYPE_BINARY) type = TSDB_DATA_TYPE_BINARY;
else if(JSON_TYPE_NCHAR) type = TSDB_DATA_TYPE_NCHAR;
}
switch (type) { switch (type) {
case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_BOOL:
case TSDB_DATA_TYPE_TINYINT: { case TSDB_DATA_TYPE_TINYINT: {
...@@ -172,7 +168,8 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32 ...@@ -172,7 +168,8 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32
break; break;
} }
case TSDB_DATA_TYPE_BINARY:{ case TSDB_DATA_TYPE_BINARY:
case TSDB_DATA_TYPE_JSON:{
pVar->pz = calloc(len + 1, sizeof(char)); pVar->pz = calloc(len + 1, sizeof(char));
memcpy(pVar->pz, pz, len); memcpy(pVar->pz, pz, len);
pVar->nLen = (int32_t)len; pVar->nLen = (int32_t)len;
...@@ -898,7 +895,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc ...@@ -898,7 +895,7 @@ int32_t tVariantDumpEx(tVariant *pVariant, char *payload, int16_t type, bool inc
*(int8_t *)payload = TSDB_DATA_TINYINT_NULL; *(int8_t *)payload = TSDB_DATA_TINYINT_NULL;
} else if (pVariant->nType == TSDB_DATA_TYPE_BINARY){ } else if (pVariant->nType == TSDB_DATA_TYPE_BINARY){
*((int8_t *)payload) = TSDB_DATA_BINARY_PLACEHOLDER; *((int8_t *)payload) = TSDB_DATA_BINARY_PLACEHOLDER;
} else if (pVariant->nType == TSDB_DATA_TYPE_JSON){ // select * from stable, set tag type to json } else if (pVariant->nType == TSDB_DATA_TYPE_JSON){ // select * from stable, set tag type to json,from setTagValue/tag_project_function
memcpy(payload, pVariant->pz, pVariant->nLen); memcpy(payload, pVariant->pz, pVariant->nLen);
} else { } else {
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册