Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
03b141e0
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
03b141e0
编写于
12月 06, 2020
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into xiaoping/add_test_case
上级
11837506
ffadd16e
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
71 addition
and
33 deletion
+71
-33
cmake/version.inc
cmake/version.inc
+1
-1
snap/snapcraft.yaml
snap/snapcraft.yaml
+2
-2
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+4
-4
src/common/inc/tname.h
src/common/inc/tname.h
+2
-0
src/common/src/tname.c
src/common/src/tname.c
+8
-1
src/connector/go
src/connector/go
+1
-1
src/connector/grafanaplugin
src/connector/grafanaplugin
+1
-1
src/dnode/src/dnodeEps.c
src/dnode/src/dnodeEps.c
+7
-0
src/dnode/src/dnodeMInfos.c
src/dnode/src/dnodeMInfos.c
+19
-8
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-1
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+6
-1
src/inc/taoserror.h
src/inc/taoserror.h
+1
-1
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+11
-3
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+3
-3
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+1
-1
src/vnode/src/vnodeCfg.c
src/vnode/src/vnodeCfg.c
+2
-3
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+1
-2
未找到文件。
cmake/version.inc
浏览文件 @
03b141e0
...
...
@@ -4,7 +4,7 @@ PROJECT(TDengine)
IF
(
DEFINED
VERNUMBER
)
SET
(
TD_VER_NUMBER
$
{
VERNUMBER
})
ELSE
()
SET
(
TD_VER_NUMBER
"2.0.
8
.0"
)
SET
(
TD_VER_NUMBER
"2.0.
9
.0"
)
ENDIF
()
IF
(
DEFINED
VERCOMPATIBLE
)
...
...
snap/snapcraft.yaml
浏览文件 @
03b141e0
name
:
tdengine
base
:
core18
version
:
'
2.0.
8
.0'
version
:
'
2.0.
9
.0'
icon
:
snap/gui/t-dengine.svg
summary
:
an open-source big data platform designed and optimized for IoT.
description
:
|
...
...
@@ -72,7 +72,7 @@ parts:
-
usr/bin/taosd
-
usr/bin/taos
-
usr/bin/taosdemo
-
usr/lib/libtaos.so.2.0.
8
.0
-
usr/lib/libtaos.so.2.0.
9
.0
-
usr/lib/libtaos.so.1
-
usr/lib/libtaos.so
...
...
src/client/src/tscLocalMerge.c
浏览文件 @
03b141e0
...
...
@@ -1633,7 +1633,7 @@ void tscInitResObjForLocalQuery(SSqlObj *pObj, int32_t numOfRes, int32_t rowLen)
int32_t
doArithmeticCalculate
(
SQueryInfo
*
pQueryInfo
,
tFilePage
*
pOutput
,
int32_t
rowSize
,
int32_t
finalRowSize
)
{
int32_t
maxRowSize
=
MAX
(
rowSize
,
finalRowSize
);
char
*
pbuf
=
calloc
(
1
,
pOutput
->
num
*
maxRowSize
);
char
*
pbuf
=
calloc
(
1
,
(
size_t
)(
pOutput
->
num
*
maxRowSize
)
);
size_t
size
=
tscNumOfFields
(
pQueryInfo
);
SArithmeticSupport
arithSup
=
{
0
};
...
...
@@ -1660,16 +1660,16 @@ int32_t doArithmeticCalculate(SQueryInfo* pQueryInfo, tFilePage* pOutput, int32_
tExprTreeCalcTraverse
(
arithSup
.
pArithExpr
->
pExpr
,
(
int32_t
)
pOutput
->
num
,
pbuf
+
pOutput
->
num
*
offset
,
&
arithSup
,
TSDB_ORDER_ASC
,
getArithmeticInputSrc
);
}
else
{
SSqlExpr
*
pExpr
=
pSup
->
pSqlExpr
;
memcpy
(
pbuf
+
pOutput
->
num
*
offset
,
pExpr
->
offset
*
pOutput
->
num
+
pOutput
->
data
,
pExpr
->
resBytes
*
pOutput
->
num
);
memcpy
(
pbuf
+
pOutput
->
num
*
offset
,
pExpr
->
offset
*
pOutput
->
num
+
pOutput
->
data
,
(
size_t
)(
pExpr
->
resBytes
*
pOutput
->
num
)
);
}
offset
+=
pSup
->
field
.
bytes
;
}
memcpy
(
pOutput
->
data
,
pbuf
,
pOutput
->
num
*
offset
);
memcpy
(
pOutput
->
data
,
pbuf
,
(
size_t
)(
pOutput
->
num
*
offset
)
);
tfree
(
pbuf
);
tfree
(
arithSup
.
data
);
return
offset
;
}
\ No newline at end of file
}
src/common/inc/tname.h
浏览文件 @
03b141e0
...
...
@@ -25,6 +25,8 @@ void extractTableName(const char *tableId, char *name);
char
*
extractDBName
(
const
char
*
tableId
,
char
*
name
);
size_t
tableIdPrefix
(
const
char
*
name
,
char
*
prefix
,
int32_t
len
);
void
extractTableNameFromToken
(
SStrToken
*
pToken
,
SStrToken
*
pTable
);
SSchema
tGetTableNameColumnSchema
();
...
...
src/common/src/tname.c
浏览文件 @
03b141e0
...
...
@@ -39,6 +39,13 @@ char* extractDBName(const char* tableId, char* name) {
return
strncpy
(
name
,
&
tableId
[
offset1
+
1
],
len
);
}
size_t
tableIdPrefix
(
const
char
*
name
,
char
*
prefix
,
int32_t
len
)
{
tstrncpy
(
prefix
,
name
,
len
);
strcat
(
prefix
,
TS_PATH_DELIMITER
);
return
strlen
(
prefix
);
}
SSchema
tGetTableNameColumnSchema
()
{
SSchema
s
=
{
0
};
s
.
bytes
=
TSDB_TABLE_NAME_LEN
-
1
+
VARSTR_HEADER_SIZE
;
...
...
@@ -198,4 +205,4 @@ SSchema tscGetTbnameColumnSchema() {
strcpy
(
s
.
name
,
TSQL_TBNAME_L
);
return
s
;
}
\ No newline at end of file
}
go
@
050667e5
比较
8c58c512
...
050667e5
Subproject commit
8c58c512b6acda8bcdfa48fdc7140227b5221766
Subproject commit
050667e5b4d0eafa5387e4283e713559b421203f
grafanaplugin
@
ec77d904
比较
d598db16
...
ec77d904
Subproject commit
d598db167eb256fe67409b7bb3d0eb7fffc3ff8c
Subproject commit
ec77d9049a719dabfd1a7c1122a209e201861944
src/dnode/src/dnodeEps.c
浏览文件 @
03b141e0
...
...
@@ -236,7 +236,14 @@ PRASE_EPS_OVER:
dnodeResetEps
(
eps
);
if
(
eps
)
free
(
eps
);
#if 0
dnodeUpdateEp(dnodeGetDnodeId(), tsLocalEp, tsLocalFqdn, &tsServerPort);
#else
if
(
dnodeCheckEpChanged
(
dnodeGetDnodeId
(),
tsLocalEp
))
{
dError
(
"dnode:%d, localEp is changed to %s in dnodeEps.json and need reconfigured"
,
dnodeGetDnodeId
(),
tsLocalEp
);
return
-
1
;
}
#endif
terrno
=
0
;
return
0
;
...
...
src/dnode/src/dnodeMInfos.c
浏览文件 @
03b141e0
...
...
@@ -157,12 +157,13 @@ static void dnodeResetMInfos(SMInfos *pMinfos) {
}
static
int32_t
dnodeReadMInfos
()
{
int32_t
len
=
0
;
int32_t
maxLen
=
2000
;
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
cJSON
*
root
=
NULL
;
FILE
*
fp
=
NULL
;
SMInfos
minfos
=
{
0
};
int32_t
len
=
0
;
int32_t
maxLen
=
2000
;
char
*
content
=
calloc
(
1
,
maxLen
+
1
);
cJSON
*
root
=
NULL
;
FILE
*
fp
=
NULL
;
SMInfos
minfos
=
{
0
};
bool
nodeChanged
=
false
;
char
file
[
TSDB_FILENAME_LEN
+
20
]
=
{
0
};
sprintf
(
file
,
"%s/mnodeEpSet.json"
,
tsDnodeDir
);
...
...
@@ -221,14 +222,19 @@ static int32_t dnodeReadMInfos() {
dError
(
"failed to read mnodeEpSet.json, nodeId not found"
);
goto
PARSE_MINFOS_OVER
;
}
minfos
.
mnodeInfos
[
i
].
mnodeId
=
nodeId
->
valueint
;
cJSON
*
nodeEp
=
cJSON_GetObjectItem
(
nodeInfo
,
"nodeEp"
);
if
(
!
nodeEp
||
nodeEp
->
type
!=
cJSON_String
||
nodeEp
->
valuestring
==
NULL
)
{
dError
(
"failed to read mnodeEpSet.json, nodeName not found"
);
goto
PARSE_MINFOS_OVER
;
}
strncpy
(
minfos
.
mnodeInfos
[
i
].
mnodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
SMInfo
*
pMinfo
=
&
minfos
.
mnodeInfos
[
i
];
pMinfo
->
mnodeId
=
nodeId
->
valueint
;
tstrncpy
(
pMinfo
->
mnodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
bool
changed
=
dnodeCheckEpChanged
(
pMinfo
->
mnodeId
,
pMinfo
->
mnodeEp
);
if
(
changed
)
nodeChanged
=
changed
;
}
dInfo
(
"read file %s successed"
,
file
);
...
...
@@ -245,6 +251,11 @@ PARSE_MINFOS_OVER:
dnodeUpdateEp
(
mInfo
->
mnodeId
,
mInfo
->
mnodeEp
,
NULL
,
NULL
);
}
dnodeResetMInfos
(
&
minfos
);
if
(
nodeChanged
)
{
dnodeWriteMInfos
();
}
return
0
;
}
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
03b141e0
...
...
@@ -58,10 +58,10 @@ typedef struct {
static
const
SDnodeComponent
tsDnodeComponents
[]
=
{
{
"tfile"
,
tfInit
,
tfCleanup
},
{
"rpc"
,
rpcInit
,
rpcCleanup
},
{
"globalcfg"
,
taosCheckGlobalCfg
,
NULL
},
{
"storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
{
"dnodecfg"
,
dnodeInitCfg
,
dnodeCleanupCfg
},
{
"dnodeeps"
,
dnodeInitEps
,
dnodeCleanupEps
},
{
"globalcfg"
,
taosCheckGlobalCfg
,
NULL
},
{
"mnodeinfos"
,
dnodeInitMInfos
,
dnodeCleanupMInfos
},
{
"wal"
,
walInit
,
walCleanUp
},
{
"check"
,
dnodeInitCheck
,
dnodeCleanupCheck
},
// NOTES: dnodeInitCheck must be behind the dnodeinitStorage component !!!
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
03b141e0
...
...
@@ -339,7 +339,12 @@ static int32_t dnodeOpenVnodes() {
}
free
(
threads
);
dInfo
(
"there are total vnodes:%d, openned:%d failed:%d"
,
numOfVnodes
,
openVnodes
,
failedVnodes
);
dInfo
(
"there are total vnodes:%d, openned:%d"
,
numOfVnodes
,
openVnodes
);
if
(
failedVnodes
!=
0
)
{
dError
(
"there are total vnodes:%d, failed:%d"
,
numOfVnodes
,
failedVnodes
);
return
-
1
;
}
return
TSDB_CODE_SUCCESS
;
}
...
...
src/inc/taoserror.h
浏览文件 @
03b141e0
...
...
@@ -64,7 +64,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_RPC_INVALID_TRAN_ID, 0, 0x000F, "Invalid tr
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_SESSION_ID
,
0
,
0x0010
,
"Invalid session id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_MSG_TYPE
,
0
,
0x0011
,
"Invalid message type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_RESPONSE_TYPE
,
0
,
0x0012
,
"Invalid response type"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_TIME_STAMP
,
0
,
0x0013
,
"
Invalid timestamp
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_INVALID_TIME_STAMP
,
0
,
0x0013
,
"
Client and server's time is not synchronized
"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_APP_NOT_READY
,
0
,
0x0014
,
"Database not ready"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_RPC_FQDN_ERROR
,
0
,
0x0015
,
"Unable to resolve FQDN"
)
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
03b141e0
...
...
@@ -1734,6 +1734,16 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) {
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
STagData
*
pTagData
=
(
STagData
*
)
pCreate
->
schema
;
// it is a tag key
char
prefix
[
64
]
=
{
0
};
size_t
prefixLen
=
tableIdPrefix
(
pMsg
->
pDb
->
name
,
prefix
,
64
);
if
(
0
!=
strncasecmp
(
prefix
,
pTagData
->
name
,
prefixLen
))
{
mError
(
"msg:%p, app:%p table:%s, corresponding super table:%s not in this db"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
pCreate
->
tableId
,
pTagData
->
name
);
mnodeDestroyChildTable
(
pTable
);
return
TSDB_CODE_TDB_INVALID_CREATE_TB_MSG
;
}
if
(
pMsg
->
pSTable
==
NULL
)
pMsg
->
pSTable
=
mnodeGetSuperTable
(
pTagData
->
name
);
if
(
pMsg
->
pSTable
==
NULL
)
{
mError
(
"msg:%p, app:%p table:%s, corresponding super table:%s does not exist"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
...
...
@@ -2629,9 +2639,7 @@ static int32_t mnodeRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows
SPatternCompareInfo
info
=
PATTERN_COMPARE_INFO_INITIALIZER
;
char
prefix
[
64
]
=
{
0
};
tstrncpy
(
prefix
,
pDb
->
name
,
64
);
strcat
(
prefix
,
TS_PATH_DELIMITER
);
int32_t
prefixLen
=
strlen
(
prefix
);
int32_t
prefixLen
=
tableIdPrefix
(
pDb
->
name
,
prefix
,
64
);
char
*
pattern
=
NULL
;
if
(
pShow
->
payloadLen
>
0
)
{
...
...
src/query/src/qExecutor.c
浏览文件 @
03b141e0
...
...
@@ -5837,7 +5837,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) {
tFilePage
**
data
=
calloc
(
pQuery
->
numOfExpr2
,
POINTER_BYTES
);
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfExpr2
;
++
i
)
{
int32_t
bytes
=
pQuery
->
pExpr2
[
i
].
bytes
;
data
[
i
]
=
(
tFilePage
*
)
malloc
(
bytes
*
pQuery
->
rec
.
rows
+
sizeof
(
tFilePage
));
data
[
i
]
=
(
tFilePage
*
)
malloc
(
(
size_t
)(
bytes
*
pQuery
->
rec
.
rows
)
+
sizeof
(
tFilePage
));
}
arithSup
.
offset
=
0
;
...
...
@@ -5859,7 +5859,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) {
for
(
int32_t
j
=
0
;
j
<
pQuery
->
numOfOutput
;
++
j
)
{
if
(
pSqlFunc
->
functionId
==
pQuery
->
pExpr1
[
j
].
base
.
functionId
&&
pSqlFunc
->
colInfo
.
colId
==
pQuery
->
pExpr1
[
j
].
base
.
colInfo
.
colId
)
{
memcpy
(
data
[
i
]
->
data
,
pQuery
->
sdata
[
j
]
->
data
,
pQuery
->
pExpr1
[
j
].
bytes
*
pQuery
->
rec
.
rows
);
memcpy
(
data
[
i
]
->
data
,
pQuery
->
sdata
[
j
]
->
data
,
(
size_t
)(
pQuery
->
pExpr1
[
j
].
bytes
*
pQuery
->
rec
.
rows
)
);
break
;
}
}
...
...
@@ -5871,7 +5871,7 @@ static void doSecondaryArithmeticProcess(SQuery* pQuery) {
}
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfExpr2
;
++
i
)
{
memcpy
(
pQuery
->
sdata
[
i
]
->
data
,
data
[
i
]
->
data
,
pQuery
->
pExpr2
[
i
].
bytes
*
pQuery
->
rec
.
rows
);
memcpy
(
pQuery
->
sdata
[
i
]
->
data
,
data
[
i
]
->
data
,
(
size_t
)(
pQuery
->
pExpr2
[
i
].
bytes
*
pQuery
->
rec
.
rows
)
);
}
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfExpr2
;
++
i
)
{
...
...
src/sync/src/syncMain.c
浏览文件 @
03b141e0
...
...
@@ -226,7 +226,7 @@ int64_t syncStart(const SSyncInfo *pInfo) {
}
if
(
pNode
->
selfIndex
<
0
)
{
s
Info
(
"vgId:%d, this node is not configured"
,
pNode
->
vgId
);
s
Error
(
"vgId:%d, this node is not configured"
,
pNode
->
vgId
);
terrno
=
TSDB_CODE_SYN_INVALID_CONFIG
;
syncStop
(
pNode
->
rid
);
return
-
1
;
...
...
src/vnode/src/vnodeCfg.c
浏览文件 @
03b141e0
...
...
@@ -242,9 +242,8 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
}
tstrncpy
(
node
->
nodeEp
,
nodeEp
->
valuestring
,
TSDB_EP_LEN
);
if
(
!
nodeChanged
)
{
nodeChanged
=
dnodeCheckEpChanged
(
node
->
nodeId
,
node
->
nodeEp
);
}
bool
changed
=
dnodeCheckEpChanged
(
node
->
nodeId
,
node
->
nodeEp
);
if
(
changed
)
nodeChanged
=
changed
;
}
ret
=
TSDB_CODE_SUCCESS
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
03b141e0
...
...
@@ -362,9 +362,8 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode
->
role
=
TAOS_SYNC_ROLE_MASTER
;
#else
if
(
pVnode
->
sync
<=
0
)
{
vError
(
"vgId:%d, failed to open sync
module
, replica:%d reason:%s"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
vError
(
"vgId:%d, failed to open sync, replica:%d reason:%s"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
tstrerror
(
terrno
));
vnodeRelease
(
pVnode
);
vnodeCleanUp
(
pVnode
);
return
terrno
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录