提交 68e2be03 编写于 作者: Y yihaoDeng

[TD-3086]<feature> tag support timestamp

上级 78f30314
......@@ -6820,6 +6820,7 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
// too long tag values will return invalid sql, not be truncated automatically
SSchema *pTagSchema = tscGetTableTagSchema(pStableMetaInfo->pTableMeta);
STableComInfo tinfo = tscGetTableInfo(pStableMetaInfo->pTableMeta);
STagData *pTag = &pCreateTableInfo->tagdata;
SKVRowBuilder kvRowBuilder = {0};
......@@ -6869,8 +6870,12 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3);
}
} else if (pSchema->type == TSDB_DATA_TYPE_TIMESTAMP) {
pItem->pVar.i64 =
convertTimePrecision(pItem->pVar.i64, TSDB_TIME_PRECISION_NANO, tinfo.precision);
}
ret = tVariantDump(&(pItem->pVar), tagVal, pSchema->type, true);
// check again after the convert since it may be converted from binary to nchar.
......@@ -6915,8 +6920,12 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg3);
}
} else if (pSchema->type == TSDB_DATA_TYPE_TIMESTAMP) {
pItem->pVar.i64 =
convertTimePrecision(pItem->pVar.i64, TSDB_TIME_PRECISION_NANO, tinfo.precision);
}
ret = tVariantDump(&(pItem->pVar), tagVal, pSchema->type, true);
// check again after the convert since it may be converted from binary to nchar.
......
......@@ -16,7 +16,6 @@
#ifndef TDENGINE_TTOKENDEF_H
#define TDENGINE_TTOKENDEF_H
#define TK_ID 1
#define TK_BOOL 2
#define TK_TINYINT 3
......@@ -128,29 +127,29 @@
#define TK_USING 109
#define TK_AS 110
#define TK_NULL 111
#define TK_SELECT 112
#define TK_UNION 113
#define TK_ALL 114
#define TK_DISTINCT 115
#define TK_FROM 116
#define TK_VARIABLE 117
#define TK_INTERVAL 118
#define TK_SESSION 119
#define TK_STATE_WINDOW 120
#define TK_FILL 121
#define TK_SLIDING 122
#define TK_ORDER 123
#define TK_BY 124
#define TK_ASC 125
#define TK_DESC 126
#define TK_GROUP 127
#define TK_HAVING 128
#define TK_LIMIT 129
#define TK_OFFSET 130
#define TK_SLIMIT 131
#define TK_SOFFSET 132
#define TK_WHERE 133
#define TK_NOW 134
#define TK_NOW 112
#define TK_SELECT 113
#define TK_UNION 114
#define TK_ALL 115
#define TK_DISTINCT 116
#define TK_FROM 117
#define TK_VARIABLE 118
#define TK_INTERVAL 119
#define TK_SESSION 120
#define TK_STATE_WINDOW 121
#define TK_FILL 122
#define TK_SLIDING 123
#define TK_ORDER 124
#define TK_BY 125
#define TK_ASC 126
#define TK_DESC 127
#define TK_GROUP 128
#define TK_HAVING 129
#define TK_LIMIT 130
#define TK_OFFSET 131
#define TK_SLIMIT 132
#define TK_SOFFSET 133
#define TK_WHERE 134
#define TK_RESET 135
#define TK_QUERY 136
#define TK_SYNCDB 137
......@@ -207,11 +206,6 @@
#define TK_VALUES 188
#define TK_SPACE 300
#define TK_COMMENT 301
#define TK_ILLEGAL 302
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册