Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ebcbafee
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看板
提交
ebcbafee
编写于
5月 10, 2020
作者:
S
Steven Li
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/crash_gen
上级
b52b4529
fead5b90
变更
43
展开全部
显示空白变更内容
内联
并排
Showing
43 changed file
with
572 addition
and
566 deletion
+572
-566
.travis.yml
.travis.yml
+5
-5
README.md
README.md
+1
-1
src/client/inc/tscLog.h
src/client/inc/tscLog.h
+8
-8
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+6
-6
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+6
-8
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+7
-5
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+3
-3
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+0
-3
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+0
-2
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+5
-5
src/common/src/tglobal.c
src/common/src/tglobal.c
+15
-15
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+4
-4
src/inc/taosdef.h
src/inc/taosdef.h
+9
-4
src/inc/tsdb.h
src/inc/tsdb.h
+1
-1
src/mnode/inc/mgmtInt.h
src/mnode/inc/mgmtInt.h
+4
-4
src/mnode/src/mgmtServer.c
src/mnode/src/mgmtServer.c
+3
-1
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+1
-1
src/query/inc/queryExecutor.h
src/query/inc/queryExecutor.h
+10
-4
src/query/inc/queryLog.h
src/query/inc/queryLog.h
+7
-7
src/query/inc/tsqlfunction.h
src/query/inc/tsqlfunction.h
+1
-1
src/query/src/qast.c
src/query/src/qast.c
+33
-10
src/query/src/queryExecutor.c
src/query/src/queryExecutor.c
+189
-256
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+2
-2
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+9
-3
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+2
-2
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+51
-33
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+31
-31
src/util/src/talgo.c
src/util/src/talgo.c
+2
-2
src/util/src/tcompare.c
src/util/src/tcompare.c
+25
-14
src/util/src/tconfig.c
src/util/src/tconfig.c
+1
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+4
-3
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+1
-1
tests/script/general/cache/restart_metrics.sim
tests/script/general/cache/restart_metrics.sim
+10
-3
tests/script/general/db/delete_reusevnode2.sim
tests/script/general/db/delete_reusevnode2.sim
+2
-4
tests/script/general/field/bigint.sim
tests/script/general/field/bigint.sim
+3
-1
tests/script/general/parser/lastrow_query.sim
tests/script/general/parser/lastrow_query.sim
+2
-0
tests/script/general/parser/testSuite.sim
tests/script/general/parser/testSuite.sim
+84
-100
tests/script/general/tag/bool.sim
tests/script/general/tag/bool.sim
+2
-1
tests/script/general/tag/filter.sim
tests/script/general/tag/filter.sim
+2
-1
tests/script/test.sh
tests/script/test.sh
+2
-1
tests/script/unique/mnode/mgmt22.sim
tests/script/unique/mnode/mgmt22.sim
+4
-8
tests/script/unique/vnode/replica2_basic2.sim
tests/script/unique/vnode/replica2_basic2.sim
+14
-0
未找到文件。
.travis.yml
浏览文件 @
ebcbafee
...
...
@@ -59,12 +59,12 @@ matrix:
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
grep 'ERROR SUMMARY' mem-error-out.txt
| uniq |
tee uniq-mem-error-out.txt
grep 'ERROR SUMMARY' mem-error-out.txt
|grep -v 'grep'|uniq|
tee uniq-mem-error-out.txt
for memError in `cat uniq-mem-error-out.txt | awk '{print $4}'`
do
if [ -n "$memError" ]; then
if [ "$memError" -gt
16
]; then
if [ "$memError" -gt
5
]; then
echo -e "${RED} ## Memory errors number valgrind reports is $memError.\
More than our threshold! ## ${NC}"
travis_terminate $memError
...
...
@@ -72,11 +72,11 @@ matrix:
fi
done
grep 'definitely lost:' mem-error-out.txt
| uniq |
tee uniq-definitely-lost-out.txt
for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $
4
}'`
grep 'definitely lost:' mem-error-out.txt
|grep -v 'grep'|uniq|
tee uniq-definitely-lost-out.txt
for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $
7
}'`
do
if [ -n "$defiMemError" ]; then
if [ "$defiMemError" -gt
16
]; then
if [ "$defiMemError" -gt
3
]; then
echo -e "${RED} ## Memory errors number valgrind reports \
Definitely lost is $defiMemError. More than our threshold! ## ${NC}"
travis_terminate $defiMemError
...
...
README.md
浏览文件 @
ebcbafee
...
...
@@ -121,7 +121,7 @@ TDengine provides abundant developing tools for users to develop on TDengine. Fo
1.
sudo apt install
build-essential cmake net-tools python-pip python-setuptools python3-pip
python3-setuptools valgrind
python3-setuptools valgrind
psmisc curl
2.
git clone
<https://github.com/taosdata/TDengine>
; cd TDengine
...
...
src/client/inc/tscLog.h
浏览文件 @
ebcbafee
...
...
@@ -22,25 +22,25 @@ extern "C" {
#include "tlog.h"
extern
int32_t
c
d
ebugFlag
;
extern
int32_t
c
D
ebugFlag
;
#define tscError(...) \
if (c
d
ebugFlag & DEBUG_ERROR) { \
if (c
D
ebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR TSC ", 255, __VA_ARGS__); \
}
#define tscWarn(...) \
if (c
d
ebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN TSC ", c
d
ebugFlag, __VA_ARGS__); \
if (c
D
ebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN TSC ", c
D
ebugFlag, __VA_ARGS__); \
}
#define tscTrace(...) \
if (c
d
ebugFlag & DEBUG_TRACE) { \
taosPrintLog("TSC ", c
d
ebugFlag, __VA_ARGS__); \
if (c
D
ebugFlag & DEBUG_TRACE) { \
taosPrintLog("TSC ", c
D
ebugFlag, __VA_ARGS__); \
}
#define tscPrint(...) \
{ taosPrintLog("TSC ", 255, __VA_ARGS__); }
#define tscDump(...) \
if (c
d
ebugFlag & DEBUG_TRACE) { \
taosPrintLongString("TSC ", c
d
ebugFlag, __VA_ARGS__); \
if (c
D
ebugFlag & DEBUG_TRACE) { \
taosPrintLongString("TSC ", c
D
ebugFlag, __VA_ARGS__); \
}
#ifdef __cplusplus
...
...
src/client/src/TSDBJNIConnector.c
浏览文件 @
ebcbafee
...
...
@@ -23,16 +23,16 @@
#include "ttime.h"
#define jniError(...) \
if (jni
d
ebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR JNI ", jni
d
ebugFlag, __VA_ARGS__); \
if (jni
D
ebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR JNI ", jni
D
ebugFlag, __VA_ARGS__); \
}
#define jniWarn(...) \
if (jni
d
ebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN JNI ", jni
d
ebugFlag, __VA_ARGS__); \
if (jni
D
ebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN JNI ", jni
D
ebugFlag, __VA_ARGS__); \
}
#define jniTrace(...) \
if (jni
d
ebugFlag & DEBUG_TRACE) { \
taosPrintLog("JNI ", jni
d
ebugFlag, __VA_ARGS__); \
if (jni
D
ebugFlag & DEBUG_TRACE) { \
taosPrintLog("JNI ", jni
D
ebugFlag, __VA_ARGS__); \
}
#define jniPrint(...) \
{ taosPrintLog("JNI ", 255, __VA_ARGS__); }
...
...
src/client/src/tscFunctionImpl.c
浏览文件 @
ebcbafee
...
...
@@ -1691,10 +1691,7 @@ static void last_function(SQLFunctionCtx *pCtx) {
}
static
void
last_function_f
(
SQLFunctionCtx
*
pCtx
,
int32_t
index
)
{
if
(
pCtx
->
order
==
TSDB_ORDER_ASC
)
{
return
;
}
assert
(
pCtx
->
order
!=
TSDB_ORDER_ASC
);
void
*
pData
=
GET_INPUT_CHAR_INDEX
(
pCtx
,
index
);
if
(
pCtx
->
hasNull
&&
isNull
(
pData
,
pCtx
->
inputType
))
{
return
;
...
...
@@ -2912,7 +2909,7 @@ static void leastsquares_finalizer(SQLFunctionCtx *pCtx) {
}
static
void
date_col_output_function
(
SQLFunctionCtx
*
pCtx
)
{
if
(
pCtx
->
scanFlag
==
SUPPLEMENTARY
_SCAN
)
{
if
(
pCtx
->
scanFlag
==
REVERSE
_SCAN
)
{
return
;
}
...
...
@@ -2969,11 +2966,12 @@ static void tag_project_function(SQLFunctionCtx *pCtx) {
char
*
output
=
pCtx
->
aOutputBuf
;
if
(
pCtx
->
tag
.
nType
==
TSDB_DATA_TYPE_BINARY
||
pCtx
->
tag
.
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
*
(
int16_t
*
)
output
=
pCtx
->
tag
.
nLen
;
output
+=
VARSTR_HEADER_SIZE
;
varDataSetLen
(
output
,
pCtx
->
tag
.
nLen
);
tVariantDump
(
&
pCtx
->
tag
,
varDataVal
(
output
),
pCtx
->
outputType
);
}
else
{
tVariantDump
(
&
pCtx
->
tag
,
output
,
pCtx
->
outputType
);
}
tVariantDump
(
&
pCtx
->
tag
,
output
,
pCtx
->
outputType
);
pCtx
->
aOutputBuf
+=
pCtx
->
outputBytes
;
}
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
ebcbafee
...
...
@@ -5911,7 +5911,7 @@ int32_t exprTreeFromSqlExpr(tExprNode **pExpr, const tSQLExpr* pSqlExpr, SArray*
}
if
(
pSqlExpr
->
pLeft
==
NULL
)
{
if
(
pSqlExpr
->
nSQLOptr
>=
TK_
TINYINT
&&
pSqlExpr
->
nSQLOptr
<=
TK_DOUBLE
)
{
if
(
pSqlExpr
->
nSQLOptr
>=
TK_
BOOL
&&
pSqlExpr
->
nSQLOptr
<=
TK_STRING
)
{
*
pExpr
=
calloc
(
1
,
sizeof
(
tExprNode
));
(
*
pExpr
)
->
nodeType
=
TSQL_NODE_VALUE
;
(
*
pExpr
)
->
pVal
=
calloc
(
1
,
sizeof
(
tVariant
));
...
...
src/client/src/tscServer.c
浏览文件 @
ebcbafee
...
...
@@ -492,13 +492,15 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pMsg
+=
sizeof
(
pQueryInfo
->
type
);
// todo valid the vgroupId at the client side
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pQueryInfo
->
pTableMetaInfo
[
0
]))
{
SVgroupsInfo
*
pVgroupInfo
=
pQueryInfo
->
pTableMetaInfo
[
0
]
->
vgroupList
;
assert
(
pVgroupInfo
->
numOfVgroups
==
1
);
// todo fix me
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pVgroupInfo
->
vgroups
[
0
].
vgId
);
if
(
UTIL_TABLE_IS_SUPERTABLE
(
pTableMetaInfo
))
{
int32_t
vgIndex
=
pTableMetaInfo
->
vgroupIndex
;
SVgroupsInfo
*
pVgroupInfo
=
pTableMetaInfo
->
vgroupList
;
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
);
}
else
{
STableMeta
*
pTableMeta
=
p
QueryInfo
->
pTableMetaInfo
[
0
]
->
pTableMeta
;
STableMeta
*
pTableMeta
=
p
TableMetaInfo
->
pTableMeta
;
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pTableMeta
->
vgroupInfo
.
vgId
);
}
...
...
src/client/src/tscSubquery.c
浏览文件 @
ebcbafee
...
...
@@ -1436,8 +1436,8 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
return
;
}
else
{
// reach the maximum retry count, abort
atomic_val_compare_exchange_32
(
&
pState
->
code
,
TSDB_CODE_SUCCESS
,
numOfRows
);
tscError
(
"%p sub:%p retrieve failed,code:%
d,orderOfSub:%d failed.no more retry,set global code:%d
"
,
pPObj
,
pSql
,
numOfRows
,
subqueryIndex
,
tstrerror
(
pState
->
code
));
tscError
(
"%p sub:%p retrieve failed,code:%
s,orderOfSub:%d failed.no more retry,set global code:%s
"
,
pPObj
,
pSql
,
tstrerror
(
numOfRows
)
,
subqueryIndex
,
tstrerror
(
pState
->
code
));
}
}
...
...
@@ -1450,7 +1450,7 @@ void tscHandleSubqueryError(SRetrieveSupport *trsupport, SSqlObj *pSql, int numO
}
// all subqueries are failed
tscError
(
"%p retrieve from %d vnode(s) completed,code:%
d.FAILED."
,
pPObj
,
pState
->
numOfTotal
,
pState
->
code
);
tscError
(
"%p retrieve from %d vnode(s) completed,code:%
s.FAILED."
,
pPObj
,
pState
->
numOfTotal
,
tstrerror
(
pState
->
code
)
);
pPObj
->
res
.
code
=
pState
->
code
;
// release allocated resource
...
...
src/client/src/tscUtil.c
浏览文件 @
ebcbafee
...
...
@@ -1675,10 +1675,7 @@ STableMetaInfo* tscAddTableMetaInfo(SQueryInfo* pQueryInfo, const char* name, ST
pTableMetaInfo
->
pTableMeta
=
pTableMeta
;
if
(
vgroupList
!=
NULL
)
{
assert
(
vgroupList
->
numOfVgroups
==
1
);
// todo fix me
size_t
size
=
sizeof
(
SVgroupsInfo
)
+
sizeof
(
SCMVgroupInfo
)
*
vgroupList
->
numOfVgroups
;
pTableMetaInfo
->
vgroupList
=
malloc
(
size
);
memcpy
(
pTableMetaInfo
->
vgroupList
,
vgroupList
,
size
);
}
...
...
src/common/inc/tdataformat.h
浏览文件 @
ebcbafee
...
...
@@ -115,10 +115,8 @@ static FORCE_INLINE void *tdGetRowDataOfCol(SDataRow row, int8_t type, int32_t o
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
return
POINTER_SHIFT
(
row
,
*
(
VarDataOffsetT
*
)
POINTER_SHIFT
(
row
,
offset
));
break
;
default:
return
POINTER_SHIFT
(
row
,
offset
);
break
;
}
}
...
...
src/common/inc/tglobal.h
浏览文件 @
ebcbafee
...
...
@@ -141,9 +141,9 @@ extern int32_t tsAsyncLog;
extern
int32_t
tsNumOfLogLines
;
extern
int32_t
dDebugFlag
;
extern
int32_t
vDebugFlag
;
extern
int32_t
m
d
ebugFlag
;
extern
int32_t
c
d
ebugFlag
;
extern
int32_t
jni
d
ebugFlag
;
extern
int32_t
m
D
ebugFlag
;
extern
int32_t
c
D
ebugFlag
;
extern
int32_t
jni
D
ebugFlag
;
extern
int32_t
tmrDebugFlag
;
extern
int32_t
sdbDebugFlag
;
extern
int32_t
httpDebugFlag
;
...
...
@@ -151,8 +151,8 @@ extern int32_t monitorDebugFlag;
extern
int32_t
uDebugFlag
;
extern
int32_t
rpcDebugFlag
;
extern
int32_t
debugFlag
;
extern
int32_t
odbc
d
ebugFlag
;
extern
int32_t
q
d
ebugFlag
;
extern
int32_t
odbc
D
ebugFlag
;
extern
int32_t
q
D
ebugFlag
;
extern
uint32_t
taosMaxTmrCtrl
;
...
...
src/common/src/tglobal.c
浏览文件 @
ebcbafee
...
...
@@ -127,16 +127,16 @@ int32_t tsRestRowLimit = 10240;
int32_t
tsMaxSQLStringLen
=
TSDB_MAX_SQL_LEN
;
int32_t
tsNumOfLogLines
=
10000000
;
int32_t
m
d
ebugFlag
=
135
;
int32_t
m
D
ebugFlag
=
135
;
int32_t
sdbDebugFlag
=
135
;
int32_t
dDebugFlag
=
135
;
int32_t
vDebugFlag
=
135
;
int32_t
c
d
ebugFlag
=
135
;
int32_t
jni
d
ebugFlag
=
131
;
int32_t
odbc
d
ebugFlag
=
131
;
int32_t
c
D
ebugFlag
=
135
;
int32_t
jni
D
ebugFlag
=
131
;
int32_t
odbc
D
ebugFlag
=
131
;
int32_t
httpDebugFlag
=
131
;
int32_t
monitorDebugFlag
=
131
;
int32_t
q
d
ebugFlag
=
131
;
int32_t
q
D
ebugFlag
=
131
;
int32_t
rpcDebugFlag
=
135
;
int32_t
uDebugFlag
=
131
;
int32_t
debugFlag
=
131
;
...
...
@@ -204,19 +204,19 @@ static pthread_once_t tsInitGlobalCfgOnce = PTHREAD_ONCE_INIT;
void
taosSetAllDebugFlag
()
{
for
(
int32_t
i
=
0
;
i
<
tsGlobalConfigNum
;
++
i
)
{
m
d
ebugFlag
=
debugFlag
;
m
D
ebugFlag
=
debugFlag
;
sdbDebugFlag
=
debugFlag
;
dDebugFlag
=
debugFlag
;
vDebugFlag
=
debugFlag
;
c
d
ebugFlag
=
debugFlag
;
jni
d
ebugFlag
=
debugFlag
;
odbc
d
ebugFlag
=
debugFlag
;
c
D
ebugFlag
=
debugFlag
;
jni
D
ebugFlag
=
debugFlag
;
odbc
D
ebugFlag
=
debugFlag
;
httpDebugFlag
=
debugFlag
;
monitorDebugFlag
=
debugFlag
;
rpcDebugFlag
=
debugFlag
;
uDebugFlag
=
debugFlag
;
sDebugFlag
=
debugFlag
;
//q
d
ebugFlag = debugFlag;
//q
D
ebugFlag = debugFlag;
}
uPrint
(
"all debug flag are set to %d"
,
debugFlag
);
}
...
...
@@ -1002,7 +1002,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"mDebugFlag"
;
cfg
.
ptr
=
&
m
d
ebugFlag
;
cfg
.
ptr
=
&
m
D
ebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
;
cfg
.
minValue
=
0
;
...
...
@@ -1062,7 +1062,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"cDebugFlag"
;
cfg
.
ptr
=
&
c
d
ebugFlag
;
cfg
.
ptr
=
&
c
D
ebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
...
...
@@ -1072,7 +1072,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"jniDebugFlag"
;
cfg
.
ptr
=
&
jni
d
ebugFlag
;
cfg
.
ptr
=
&
jni
D
ebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
...
...
@@ -1082,7 +1082,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"odbcDebugFlag"
;
cfg
.
ptr
=
&
odbc
d
ebugFlag
;
cfg
.
ptr
=
&
odbc
D
ebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
...
...
@@ -1122,7 +1122,7 @@ static void doInitGlobalConfig() {
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"qDebugFlag"
;
cfg
.
ptr
=
&
q
d
ebugFlag
;
cfg
.
ptr
=
&
q
D
ebugFlag
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_LOG
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
ebcbafee
...
...
@@ -167,9 +167,9 @@ static int32_t dnodeInitSystem() {
if
(
dnodeInitRead
()
!=
0
)
return
-
1
;
if
(
dnodeInitWrite
()
!=
0
)
return
-
1
;
if
(
dnodeInitClient
()
!=
0
)
return
-
1
;
if
(
dnodeInitModules
()
!=
0
)
return
-
1
;
if
(
dnodeInitServer
()
!=
0
)
return
-
1
;
if
(
dnodeInitMgmt
()
!=
0
)
return
-
1
;
if
(
dnodeInitModules
()
!=
0
)
return
-
1
;
if
(
dnodeInitShell
()
!=
0
)
return
-
1
;
dnodeStartModules
();
...
...
@@ -184,14 +184,14 @@ static void dnodeCleanUpSystem() {
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_STOPPED
)
{
dnodeSetRunStatus
(
TSDB_DNODE_RUN_STATUS_STOPPED
);
dnodeCleanupShell
();
dnodeClean
upServer
();
dnodeClean
UpModules
();
dnodeCleanupMgmt
();
dnodeCleanupServer
();
dnodeCleanupClient
();
dnodeCleanupWrite
();
dnodeCleanupRead
();
dnodeCleanUpModules
();
taos_cleanup
();
dnodeCleanupStorage
();
taos_cleanup
();
taosCloseLog
();
}
}
...
...
src/inc/taosdef.h
浏览文件 @
ebcbafee
...
...
@@ -36,6 +36,11 @@ extern "C" {
typedef
int32_t
VarDataOffsetT
;
typedef
int16_t
VarDataLenT
;
typedef
struct
tstr
{
VarDataLenT
len
;
char
data
[];
}
tstr
;
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define varDataLen(v) ((VarDataLenT *)(v))[0]
...
...
src/inc/tsdb.h
浏览文件 @
ebcbafee
...
...
@@ -102,7 +102,7 @@ int tsdbTableSetSName(STableCfg *config, char *sname, bool dup);
void
tsdbClearTableCfg
(
STableCfg
*
config
);
int32_t
tsdbGetTableTagVal
(
TsdbRepoT
*
repo
,
STableId
*
id
,
int32_t
colId
,
int16_t
*
type
,
int16_t
*
bytes
,
char
**
val
);
int32_t
tsdbGetTableName
(
TsdbRepoT
*
repo
,
STableId
*
id
,
char
**
name
);
char
*
tsdbGetTableName
(
TsdbRepoT
*
repo
,
const
STableId
*
id
,
int16_t
*
bytes
);
int
tsdbCreateTable
(
TsdbRepoT
*
repo
,
STableCfg
*
pCfg
);
int
tsdbDropTable
(
TsdbRepoT
*
pRepo
,
STableId
tableId
);
...
...
src/mnode/inc/mgmtInt.h
浏览文件 @
ebcbafee
...
...
@@ -23,13 +23,13 @@ extern "C" {
#include "tlog.h"
#include "monitor.h"
extern
int32_t
m
d
ebugFlag
;
extern
int32_t
m
D
ebugFlag
;
extern
int32_t
sdbDebugFlag
;
// mnode log function
#define mError(...) if (m
d
ebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); }
#define mWarn(...) if (m
debugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", md
ebugFlag, __VA_ARGS__); }
#define mTrace(...) if (m
debugFlag & DEBUG_TRACE) { taosPrintLog("MND ", md
ebugFlag, __VA_ARGS__); }
#define mError(...) if (m
D
ebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); }
#define mWarn(...) if (m
DebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", mD
ebugFlag, __VA_ARGS__); }
#define mTrace(...) if (m
DebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mD
ebugFlag, __VA_ARGS__); }
#define mPrint(...) { taosPrintLog("MND ", 255, __VA_ARGS__); }
#define mLError(...) monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__)
...
...
src/mnode/src/mgmtServer.c
浏览文件 @
ebcbafee
...
...
@@ -88,10 +88,12 @@ void mgmtProcessReqMsgFromDnode(SRpcMsg *rpcMsg) {
SRpcIpSet
ipSet
=
{
0
};
dnodeGetMnodeDnodeIpSet
(
&
ipSet
);
for
(
int
i
=
0
;
i
<
ipSet
.
numOfIps
;
++
i
)
ipSet
.
port
[
i
]
=
htons
(
ipSet
.
port
[
i
]);
mTrace
(
"conn from dnode ip:%s user:%s redirect msg, inUse:%d"
,
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
,
ipSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
.
numOfIps
;
++
i
)
{
mTrace
(
"
index:%d %s:%d"
,
i
,
ipSet
.
fqdn
[
i
],
ipSet
.
port
[
i
]
);
mTrace
(
"
mnode index:%d %s:%d"
,
i
,
ipSet
.
fqdn
[
i
],
htons
(
ipSet
.
port
[
i
])
);
}
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
ipSet
);
return
;
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
ebcbafee
...
...
@@ -137,7 +137,7 @@ void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
mgmtGetMnodeIpSet
(
&
ipSet
);
mTrace
(
"conn from shell ip:%s user:%s redirect msg, inUse:%d"
,
taosIpStr
(
connInfo
.
clientIp
),
connInfo
.
user
,
ipSet
.
inUse
);
for
(
int32_t
i
=
0
;
i
<
ipSet
.
numOfIps
;
++
i
)
{
mTrace
(
"
index:%d ip:%s:%d"
,
i
,
ipSet
.
fqdn
[
i
],
ipSet
.
port
[
i
]
);
mTrace
(
"
mnode index:%d ip:%s:%d"
,
i
,
ipSet
.
fqdn
[
i
],
htons
(
ipSet
.
port
[
i
])
);
}
rpcSendRedirectRsp
(
rpcMsg
->
handle
,
&
ipSet
);
...
...
src/query/inc/queryExecutor.h
浏览文件 @
ebcbafee
...
...
@@ -110,6 +110,14 @@ typedef struct STableQueryInfo { // todo merge with the STableQueryInfo struct
SWindowResInfo
windowResInfo
;
}
STableQueryInfo
;
typedef
struct
SQueryCostSummary
{
}
SQueryCostSummary
;
typedef
struct
SGroupItem
{
STableId
id
;
STableQueryInfo
*
info
;
}
SGroupItem
;
typedef
struct
SQuery
{
int16_t
numOfCols
;
int16_t
numOfTags
;
...
...
@@ -131,17 +139,15 @@ typedef struct SQuery {
SColumnInfo
*
tagColList
;
int32_t
numOfFilterCols
;
int64_t
*
defaultVal
;
TSKEY
lastKey
;
//
TSKEY lastKey;
uint32_t
status
;
// query status
SResultRec
rec
;
int32_t
pos
;
SData
**
sdata
;
STableQueryInfo
*
current
;
SSingleColumnFilterInfo
*
pFilterInfo
;
}
SQuery
;
typedef
struct
SQueryCostSummary
{
}
SQueryCostSummary
;
typedef
struct
SQueryRuntimeEnv
{
SResultInfo
*
resultInfo
;
// todo refactor to merge with SWindowResInfo
SQuery
*
pQuery
;
...
...
src/query/inc/queryLog.h
浏览文件 @
ebcbafee
...
...
@@ -22,20 +22,20 @@ extern "C" {
#include "tlog.h"
extern
int32_t
q
d
ebugFlag
;
extern
int32_t
q
D
ebugFlag
;
#define qTrace(...) \
if (q
d
ebugFlag & DEBUG_TRACE) { \
taosPrintLog("DND QRY ", q
d
ebugFlag, __VA_ARGS__); \
if (q
D
ebugFlag & DEBUG_TRACE) { \
taosPrintLog("DND QRY ", q
D
ebugFlag, __VA_ARGS__); \
}
#define qError(...) \
if (q
d
ebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR QRY ", q
d
ebugFlag, __VA_ARGS__); \
if (q
D
ebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR QRY ", q
D
ebugFlag, __VA_ARGS__); \
}
#define qWarn(...) \
if (q
d
ebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN QRY ", q
d
ebugFlag, __VA_ARGS__); \
if (q
D
ebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN QRY ", q
D
ebugFlag, __VA_ARGS__); \
}
#ifdef __cplusplus
...
...
src/query/inc/tsqlfunction.h
浏览文件 @
ebcbafee
...
...
@@ -104,7 +104,7 @@ extern "C" {
enum
{
MASTER_SCAN
=
0x0u
,
SUPPLEMENTARY_SCAN
=
0x1u
,
REVERSE_SCAN
=
0x1u
,
REPEAT_SCAN
=
0x2u
,
//repeat scan belongs to the master scan
FIRST_STAGE_MERGE
=
0x10u
,
SECONDARY_STAGE_MERGE
=
0x20u
,
...
...
src/query/src/qast.c
浏览文件 @
ebcbafee
...
...
@@ -552,18 +552,18 @@ static void tQueryIndexColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo, SArr
if
(
cond
.
start
!=
NULL
)
{
int32_t
optr
=
cond
.
start
->
optr
;
if
(
optr
==
TSDB_RELATION_EQUAL
)
{
if
(
optr
==
TSDB_RELATION_EQUAL
)
{
// equals
while
(
tSkipListIterNext
(
iter
))
{
SSkipListNode
*
pNode
=
tSkipListIterGet
(
iter
);
int32_t
ret
=
pQueryInfo
->
compare
(
SL_GET_NODE_KEY
(
pSkipList
,
pNode
),
cond
.
start
->
v
);
if
(
ret
==
0
)
{
taosArrayPush
(
result
,
SL_GET_NODE_DATA
(
pNode
));
}
else
{
if
(
ret
!=
0
)
{
break
;
}
taosArrayPush
(
result
,
SL_GET_NODE_DATA
(
pNode
));
}
}
else
if
(
optr
==
TSDB_RELATION_GREATER
||
optr
==
TSDB_RELATION_GREATER_EQUAL
)
{
}
else
if
(
optr
==
TSDB_RELATION_GREATER
||
optr
==
TSDB_RELATION_GREATER_EQUAL
)
{
// greater equal
bool
comp
=
true
;
int32_t
ret
=
0
;
...
...
@@ -582,8 +582,33 @@ static void tQueryIndexColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo, SArr
comp
=
false
;
}
}
}
else
if
(
optr
==
TSDB_RELATION_NOT_EQUAL
)
{
assert
(
0
);
}
else
if
(
optr
==
TSDB_RELATION_NOT_EQUAL
)
{
// not equal
bool
comp
=
true
;
while
(
tSkipListIterNext
(
iter
))
{
SSkipListNode
*
pNode
=
tSkipListIterGet
(
iter
);
comp
=
comp
&&
(
pQueryInfo
->
compare
(
SL_GET_NODE_KEY
(
pSkipList
,
pNode
),
cond
.
start
->
v
)
==
0
);
if
(
comp
)
{
continue
;
}
taosArrayPush
(
result
,
SL_GET_NODE_DATA
(
pNode
));
}
tSkipListDestroyIter
(
iter
);
comp
=
true
;
iter
=
tSkipListCreateIterFromVal
(
pSkipList
,
(
char
*
)
cond
.
start
->
v
,
pSkipList
->
keyInfo
.
type
,
TSDB_ORDER_DESC
);
while
(
tSkipListIterNext
(
iter
))
{
SSkipListNode
*
pNode
=
tSkipListIterGet
(
iter
);
comp
=
comp
&&
(
pQueryInfo
->
compare
(
SL_GET_NODE_KEY
(
pSkipList
,
pNode
),
cond
.
start
->
v
)
==
0
);
if
(
comp
)
{
continue
;
}
taosArrayPush
(
result
,
SL_GET_NODE_DATA
(
pNode
));
}
}
else
{
assert
(
0
);
}
...
...
@@ -773,8 +798,6 @@ static void tSQLBinaryTraverseOnSkipList(tExprNode *pExpr, SArray *pResult, SSki
tSkipListDestroyIter
(
iter
);
}
static
void
tQueryIndexlessColumn
(
SSkipList
*
pSkipList
,
tQueryInfo
*
pQueryInfo
,
SArray
*
result
)
{
SSkipListIterator
*
iter
=
tSkipListCreateIter
(
pSkipList
);
...
...
@@ -785,7 +808,7 @@ static void tQueryIndexlessColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo,
char
*
pTable
=
SL_GET_NODE_DATA
(
pNode
);
//todo refactor:
char
*
name
=
(
*
(
STable
**
)
pTable
)
->
name
;
tstr
*
name
=
((
STableIndexElem
*
)
pTable
)
->
pTable
->
name
;
// char* name = NULL;
// tsdbGetTableName(tsdb, pTable, &name);
...
...
src/query/src/queryExecutor.c
浏览文件 @
ebcbafee
此差异已折叠。
点击以展开。
src/rpc/src/rpcMain.c
浏览文件 @
ebcbafee
...
...
@@ -1094,8 +1094,8 @@ static void rpcSendMsgToPeer(SRpcConn *pConn, void *msg, int msgLen) {
}
else
{
if
(
pHead
->
code
==
0
)
pConn
->
secured
=
1
;
// for success response, set link as secured
if
(
pHead
->
msgType
<
TSDB_MSG_TYPE_CM_HEARTBEAT
||
(
rpcDebugFlag
&
16
))
tTrace
(
"%s %p, %s is sent to
%s
:%hu, code:0x%x len:%d sig:0x%08x:0x%08x:%d"
,
pRpc
->
label
,
pConn
,
taosMsg
[
pHead
->
msgType
],
pConn
->
peer
Fqdn
,
pConn
->
peerPort
,
tTrace
(
"%s %p, %s is sent to
0x%x
:%hu, code:0x%x len:%d sig:0x%08x:0x%08x:%d"
,
pRpc
->
label
,
pConn
,
taosMsg
[
pHead
->
msgType
],
pConn
->
peer
Ip
,
pConn
->
peerPort
,
htonl
(
pHead
->
code
),
msgLen
,
pHead
->
sourceId
,
pHead
->
destId
,
pHead
->
tranId
);
}
...
...
src/tsdb/inc/tsdbMain.h
浏览文件 @
ebcbafee
...
...
@@ -81,7 +81,6 @@ typedef struct {
// ---------- TSDB TABLE DEFINITION
typedef
struct
STable
{
int8_t
type
;
char
*
name
;
STableId
tableId
;
int64_t
superUid
;
// Super table UID
int32_t
sversion
;
...
...
@@ -96,9 +95,10 @@ typedef struct STable {
TSKEY
lastKey
;
// lastkey inserted in this table, initialized as 0, TODO: make a structure
struct
STable
*
next
;
// TODO: remove the next
struct
STable
*
prev
;
tstr
*
name
;
// NOTE: there a flexible string here
}
STable
;
#define TSDB_GET_TABLE_LAST_KEY(
pTable) ((pTable
)->lastKey)
#define TSDB_GET_TABLE_LAST_KEY(
tb) ((tb
)->lastKey)
void
*
tsdbEncodeTable
(
STable
*
pTable
,
int
*
contLen
);
STable
*
tsdbDecodeTable
(
void
*
cont
,
int
contLen
);
...
...
@@ -121,6 +121,12 @@ typedef struct {
int
maxCols
;
}
STsdbMeta
;
// element put in skiplist for each table
typedef
struct
STableIndexElem
{
STsdbMeta
*
pMeta
;
STable
*
pTable
;
}
STableIndexElem
;
STsdbMeta
*
tsdbInitMeta
(
char
*
rootDir
,
int32_t
maxTables
);
int32_t
tsdbFreeMeta
(
STsdbMeta
*
pMeta
);
STSchema
*
tsdbGetTableSchema
(
STsdbMeta
*
pMeta
,
STable
*
pTable
);
...
...
@@ -150,7 +156,7 @@ int32_t tsdbDropTableImpl(STsdbMeta *pMeta, STableId tableId);
STable
*
tsdbIsValidTableToInsert
(
STsdbMeta
*
pMeta
,
STableId
tableId
);
// int32_t tsdbInsertRowToTableImpl(SSkipListNode *pNode, STable *pTable);
STable
*
tsdbGetTableByUid
(
STsdbMeta
*
pMeta
,
int64_t
uid
);
char
*
getTupleKey
(
const
void
*
data
);
char
*
getTSTupleKey
(
const
void
*
data
);
typedef
struct
{
int
blockId
;
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
ebcbafee
...
...
@@ -808,7 +808,7 @@ static int32_t tdInsertRowToTable(STsdbRepo *pRepo, SDataRow row, STable *pTable
if
(
pTable
->
mem
==
NULL
)
{
pTable
->
mem
=
(
SMemTable
*
)
calloc
(
1
,
sizeof
(
SMemTable
));
if
(
pTable
->
mem
==
NULL
)
return
-
1
;
pTable
->
mem
->
pData
=
tSkipListCreate
(
5
,
TSDB_DATA_TYPE_TIMESTAMP
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
],
0
,
0
,
0
,
getTupleKey
);
pTable
->
mem
->
pData
=
tSkipListCreate
(
5
,
TSDB_DATA_TYPE_TIMESTAMP
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
],
0
,
0
,
0
,
getT
ST
upleKey
);
pTable
->
mem
->
keyFirst
=
INT64_MAX
;
pTable
->
mem
->
keyLast
=
0
;
}
...
...
@@ -831,7 +831,7 @@ static int32_t tdInsertRowToTable(STsdbRepo *pRepo, SDataRow row, STable *pTable
if
(
pTable
->
mem
==
NULL
)
{
pTable
->
mem
=
(
SMemTable
*
)
calloc
(
1
,
sizeof
(
SMemTable
));
if
(
pTable
->
mem
==
NULL
)
return
-
1
;
pTable
->
mem
->
pData
=
tSkipListCreate
(
5
,
TSDB_DATA_TYPE_TIMESTAMP
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
],
0
,
0
,
0
,
getTupleKey
);
pTable
->
mem
->
pData
=
tSkipListCreate
(
5
,
TSDB_DATA_TYPE_TIMESTAMP
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
],
0
,
0
,
0
,
getT
ST
upleKey
);
pTable
->
mem
->
keyFirst
=
INT64_MAX
;
pTable
->
mem
->
keyLast
=
0
;
}
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
ebcbafee
#include <stdlib.h>
// #include "taosdef.h"
#include "tskiplist.h"
#include "tsdb.h"
#include "taosdef.h"
...
...
@@ -10,6 +8,8 @@
#define TSDB_SUPER_TABLE_SL_LEVEL 5 // TODO: may change here
#define TSDB_META_FILE_NAME "META"
const
int32_t
DEFAULT_TAG_INDEX_COLUMN
=
0
;
static
int
tsdbFreeTable
(
STable
*
pTable
);
static
int32_t
tsdbCheckTableCfg
(
STableCfg
*
pCfg
);
static
int
tsdbAddTableToMeta
(
STsdbMeta
*
pMeta
,
STable
*
pTable
,
bool
addIdx
);
...
...
@@ -39,11 +39,12 @@ void *tsdbEncodeTable(STable *pTable, int *contLen) {
void
*
ptr
=
ret
;
T_APPEND_MEMBER
(
ptr
,
pTable
,
STable
,
type
);
// Encode name
*
(
int
*
)
ptr
=
strl
en
(
pTable
->
name
);
// Encode name
, todo refactor
*
(
int
*
)
ptr
=
varDataL
en
(
pTable
->
name
);
ptr
=
(
char
*
)
ptr
+
sizeof
(
int
);
memcpy
(
ptr
,
pTable
->
name
,
strlen
(
pTable
->
name
));
ptr
=
(
char
*
)
ptr
+
strlen
(
pTable
->
name
);
memcpy
(
ptr
,
varDataVal
(
pTable
->
name
),
varDataLen
(
pTable
->
name
));
ptr
=
(
char
*
)
ptr
+
varDataLen
(
pTable
->
name
);
T_APPEND_MEMBER
(
ptr
,
&
(
pTable
->
tableId
),
STableId
,
uid
);
T_APPEND_MEMBER
(
ptr
,
&
(
pTable
->
tableId
),
STableId
,
tid
);
T_APPEND_MEMBER
(
ptr
,
pTable
,
STable
,
superUid
);
...
...
@@ -79,9 +80,12 @@ STable *tsdbDecodeTable(void *cont, int contLen) {
T_READ_MEMBER
(
ptr
,
int8_t
,
pTable
->
type
);
int
len
=
*
(
int
*
)
ptr
;
ptr
=
(
char
*
)
ptr
+
sizeof
(
int
);
pTable
->
name
=
calloc
(
1
,
len
+
1
);
pTable
->
name
=
calloc
(
1
,
len
+
VARSTR_HEADER_SIZE
);
if
(
pTable
->
name
==
NULL
)
return
NULL
;
memcpy
(
pTable
->
name
,
ptr
,
len
);
varDataSetLen
(
pTable
->
name
,
len
);
memcpy
(
pTable
->
name
->
data
,
ptr
,
len
);
ptr
=
(
char
*
)
ptr
+
len
;
T_READ_MEMBER
(
ptr
,
int64_t
,
pTable
->
tableId
.
uid
);
T_READ_MEMBER
(
ptr
,
int32_t
,
pTable
->
tableId
.
tid
);
...
...
@@ -105,8 +109,13 @@ void tsdbFreeEncode(void *cont) {
}
static
char
*
getTagIndexKey
(
const
void
*
pData
)
{
STable
*
table
=
*
(
STable
**
)
pData
;
return
getTupleKey
(
table
->
tagVal
);
STableIndexElem
*
elem
=
(
STableIndexElem
*
)
pData
;
SDataRow
row
=
elem
->
pTable
->
tagVal
;
STSchema
*
pSchema
=
tsdbGetTableTagSchema
(
elem
->
pMeta
,
elem
->
pTable
);
STColumn
*
pCol
=
&
pSchema
->
columns
[
DEFAULT_TAG_INDEX_COLUMN
];
return
tdGetRowDataOfCol
(
row
,
pCol
->
type
,
TD_DATA_ROW_HEAD_SIZE
+
pCol
->
offset
);
}
int
tsdbRestoreTable
(
void
*
pHandle
,
void
*
cont
,
int
contLen
)
{
...
...
@@ -225,36 +234,28 @@ STSchema * tsdbGetTableTagSchema(STsdbMeta *pMeta, STable *pTable) {
}
}
// todo refactor table name definition
int32_t
tsdbGetTableTagVal
(
TsdbRepoT
*
repo
,
STableId
*
id
,
int32_t
colId
,
int16_t
*
type
,
int16_t
*
bytes
,
char
**
val
)
{
STsdbMeta
*
pMeta
=
tsdbGetMeta
(
repo
);
STable
*
pTable
=
tsdbGetTableByUid
(
pMeta
,
id
->
uid
);
STSchema
*
pSchema
=
tsdbGetTableTagSchema
(
pMeta
,
pTable
);
STColumn
*
pCol
=
NULL
;
int32_t
offset
=
0
;
for
(
int32_t
col
=
0
;
col
<
schemaNCols
(
pSchema
);
++
col
)
{
STColumn
*
p
=
schemaColAt
(
pSchema
,
col
);
if
(
p
->
colId
==
colId
)
{
pCol
=
p
;
break
;
}
if
(
p
->
type
==
TSDB_DATA_TYPE_BINARY
||
p
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
offset
+=
sizeof
(
int32_t
);
}
else
{
offset
+=
p
->
bytes
;
}
}
if
(
pCol
==
NULL
)
{
return
-
1
;
// No matched tags. Maybe the modification of tags has not been done yet.
}
assert
(
pCol
!=
NULL
);
SDataRow
row
=
(
SDataRow
)
pTable
->
tagVal
;
char
*
d
=
tdGetRowDataOfCol
(
row
,
pCol
->
type
,
TD_DATA_ROW_HEAD_SIZE
+
offset
);
char
*
d
=
tdGetRowDataOfCol
(
row
,
pCol
->
type
,
TD_DATA_ROW_HEAD_SIZE
+
pCol
->
offset
);
*
val
=
d
;
*
type
=
pCol
->
type
;
...
...
@@ -263,15 +264,22 @@ int32_t tsdbGetTableTagVal(TsdbRepoT* repo, STableId* id, int32_t colId, int16_t
return
TSDB_CODE_SUCCESS
;
}
int32_t
tsdbGetTableName
(
TsdbRepoT
*
repo
,
STableId
*
id
,
char
**
name
)
{
char
*
tsdbGetTableName
(
TsdbRepoT
*
repo
,
const
STableId
*
id
,
int16_t
*
bytes
)
{
STsdbMeta
*
pMeta
=
tsdbGetMeta
(
repo
);
STable
*
pTable
=
tsdbGetTableByUid
(
pMeta
,
id
->
uid
);
*
name
=
strndup
(
pTable
->
name
,
TSDB_TABLE_NAME_LEN
);
if
(
*
name
==
NULL
)
{
return
-
1
;
if
(
pTable
==
NULL
)
{
if
(
bytes
!=
NULL
)
{
*
bytes
=
0
;
}
return
NULL
;
}
else
{
return
0
;
if
(
bytes
!=
NULL
)
{
*
bytes
=
varDataLen
(
pTable
->
name
);
}
return
(
char
*
)
pTable
->
name
;
}
}
...
...
@@ -296,7 +304,11 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
super
->
schema
=
tdDupSchema
(
pCfg
->
schema
);
super
->
tagSchema
=
tdDupSchema
(
pCfg
->
tagSchema
);
super
->
tagVal
=
NULL
;
super
->
name
=
strdup
(
pCfg
->
sname
);
// todo refactor extract method
size_t
size
=
strnlen
(
pCfg
->
sname
,
TSDB_TABLE_NAME_LEN
);
super
->
name
=
malloc
(
size
+
VARSTR_HEADER_SIZE
);
STR_WITH_SIZE_TO_VARSTR
(
super
->
name
,
pCfg
->
sname
,
size
);
// index the first tag column
STColumn
*
pColSchema
=
schemaColAt
(
super
->
tagSchema
,
0
);
...
...
@@ -322,7 +334,11 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
}
table
->
tableId
=
pCfg
->
tableId
;
table
->
name
=
strdup
(
pCfg
->
name
);
size_t
size
=
strnlen
(
pCfg
->
name
,
TSDB_TABLE_NAME_LEN
);
table
->
name
=
malloc
(
size
+
VARSTR_HEADER_SIZE
);
STR_WITH_SIZE_TO_VARSTR
(
table
->
name
,
pCfg
->
name
,
size
);
table
->
lastKey
=
0
;
if
(
IS_CREATE_STABLE
(
pCfg
))
{
// TSDB_CHILD_TABLE
table
->
type
=
TSDB_CHILD_TABLE
;
...
...
@@ -513,11 +529,14 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable) {
// NOTE: do not allocate the space for key, since in each skip list node, only keep the pointer to pTable, not the
// actual key value, and the key value will be retrieved during query through the pTable and getTagIndexKey function
SSkipListNode
*
pNode
=
calloc
(
1
,
headSize
+
POINTER_BYTES
);
SSkipListNode
*
pNode
=
calloc
(
1
,
headSize
+
sizeof
(
STableIndexElem
)
);
pNode
->
level
=
level
;
SSkipList
*
list
=
pSTable
->
pIndex
;
memcpy
(
SL_GET_NODE_DATA
(
pNode
),
&
pTable
,
POINTER_BYTES
);
STableIndexElem
*
elem
=
(
STableIndexElem
*
)
(
SL_GET_NODE_DATA
(
pNode
));
elem
->
pTable
=
pTable
;
elem
->
pMeta
=
pMeta
;
tSkipListPut
(
list
,
pNode
);
return
0
;
...
...
@@ -539,7 +558,7 @@ static int tsdbRemoveTableFromIndex(STsdbMeta *pMeta, STable *pTable) {
static
int
tsdbEstimateTableEncodeSize
(
STable
*
pTable
)
{
int
size
=
0
;
size
+=
T_MEMBER_SIZE
(
STable
,
type
);
size
+=
sizeof
(
int
)
+
strl
en
(
pTable
->
name
);
size
+=
sizeof
(
int
)
+
varDataL
en
(
pTable
->
name
);
size
+=
T_MEMBER_SIZE
(
STable
,
tableId
);
size
+=
T_MEMBER_SIZE
(
STable
,
superUid
);
size
+=
T_MEMBER_SIZE
(
STable
,
sversion
);
...
...
@@ -556,8 +575,7 @@ static int tsdbEstimateTableEncodeSize(STable *pTable) {
return
size
;
}
char
*
getTupleKey
(
const
void
*
data
)
{
char
*
getT
ST
upleKey
(
const
void
*
data
)
{
SDataRow
row
=
(
SDataRow
)
data
;
return
POINTER_SHIFT
(
row
,
TD_DATA_ROW_HEAD_SIZE
);
}
\ No newline at end of file
src/tsdb/src/tsdbRead.c
浏览文件 @
ebcbafee
...
...
@@ -620,9 +620,13 @@ static void filterDataInDataBlock(STsdbQueryHandle* pQueryHandle, STableCheckInf
if
(
pCol
->
info
.
type
!=
TSDB_DATA_TYPE_BINARY
&&
pCol
->
info
.
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
memmove
(
pCol
->
pData
,
src
->
pData
+
bytes
*
start
,
bytes
*
pQueryHandle
->
realNumOfRows
);
}
else
{
// handle the var-string
char
*
dst
=
pCol
->
pData
;
// todo refactor, only copy one-by-one
for
(
int32_t
k
=
start
;
k
<
pQueryHandle
->
realNumOfRows
+
start
;
++
k
)
{
char
*
p
=
tdGetColDataOfRow
(
src
,
k
);
memcpy
(
pCol
->
pData
+
k
*
bytes
,
p
,
varDataTLen
(
p
));
// todo refactor
memcpy
(
dst
,
p
,
varDataTLen
(
p
));
dst
+=
varDataTLen
(
p
);
}
}
...
...
@@ -1076,17 +1080,13 @@ static int tsdbReadRowsFromCache(SSkipListIterator* pIter, STable* pTable, TSKEY
}
assert
(
offset
!=
-
1
);
// todo handle error
void
*
value
=
tdGetRowDataOfCol
(
row
,
pColInfo
->
info
.
type
,
TD_DATA_ROW_HEAD_SIZE
+
offset
);
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_BINARY
||
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_NCHAR
)
{
void
*
value
=
tdGetRowDataOfCol
(
row
,
pColInfo
->
info
.
type
,
TD_DATA_ROW_HEAD_SIZE
+
offset
);
memcpy
(
pData
,
value
,
varDataTLen
(
value
));
offset
+=
sizeof
(
int32_t
);
}
else
{
memcpy
(
pData
,
dataRowTuple
(
row
)
+
offset
,
pColInfo
->
info
.
bytes
);
offset
+=
pColInfo
->
info
.
bytes
;
memcpy
(
pData
,
value
,
pColInfo
->
info
.
bytes
);
}
}
numOfRows
++
;
...
...
@@ -1225,8 +1225,8 @@ static int32_t getAllTableIdList(STable* pSuperTable, SArray* list) {
while
(
tSkipListIterNext
(
iter
))
{
SSkipListNode
*
pNode
=
tSkipListIterGet
(
iter
);
STable
*
t
=
*
(
STable
**
)
SL_GET_NODE_DATA
(
pNode
);
taosArrayPush
(
list
,
&
t
->
tableId
);
STable
IndexElem
*
elem
=
(
STableIndexElem
*
)(
SL_GET_NODE_DATA
((
SSkipListNode
*
)
pNode
)
);
taosArrayPush
(
list
,
&
elem
->
pTable
->
tableId
);
}
tSkipListDestroyIter
(
iter
);
...
...
@@ -1235,6 +1235,7 @@ static int32_t getAllTableIdList(STable* pSuperTable, SArray* list) {
/**
* convert the result pointer to table id instead of table object pointer
* todo remove it by using callback function to change the final result in-time.
* @param pRes
*/
static
void
convertQueryResult
(
SArray
*
pRes
,
SArray
*
pTableList
)
{
...
...
@@ -1244,8 +1245,8 @@ static void convertQueryResult(SArray* pRes, SArray* pTableList) {
size_t
size
=
taosArrayGetSize
(
pTableList
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
// todo speedup by using reserve space.
STable
*
pTable
=
taosArrayGetP
(
pTableList
,
i
);
taosArrayPush
(
pRes
,
&
pTable
->
tableId
);
STable
IndexElem
*
elem
=
taosArrayGet
(
pTableList
,
i
);
taosArrayPush
(
pRes
,
&
elem
->
pTable
->
tableId
);
}
}
...
...
@@ -1309,8 +1310,13 @@ void filterPrepare(void* expr, void* param) {
pInfo
->
q
=
(
char
*
)
pCond
->
arr
;
}
else
{
pInfo
->
q
=
calloc
(
1
,
pSchema
->
bytes
);
if
(
pSchema
->
type
==
TSDB_DATA_TYPE_BINARY
||
pSchema
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
varDataSetLen
(
pInfo
->
q
,
pCond
->
nLen
);
tVariantDump
(
pCond
,
varDataVal
(
pInfo
->
q
),
pSchema
->
type
);
}
else
{
tVariantDump
(
pCond
,
pInfo
->
q
,
pSchema
->
type
);
}
}
}
typedef
struct
STableGroupSupporter
{
...
...
@@ -1341,16 +1347,16 @@ int32_t tableGroupComparFn(const void *p1, const void *p2, const void *param) {
int32_t
bytes
=
0
;
if
(
colIndex
==
TSDB_TBNAME_COLUMN_INDEX
)
{
f1
=
pTable1
->
name
;
f2
=
pTable2
->
name
;
f1
=
(
char
*
)
pTable1
->
name
;
f2
=
(
char
*
)
pTable2
->
name
;
type
=
TSDB_DATA_TYPE_BINARY
;
bytes
=
TSDB_TABLE_NAME_LEN
;
bytes
=
TSDB_TABLE_NAME_LEN
+
VARSTR_HEADER_SIZE
;
}
else
{
f1
=
dataRowTuple
(
pTable1
->
tagVal
);
f2
=
dataRowTuple
(
pTable2
->
tagVal
)
;
STColumn
*
pCol
=
schemaColAt
(
pTableGroupSupp
->
pTagSchema
,
colIndex
);
bytes
=
pCol
->
bytes
;
type
=
schemaColAt
(
pTableGroupSupp
->
pTagSchema
,
colIndex
)
->
type
;
bytes
=
schemaColAt
(
pTableGroupSupp
->
pTagSchema
,
colIndex
)
->
bytes
;
f1
=
tdGetRowDataOfCol
(
pTable1
->
tagVal
,
pCol
->
type
,
TD_DATA_ROW_HEAD_SIZE
+
pCol
->
offset
)
;
f2
=
tdGetRowDataOfCol
(
pTable2
->
tagVal
,
pCol
->
type
,
TD_DATA_ROW_HEAD_SIZE
+
pCol
->
offset
)
;
}
int32_t
ret
=
doCompare
(
f1
,
f2
,
type
,
bytes
);
...
...
@@ -1429,23 +1435,19 @@ SArray* createTableGroup(SArray* pTableList, STSchema* pTagSchema, SColIndex* pC
bool
tSkipListNodeFilterCallback
(
const
void
*
pNode
,
void
*
param
)
{
tQueryInfo
*
pInfo
=
(
tQueryInfo
*
)
param
;
STable
*
pTable
=
*
(
STable
*
*
)(
SL_GET_NODE_DATA
((
SSkipListNode
*
)
pNode
));
STable
IndexElem
*
elem
=
(
STableIndexElem
*
)(
SL_GET_NODE_DATA
((
SSkipListNode
*
)
pNode
));
char
*
val
=
NULL
;
int8_t
type
=
pInfo
->
sch
.
type
;
if
(
pInfo
->
colIndex
==
TSDB_TBNAME_COLUMN_INDEX
)
{
val
=
pTable
->
name
;
val
=
(
char
*
)
elem
->
pTable
->
name
;
type
=
TSDB_DATA_TYPE_BINARY
;
}
else
{
STSchema
*
pTSchema
=
(
STSchema
*
)
pInfo
->
param
;
// todo table schema is identical to stable schema??
int32_t
offset
=
pTSchema
->
columns
[
pInfo
->
colIndex
].
offset
;
if
(
pInfo
->
sch
.
type
==
TSDB_DATA_TYPE_BINARY
||
pInfo
->
sch
.
type
==
TSDB_DATA_TYPE_NCHAR
)
{
val
=
tdGetRowDataOfCol
(
pTable
->
tagVal
,
pInfo
->
sch
.
type
,
TD_DATA_ROW_HEAD_SIZE
+
offset
);
}
else
{
val
=
dataRowTuple
(
pTable
->
tagVal
)
+
offset
;
}
val
=
tdGetRowDataOfCol
(
elem
->
pTable
->
tagVal
,
pInfo
->
sch
.
type
,
TD_DATA_ROW_HEAD_SIZE
+
offset
);
}
int32_t
ret
=
0
;
...
...
@@ -1456,8 +1458,6 @@ bool tSkipListNodeFilterCallback(const void* pNode, void* param) {
ret
=
pInfo
->
compare
(
val
,
pInfo
->
q
);
}
}
else
{
// tVariant t = {0};
// tVariantCreateFromBinary(&t, val, (uint32_t)pInfo->sch.bytes, type);
ret
=
pInfo
->
compare
(
val
,
pInfo
->
q
);
}
...
...
@@ -1502,7 +1502,7 @@ static int32_t doQueryTableList(STable* pSTable, SArray* pRes, tExprNode* pExpr)
.
pExtInfo
=
pSTable
->
tagSchema
,
};
SArray
*
pTableList
=
taosArrayInit
(
8
,
POINTER_BYTES
);
SArray
*
pTableList
=
taosArrayInit
(
8
,
sizeof
(
STableIndexElem
)
);
tExprTreeTraverse
(
pExpr
,
pSTable
->
pIndex
,
pTableList
,
&
supp
);
tExprTreeDestroy
(
&
pExpr
,
destroyHelper
);
...
...
src/util/src/talgo.c
浏览文件 @
ebcbafee
...
...
@@ -144,11 +144,11 @@ static void tqsortImpl(void *src, int32_t start, int32_t end, size_t size, const
}
if
(
leftPartEnd
>
start
)
{
tqsortImpl
(
src
,
s
ize
,
start
,
leftPartEnd
,
param
,
comparFn
,
buf
);
tqsortImpl
(
src
,
s
tart
,
leftPartEnd
,
size
,
param
,
comparFn
,
buf
);
}
if
(
rightPartStart
<
end
)
{
tqsortImpl
(
src
,
size
,
rightPartStart
,
end
,
param
,
comparFn
,
buf
);
tqsortImpl
(
src
,
rightPartStart
,
end
,
size
,
param
,
comparFn
,
buf
);
}
}
...
...
src/util/src/tcompare.c
浏览文件 @
ebcbafee
...
...
@@ -60,8 +60,15 @@ int32_t compareDoubleVal(const void *pLeft, const void *pRight) {
}
}
int32_t
compareStrVal
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
return
(
int32_t
)
strcmp
(
pLeft
,
pRight
);
int32_t
compareLenPrefixedStr
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
int32_t
len1
=
varDataLen
(
pLeft
);
int32_t
len2
=
varDataLen
(
pRight
);
if
(
len1
!=
len2
)
{
return
len1
>
len2
?
1
:-
1
;
}
else
{
return
(
int32_t
)
strncmp
(
varDataVal
(
pLeft
),
varDataVal
(
pRight
),
len1
);
}
}
int32_t
compareWStrVal
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
...
...
@@ -267,7 +274,7 @@ __compar_fn_t getComparFunc(int32_t type, int32_t optr) {
}
else
if
(
optr
==
TSDB_RELATION_IN
)
{
comparFn
=
compareFindStrInArray
;
}
else
{
/* normal relational comparFn */
comparFn
=
compare
StrVal
;
comparFn
=
compare
LenPrefixedStr
;
}
break
;
...
...
@@ -296,6 +303,7 @@ __compar_fn_t getKeyComparFunc(int32_t keyType) {
switch
(
keyType
)
{
case
TSDB_DATA_TYPE_TINYINT
:
case
TSDB_DATA_TYPE_BOOL
:
comparFn
=
compareInt8Val
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
...
...
@@ -308,17 +316,13 @@ __compar_fn_t getKeyComparFunc(int32_t keyType) {
case
TSDB_DATA_TYPE_TIMESTAMP
:
comparFn
=
compareInt64Val
;
break
;
case
TSDB_DATA_TYPE_BOOL
:
comparFn
=
compareInt32Val
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_DOUBLE
:
comparFn
=
compareDoubleVal
;
break
;
case
TSDB_DATA_TYPE_BINARY
:
comparFn
=
compare
StrVal
;
comparFn
=
compare
LenPrefixedStr
;
break
;
case
TSDB_DATA_TYPE_NCHAR
:
...
...
@@ -349,13 +353,20 @@ int32_t doCompare(const char* f1, const char* f2, int32_t type, size_t size) {
}
return
(
ret
<
0
)
?
-
1
:
1
;
}
default:
{
int32_t
ret
=
strncmp
(
f1
,
f2
,
(
size_t
)
size
);
default:
{
// todo refactor
tstr
*
t1
=
(
tstr
*
)
f1
;
tstr
*
t2
=
(
tstr
*
)
f2
;
if
(
t1
->
len
!=
t2
->
len
)
{
return
t1
->
len
>
t2
->
len
?
1
:-
1
;
}
else
{
int32_t
ret
=
strncmp
(
t1
->
data
,
t2
->
data
,
t1
->
len
);
if
(
ret
==
0
)
{
return
ret
;
return
0
;
}
else
{
return
ret
<
0
?
-
1
:
1
;
}
}
return
(
ret
<
0
)
?
-
1
:
1
;
}
}
}
src/util/src/tconfig.c
浏览文件 @
ebcbafee
...
...
@@ -236,7 +236,7 @@ void taosReadGlobalLogCfg() {
int
olen
,
vlen
;
char
fileName
[
PATH_MAX
]
=
{
0
};
m
d
ebugFlag
=
135
;
m
D
ebugFlag
=
135
;
sdbDebugFlag
=
135
;
wordexp_t
full_path
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
ebcbafee
...
...
@@ -267,7 +267,7 @@ void vnodeRelease(void *pVnodeRaw) {
assert
(
refCount
>=
0
);
if
(
refCount
>
0
)
{
vTrace
(
"vgId:%d, release vnode, refCount:%d"
,
pVnode
,
vgId
,
refCount
);
vTrace
(
"vgId:%d, release vnode, refCount:%d"
,
vgId
,
refCount
);
return
;
}
...
...
@@ -693,8 +693,9 @@ static bool vnodeReadVersion(SVnodeObj *pVnode) {
sprintf
(
versionFile
,
"%s/vnode%d/version.json"
,
tsVnodeDir
,
pVnode
->
vgId
);
FILE
*
fp
=
fopen
(
versionFile
,
"r"
);
if
(
!
fp
)
{
vTrace
(
"vgId:%d, failed to open version file:%s error:%s"
,
pVnode
->
vgId
,
versionFile
,
strerror
(
errno
));
if
(
errno
!=
ENOENT
)
{
vError
(
"vgId:%d, failed to open version file:%s error:%s"
,
pVnode
->
vgId
,
versionFile
,
strerror
(
errno
));
}
return
false
;
}
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
ebcbafee
...
...
@@ -239,7 +239,7 @@ static int32_t vnodeProcessDropStableMsg(SVnodeObj *pVnode, void *pCont, SRspRet
code
=
tsdbDropTable
(
pVnode
->
tsdb
,
stableId
);
vTrace
(
"vgId:%d, stable:%s, drop stable result:%s"
,
pVnode
,
pTable
->
tableId
,
tstrerror
(
code
));
vTrace
(
"vgId:%d, stable:%s, drop stable result:%s"
,
pVnode
->
vgId
,
pTable
->
tableId
,
tstrerror
(
code
));
return
code
;
}
...
...
tests/script/general/cache/restart_metrics.sim
浏览文件 @
ebcbafee
...
...
@@ -27,11 +27,15 @@ sql create table $tb using $mt tags( "1" )
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
#print ===>rows $rows, data $data01
if $rows != 1 then
print expect 1, actual: $rows
return -1
endi
if $data01 != 1 then
print expect 1 actual: $data01
return -1
endi
...
...
@@ -67,7 +71,9 @@ print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
print expect 1, actual $data01
return -1
endi
...
...
@@ -80,6 +86,7 @@ if $data01 != 1 then
return -1
endi
if $data02 != 3 then
print expect 3 actual: $data02
return -1
endi
...
...
tests/script/general/db/delete_reusevnode2.sim
浏览文件 @
ebcbafee
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
...
...
@@ -36,7 +34,7 @@ while $i < 10
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
$tb1 = $tb .
5
$tb1 = $tb .
4
sql create table $tb1 using st tags(1)
sql insert into $tb1 values(now, 1);
...
...
@@ -58,7 +56,7 @@ while $i < 10
sql drop table st
sleep
1
000
sleep
2
000
print times $i
$i = $i + 1
...
...
tests/script/general/field/bigint.sim
浏览文件 @
ebcbafee
...
...
@@ -132,7 +132,9 @@ endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
if $data00 != 100 then
print expect 100, actual $data00
return -1
endi
...
...
tests/script/general/parser/lastrow_query.sim
浏览文件 @
ebcbafee
...
...
@@ -43,9 +43,11 @@ if $data07 != 1 then
return -1
endi
if $data08 != BINARY then
print expect BINARY actual: $data08
return -1
endi
if $data09 != NCHAR then
print expect NCHAR actual: $data09
return -1
endi
tests/script/general/parser/testSuite.sim
浏览文件 @
ebcbafee
# run general/parser/alter.sim
# sleep 2000
# run general/parser/alter1.sim
# sleep 2000
# run general/parser/alter_stable.sim
# sleep 2000
# run general/parser/auto_create_tb.sim
# sleep 2000
# run general/parser/auto_create_tb_drop_tb.sim
# sleep 2000
#run general/parser/alter.sim
#sleep 2000
#run general/parser/alter1.sim
#sleep 2000
#run general/parser/alter_stable.sim
#sleep 2000
#run general/parser/auto_create_tb.sim
#sleep 2000
#run general/parser/auto_create_tb_drop_tb.sim
run general/parser/binary_escapeCharacter.sim
sleep 2000
run general/parser/bug.sim
sleep 2000
run general/parser/col_arithmetic_operation.sim
sleep 2000
run general/parser/columnValue
_bigint
.sim
run general/parser/columnValue.sim
sleep 2000
run general/parser/co
lumnValue_bool
.sim
run general/parser/co
mmit
.sim
sleep 2000
run general/parser/c
olumnValue_double
.sim
run general/parser/c
reate_db
.sim
sleep 2000
run general/parser/c
olumnValue_floa
t.sim
run general/parser/c
reate_m
t.sim
sleep 2000
run general/parser/columnValue_int.sim
run general/parser/create_tb.sim
sleep 2000
run general/parser/dbtbnameValidate.sim
sleep 2000
run general/parser/import_commit1.sim
sleep 2000
run general/parser/import_commit2.sim
sleep 2000
run general/parser/import_commit3.sim
sleep 2000
run general/parser/insert_tb.sim
sleep 2000
run general/parser/first_last.sim
sleep 2000
run general/parser/import_file.sim
sleep 2000
run general/parser/fill.sim
sleep 2000
run general/parser/fill_stb.sim
sleep 2000
run general/parser/tags_dynamically_specifiy.sim
sleep 2000
run general/parser/interp.sim
run general/parser/lastrow.sim
sleep 2000
run general/parser/limit.sim
sleep 2000
run general/parser/limit1.sim
sleep 2000
run general/parser/limit1_tblocks100.sim
sleep 2000
run general/parser/limit2.sim
sleep 2000
run general/parser/mixed_blocks.sim
sleep 2000
run general/parser/nchar.sim
sleep 2000
run general/parser/null_char.sim
sleep 2000
run general/parser/selectResNum.sim
sleep 2000
run general/parser/select_across_vnodes.sim
sleep 2000
# sleep 2000
# run general/parser/col_arithmetic_operation.sim
# sleep 2000
# run general/parser/columnValue.sim
# sleep 2000
# run general/parser/commit.sim
# run general/parser/create_db.sim
# sleep 2000
# run general/parser/create_mt.sim
# sleep 2000
# run general/parser/create_tb.sim
# sleep 2000
# run general/parser/dbtbnameValidate.sim
# sleep 2000
# run general/parser/fill.sim
# sleep 2000
# run general/parser/fill_stb.sim
# sleep 2000
# run general/parser/first_last.sim
# sleep 2000
# run general/parser/import_commit1.sim
# sleep 2000
# run general/parser/import_commit2.sim
# sleep 2000
# run general/parser/import_commit3.sim
# sleep 2000
# run general/parser/import_file.sim
# sleep 2000
# run general/parser/insert_tb.sim
# sleep 2000
# run general/parser/tags_dynamically_specifiy.sim
# sleep 2000
# run general/parser/interp.sim
# run general/parser/lastrow.sim
# sleep 2000
# run general/parser/limit.sim
# sleep 2000
# run general/parser/limit1.sim
# sleep 2000
# run general/parser/limit1_tblocks100.sim
# sleep 2000
# run general/parser/limit2.sim
# sleep 2000
# run general/parser/mixed_blocks.sim
# sleep 2000
# run general/parser/nchar.sim
# sleep 2000
# run general/parser/null_char.sim
# sleep 2000
# run general/parser/selectResNum.sim
# sleep 2000
# run general/parser/select_across_vnodes.sim
# sleep 2000
run general/parser/select_from_cache_disk.sim
sleep 2000
#
run general/parser/set_tag_vals.sim
#
sleep 2000
#
run general/parser/single_row_in_tb.sim
#
sleep 2000
#
run general/parser/slimit.sim
#
sleep 2000
run general/parser/set_tag_vals.sim
sleep 2000
run general/parser/single_row_in_tb.sim
sleep 2000
run general/parser/slimit.sim
sleep 2000
run general/parser/slimit1.sim
sleep 2000
run general/parser/slimit1_query.sim
sleep 2000
# run general/parser/slimit_alter_tags.sim
# sleep 2000
# run general/parser/stream_on_sys.sim
# sleep 2000
# run general/parser/stream.sim
# sleep 2000
# run general/parser/tbnameIn.sim
# sleep 2000
# run general/parser/where.sim
# sleep 2000
# #run general/parser/repeatAlter.sim
# sleep 2000
# #run general/parser/repeatStream.sim
# sleep 2000
# run general/parser/join.sim
# run general/parser/join_multivnode.sim
# run general/parser/projection_limit_offset.sim
# sleep 2000
# run general/parser/select_with_tags.sim
# run general/parser/groupby.sim
run general/parser/slimit_alter_tags.sim
sleep 2000
run general/parser/stream_on_sys.sim
sleep 2000
run general/parser/stream.sim
sleep 2000
run general/parser/tbnameIn.sim
sleep 2000
run general/parser/where.sim
sleep 2000
#run general/parser/repeatAlter.sim
sleep 2000
#run general/parser/repeatStream.sim
sleep 2000
run general/parser/join.sim
sleep 2000
run general/parser/join_multivnode.sim
sleep 2000
run general/parser/projection_limit_offset.sim
sleep 2000
run general/parser/select_with_tags.sim
sleep 2000
run general/parser/groupby.sim
tests/script/general/tag/bool.sim
浏览文件 @
ebcbafee
...
...
@@ -123,6 +123,7 @@ if $rows != 100 then
endi
sql select * from $mt where tgcol = 1
if $rows != 100 then
print expect 100, actual:$rows
return -1
endi
sql select * from $mt where tgcol <> 1
...
...
tests/script/general/tag/filter.sim
浏览文件 @
ebcbafee
...
...
@@ -123,6 +123,7 @@ print =============== step14
sql select count(tbcol) as c from $mt where ts > 1000 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
print expect 100, actual $data00
return -1
endi
...
...
tests/script/test.sh
浏览文件 @
ebcbafee
...
...
@@ -99,7 +99,8 @@ echo "cDebugFlag 135" >> $TAOS_CFG
echo
"httpDebugFlag 135"
>>
$TAOS_CFG
echo
"monitorDebugFlag 135"
>>
$TAOS_CFG
echo
"udebugFlag 135"
>>
$TAOS_CFG
echo
"clog 0"
>>
$TAOS_CFG
echo
"tablemetakeeptimer 5"
>>
$TAOS_CFG
echo
"wal 0"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
echo
" "
>>
$TAOS_CFG
...
...
tests/script/unique/mnode/mgmt22.sim
浏览文件 @
ebcbafee
...
...
@@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
-t
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
sql connect
...
...
@@ -20,7 +20,7 @@ if $data2_1 != master then
endi
print ============== step2
system sh/exec_up.sh -n dnode2 -s start
-t
system sh/exec_up.sh -n dnode2 -s start
sql create dnode $hostname2
$x = 0
...
...
@@ -45,10 +45,6 @@ print ============== step3
sql_error drop dnode $hostname1 -x error1
print should not drop master
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
return
print ============== step4
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
sql_error show mnodes
...
...
@@ -83,7 +79,7 @@ if $data2_2 != slave then
endi
print ============== step7
system sh/exec_up.sh -n dnode3 -s start
-t
system sh/exec_up.sh -n dnode3 -s start
sql create dnode $hostname3
sleep 5000
...
...
@@ -105,7 +101,7 @@ endi
if $data2_2 != slave then
goto show7
endi
if $data3_3 !=
NULL
then
if $data3_3 !=
null
then
goto show7
endi
...
...
tests/script/unique/vnode/replica2_basic2.sim
浏览文件 @
ebcbafee
...
...
@@ -27,6 +27,7 @@ system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
sql connect
sql create dnode $hostname2
system sh/exec_up.sh -n dnode2 -s start
...
...
@@ -89,6 +90,19 @@ if $data2_3 != 4 then
return -1
endi
if $data4_1 != ready then
print dnode1 status should ready but is $data4_1
return -1
endi
if $data4_2 != ready then
return -1
endi
if $data4_3 != ready then
return -1
endi
print ========= step2
sql insert into d1.t1 values(now, 2)
sql insert into d2.t2 values(now, 2)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录