Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2d8cd533
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2d8cd533
编写于
7月 27, 2022
作者:
G
gccgdb1234
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of github.com:taosdata/TDengine into 3.0
上级
020f1233
29564222
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
118 addition
and
18 deletion
+118
-18
cmake/taosadapter_CMakeLists.txt.in
cmake/taosadapter_CMakeLists.txt.in
+13
-0
cmake/taostools_CMakeLists.txt.in
cmake/taostools_CMakeLists.txt.in
+13
-0
cmake/taosws_CMakeLists.txt.in
cmake/taosws_CMakeLists.txt.in
+13
-0
contrib/CMakeLists.txt
contrib/CMakeLists.txt
+18
-0
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+1
-0
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+1
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+3
-2
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-0
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+1
-0
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+6
-5
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+47
-10
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-1
未找到文件。
cmake/taosadapter_CMakeLists.txt.in
0 → 100644
浏览文件 @
2d8cd533
# zlib
ExternalProject_Add(taosadapter
GIT_REPOSITORY https://github.com/taosdata/taosadapter.git
GIT_TAG df8678f
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
cmake/taostools_CMakeLists.txt.in
0 → 100644
浏览文件 @
2d8cd533
# zlib
ExternalProject_Add(taos-tools
GIT_REPOSITORY https://github.com/taosdata/taos-tools.git
GIT_TAG 817cb6a
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
cmake/taosws_CMakeLists.txt.in
0 → 100644
浏览文件 @
2d8cd533
# zlib
ExternalProject_Add(taosws-rs
GIT_REPOSITORY https://github.com/taosdata/taosws-rs.git
GIT_TAG 9de599d
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
contrib/CMakeLists.txt
浏览文件 @
2d8cd533
...
...
@@ -9,6 +9,24 @@ endfunction(cat IN_FILE OUT_FILE)
set
(
CONTRIB_TMP_FILE
"
${
CMAKE_BINARY_DIR
}
/deps_tmp_CMakeLists.txt.in"
)
configure_file
(
"
${
TD_SUPPORT_DIR
}
/deps_CMakeLists.txt.in"
${
CONTRIB_TMP_FILE
}
)
# taos-tools
if
(
${
BUILD_TOOLS
}
)
cat
(
"
${
TD_SUPPORT_DIR
}
/taostools_CMakeLists.txt.in"
${
CONTRIB_TMP_FILE
}
)
endif
()
# taosws-rs
if
(
${
WEBSOCKET
}
)
cat
(
"
${
TD_SUPPORT_DIR
}
/taosws_CMakeLists.txt.in"
${
CONTRIB_TMP_FILE
}
)
endif
()
# taosadapter
if
(
${
BUILD_HTTP
}
)
MESSAGE
(
"BUILD_HTTP is on"
)
else
()
MESSAGE
(
"BUILD_HTTP is off, use taosAdapter"
)
cat
(
"
${
TD_SUPPORT_DIR
}
/taosadapter_CMakeLists.txt.in"
${
CONTRIB_TMP_FILE
}
)
endif
()
# pthread
if
(
${
BUILD_PTHREAD
}
)
cat
(
"
${
TD_SUPPORT_DIR
}
/pthread_CMakeLists.txt.in"
${
CONTRIB_TMP_FILE
}
)
...
...
include/libs/nodes/querynodes.h
浏览文件 @
2d8cd533
...
...
@@ -375,6 +375,7 @@ typedef struct SQuery {
int8_t
precision
;
SCmdMsgInfo
*
pCmdMsg
;
int32_t
msgType
;
SArray
*
pTargetTableList
;
SArray
*
pTableList
;
SArray
*
pDbList
;
bool
showRewrite
;
...
...
source/client/inc/clientInt.h
浏览文件 @
2d8cd533
...
...
@@ -222,6 +222,7 @@ typedef struct SRequestObj {
int32_t
code
;
SArray
*
dbList
;
SArray
*
tableList
;
SArray
*
targetTableList
;
SQueryExecMetric
metric
;
SRequestSendRecvBody
body
;
bool
syncQuery
;
// todo refactor: async query object
...
...
source/client/src/clientImpl.c
浏览文件 @
2d8cd533
...
...
@@ -235,6 +235,7 @@ int32_t parseSql(SRequestObj* pRequest, bool topicQuery, SQuery** pQuery, SStmtC
if
(
TSDB_CODE_SUCCESS
==
code
||
NEED_CLIENT_HANDLE_ERROR
(
code
))
{
TSWAP
(
pRequest
->
dbList
,
(
*
pQuery
)
->
pDbList
);
TSWAP
(
pRequest
->
tableList
,
(
*
pQuery
)
->
pTableList
);
TSWAP
(
pRequest
->
targetTableList
,
(
*
pQuery
)
->
pTargetTableList
);
}
return
code
;
...
...
@@ -851,7 +852,7 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
tscDebug
(
"schedulerExecCb request type %s"
,
TMSG_INFO
(
pRequest
->
type
));
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
removeMeta
(
pTscObj
,
pRequest
->
tableList
);
removeMeta
(
pTscObj
,
pRequest
->
ta
rgetTa
bleList
);
}
// return to client
...
...
@@ -1094,7 +1095,7 @@ SRequestObj* execQuery(uint64_t connId, const char* sql, int sqlLen, bool valida
}
while
(
retryNum
++
<
REQUEST_TOTAL_EXEC_TIMES
);
if
(
NEED_CLIENT_RM_TBLMETA_REQ
(
pRequest
->
type
))
{
removeMeta
(
pRequest
->
pTscObj
,
pRequest
->
tableList
);
removeMeta
(
pRequest
->
pTscObj
,
pRequest
->
ta
rgetTa
bleList
);
}
return
pRequest
;
...
...
source/client/src/clientMain.c
浏览文件 @
2d8cd533
...
...
@@ -687,6 +687,7 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
TSWAP
(
pRequest
->
dbList
,
(
pQuery
)
->
pDbList
);
TSWAP
(
pRequest
->
tableList
,
(
pQuery
)
->
pTableList
);
TSWAP
(
pRequest
->
targetTableList
,
(
pQuery
)
->
pTargetTableList
);
destorySqlParseWrapper
(
pWrapper
);
...
...
source/client/src/clientStmt.c
浏览文件 @
2d8cd533
...
...
@@ -693,6 +693,7 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
TSWAP
(
pStmt
->
exec
.
pRequest
->
dbList
,
pStmt
->
sql
.
pQuery
->
pDbList
);
TSWAP
(
pStmt
->
exec
.
pRequest
->
tableList
,
pStmt
->
sql
.
pQuery
->
pTableList
);
TSWAP
(
pStmt
->
exec
.
pRequest
->
targetTableList
,
pStmt
->
sql
.
pQuery
->
pTargetTableList
);
// if (STMT_TYPE_QUERY == pStmt->sql.queryRes) {
// STMT_ERR_RET(stmtRestoreQueryFields(pStmt));
...
...
source/libs/executor/src/executil.c
浏览文件 @
2d8cd533
...
...
@@ -193,7 +193,7 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
pBlock
->
info
.
calWin
=
(
STimeWindow
){.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SSlotDescNode
*
pDescNode
=
(
SSlotDescNode
*
)
nodesListGetNode
(
pNode
->
pSlots
,
i
);
SSlotDescNode
*
pDescNode
=
(
SSlotDescNode
*
)
nodesListGetNode
(
pNode
->
pSlots
,
i
);
SColumnInfoData
idata
=
createColumnInfoData
(
pDescNode
->
dataType
.
type
,
pDescNode
->
dataType
.
bytes
,
pDescNode
->
slotId
);
idata
.
info
.
scale
=
pDescNode
->
dataType
.
scale
;
...
...
@@ -267,8 +267,9 @@ int32_t isQualifiedTable(STableKeyInfo* info, SNode* pTagCond, void* metaHandle,
code
=
metaGetTableEntryByUid
(
&
mr
,
info
->
uid
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
metaReaderClear
(
&
mr
);
*
pQualified
=
false
;
return
terrno
;
return
TSDB_CODE_SUCCESS
;
}
SNode
*
pTagCondTmp
=
nodesCloneNode
(
pTagCond
);
...
...
@@ -387,7 +388,7 @@ size_t getTableTagsBufLen(const SNodeList* pGroups) {
}
int32_t
getGroupIdFromTagsVal
(
void
*
pMeta
,
uint64_t
uid
,
SNodeList
*
pGroupNode
,
char
*
keyBuf
,
uint64_t
*
pGroupId
)
{
SMetaReader
mr
=
{
0
};
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pMeta
,
0
);
metaGetTableEntryByUid
(
&
mr
,
uid
);
...
...
@@ -395,7 +396,7 @@ int32_t getGroupIdFromTagsVal(void* pMeta, uint64_t uid, SNodeList* pGroupNode,
nodesRewriteExprsPostOrder
(
groupNew
,
doTranslateTagExpr
,
&
mr
);
char
*
isNull
=
(
char
*
)
keyBuf
;
char
*
pStart
=
(
char
*
)
keyBuf
+
sizeof
(
int8_t
)
*
LIST_LENGTH
(
pGroupNode
);
char
*
pStart
=
(
char
*
)
keyBuf
+
sizeof
(
int8_t
)
*
LIST_LENGTH
(
pGroupNode
);
SNode
*
pNode
;
int32_t
index
=
0
;
...
...
@@ -441,7 +442,7 @@ int32_t getGroupIdFromTagsVal(void* pMeta, uint64_t uid, SNodeList* pGroupNode,
}
}
int32_t
len
=
(
int32_t
)(
pStart
-
(
char
*
)
keyBuf
);
int32_t
len
=
(
int32_t
)(
pStart
-
(
char
*
)
keyBuf
);
*
pGroupId
=
calcGroupId
(
keyBuf
,
len
);
nodesDestroyList
(
groupNew
);
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
2d8cd533
...
...
@@ -39,6 +39,7 @@ typedef struct STranslateContext {
SCmdMsgInfo
*
pCmdMsg
;
SHashObj
*
pDbs
;
SHashObj
*
pTables
;
SHashObj
*
pTargetTables
;
SExplainOptions
*
pExplainOpt
;
SParseMetaCache
*
pMetaCache
;
bool
createStream
;
...
...
@@ -89,10 +90,10 @@ static int32_t collectUseDatabase(const SName* pName, SHashObj* pDbs) {
return
collectUseDatabaseImpl
(
dbFName
,
pDbs
);
}
static
int32_t
collectUseTable
(
const
SName
*
pName
,
SHashObj
*
p
Dbs
)
{
static
int32_t
collectUseTable
(
const
SName
*
pName
,
SHashObj
*
p
Table
)
{
char
fullName
[
TSDB_TABLE_FNAME_LEN
];
tNameExtractFullName
(
pName
,
fullName
);
return
taosHashPut
(
p
Dbs
,
fullName
,
strlen
(
fullName
),
pName
,
sizeof
(
SName
));
return
taosHashPut
(
p
Table
,
fullName
,
strlen
(
fullName
),
pName
,
sizeof
(
SName
));
}
static
int32_t
getTableMetaImpl
(
STranslateContext
*
pCxt
,
const
SName
*
pName
,
STableMeta
**
pMeta
)
{
...
...
@@ -357,7 +358,8 @@ static int32_t initTranslateContext(SParseContext* pParseCxt, SParseMetaCache* p
pCxt
->
pMetaCache
=
pMetaCache
;
pCxt
->
pDbs
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
pCxt
->
pTables
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
if
(
NULL
==
pCxt
->
pNsLevel
||
NULL
==
pCxt
->
pDbs
||
NULL
==
pCxt
->
pTables
)
{
pCxt
->
pTargetTables
=
taosHashInit
(
4
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
if
(
NULL
==
pCxt
->
pNsLevel
||
NULL
==
pCxt
->
pDbs
||
NULL
==
pCxt
->
pTables
||
NULL
==
pCxt
->
pTargetTables
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -3933,6 +3935,9 @@ static int32_t buildCreateStbReq(STranslateContext* pCxt, SCreateTableStmt* pStm
SName
tableName
;
tNameExtractFullName
(
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
tableName
),
pReq
->
name
);
int32_t
code
=
collectUseTable
(
&
tableName
,
pCxt
->
pTables
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
collectUseTable
(
&
tableName
,
pCxt
->
pTargetTables
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
buildRollupAst
(
pCxt
,
pStmt
,
pReq
);
}
...
...
@@ -3953,11 +3958,14 @@ static int32_t translateCreateSuperTable(STranslateContext* pCxt, SCreateTableSt
}
static
int32_t
doTranslateDropSuperTable
(
STranslateContext
*
pCxt
,
const
SName
*
pTableName
,
bool
ignoreNotExists
)
{
SMDropStbReq
dropReq
=
{
0
};
tNameExtractFullName
(
pTableName
,
dropReq
.
name
);
dropReq
.
igNotExists
=
ignoreNotExists
;
return
buildCmdMsg
(
pCxt
,
TDMT_MND_DROP_STB
,
(
FSerializeFunc
)
tSerializeSMDropStbReq
,
&
dropReq
);
int32_t
code
=
collectUseTable
(
pTableName
,
pCxt
->
pTargetTables
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SMDropStbReq
dropReq
=
{
0
};
tNameExtractFullName
(
pTableName
,
dropReq
.
name
);
dropReq
.
igNotExists
=
ignoreNotExists
;
code
=
buildCmdMsg
(
pCxt
,
TDMT_MND_DROP_STB
,
(
FSerializeFunc
)
tSerializeSMDropStbReq
,
&
dropReq
);
}
return
code
;
}
static
int32_t
translateDropTable
(
STranslateContext
*
pCxt
,
SDropTableStmt
*
pStmt
)
{
...
...
@@ -5559,8 +5567,13 @@ static int32_t rewriteCreateTable(STranslateContext* pCxt, SQuery* pQuery) {
int32_t
code
=
checkCreateTable
(
pCxt
,
pStmt
,
false
);
SVgroupInfo
info
=
{
0
};
SName
name
;
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
name
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
getTableHashVgroup
(
pCxt
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
info
);
code
=
getTableHashVgroupImpl
(
pCxt
,
&
name
,
&
info
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
collectUseTable
(
&
name
,
pCxt
->
pTargetTables
);
}
SArray
*
pBufArray
=
NULL
;
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
...
@@ -5829,6 +5842,11 @@ static int32_t rewriteCreateSubTable(STranslateContext* pCxt, SCreateSubTableCla
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
getTableMeta
(
pCxt
,
pStmt
->
useDbName
,
pStmt
->
useTableName
,
&
pSuperTableMeta
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
SName
name
;
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
&
name
);
code
=
collectUseTable
(
&
name
,
pCxt
->
pTargetTables
);
}
STag
*
pTag
=
NULL
;
SArray
*
tagName
=
taosArrayInit
(
8
,
TSDB_COL_NAME_LEN
);
...
...
@@ -5927,8 +5945,13 @@ static void addDropTbReqIntoVgroup(SHashObj* pVgroupHashmap, SDropTableClause* p
static
int32_t
buildDropTableVgroupHashmap
(
STranslateContext
*
pCxt
,
SDropTableClause
*
pClause
,
bool
*
pIsSuperTable
,
SHashObj
*
pVgroupHashmap
)
{
SName
name
;
toName
(
pCxt
->
pParseCxt
->
acctId
,
pClause
->
dbName
,
pClause
->
tableName
,
&
name
);
STableMeta
*
pTableMeta
=
NULL
;
int32_t
code
=
getTableMeta
(
pCxt
,
pClause
->
dbName
,
pClause
->
tableName
,
&
pTableMeta
);
int32_t
code
=
getTableMetaImpl
(
pCxt
,
&
name
,
&
pTableMeta
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
collectUseTable
(
&
name
,
pCxt
->
pTargetTables
);
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
TSDB_SUPER_TABLE
==
pTableMeta
->
tableType
)
{
*
pIsSuperTable
=
true
;
...
...
@@ -6509,6 +6532,20 @@ static int32_t setRefreshMate(STranslateContext* pCxt, SQuery* pQuery) {
pTable
=
taosHashIterate
(
pCxt
->
pTables
,
pTable
);
}
}
if
(
NULL
!=
pCxt
->
pTargetTables
)
{
taosArrayDestroy
(
pQuery
->
pTargetTableList
);
pQuery
->
pTargetTableList
=
taosArrayInit
(
taosHashGetSize
(
pCxt
->
pTargetTables
),
sizeof
(
SName
));
if
(
NULL
==
pQuery
->
pTargetTableList
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
SName
*
pTable
=
taosHashIterate
(
pCxt
->
pTargetTables
,
NULL
);
while
(
NULL
!=
pTable
)
{
taosArrayPush
(
pQuery
->
pTargetTableList
,
pTable
);
pTable
=
taosHashIterate
(
pCxt
->
pTargetTables
,
pTable
);
}
}
return
TSDB_CODE_SUCCESS
;
}
...
...
tests/script/jenkins/basic.txt
浏览文件 @
2d8cd533
...
...
@@ -166,7 +166,7 @@
# ---- query
./test.sh -f tsim/query/charScalarFunction.sim
./test.sh -f tsim/query/explain.sim
#
./test.sh -f tsim/query/explain.sim
./test.sh -f tsim/query/interval-offset.sim
./test.sh -f tsim/query/interval.sim
./test.sh -f tsim/query/scalarFunction.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录