Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d31d05fe
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d31d05fe
编写于
11月 14, 2022
作者:
M
Minghao Li
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into feature/3.0_mhli
上级
d381b4da
c47ac26e
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
339 addition
and
102 deletion
+339
-102
include/common/ttypes.h
include/common/ttypes.h
+2
-2
include/libs/function/taosudf.h
include/libs/function/taosudf.h
+1
-1
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+2
-3
include/util/types.h
include/util/types.h
+1
-1
packaging/release.bat
packaging/release.bat
+1
-1
packaging/tools/tdengine.iss
packaging/tools/tdengine.iss
+10
-0
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-0
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+3
-1
source/common/src/tmsg.c
source/common/src/tmsg.c
+4
-1
source/common/src/ttypes.c
source/common/src/ttypes.c
+18
-8
source/dnode/mnode/impl/src/mndQuery.c
source/dnode/mnode/impl/src/mndQuery.c
+4
-2
source/dnode/vnode/src/vnd/vnodeQuery.c
source/dnode/vnode/src/vnd/vnodeQuery.c
+4
-2
source/libs/command/src/command.c
source/libs/command/src/command.c
+1
-1
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+7
-7
source/libs/nodes/src/nodesUtilFuncs.c
source/libs/nodes/src/nodesUtilFuncs.c
+1
-1
source/libs/parser/src/parInsertSql.c
source/libs/parser/src/parInsertSql.c
+1
-0
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+12
-10
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+8
-5
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+5
-3
source/libs/stream/src/streamState.c
source/libs/stream/src/streamState.c
+3
-3
source/libs/tdb/src/db/tdbPCache.c
source/libs/tdb/src/db/tdbPCache.c
+8
-5
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+197
-15
source/libs/tdb/src/inc/tdbInt.h
source/libs/tdb/src/inc/tdbInt.h
+4
-1
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+1
-1
source/util/src/tconfig.c
source/util/src/tconfig.c
+4
-1
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+23
-23
tests/script/sh/checkAsan.sh
tests/script/sh/checkAsan.sh
+1
-1
tools/CMakeLists.txt
tools/CMakeLists.txt
+12
-3
未找到文件。
include/common/ttypes.h
浏览文件 @
d31d05fe
...
@@ -346,8 +346,8 @@ bool isValidDataType(int32_t type);
...
@@ -346,8 +346,8 @@ bool isValidDataType(int32_t type);
void
assignVal
(
char
*
val
,
const
char
*
src
,
int32_t
len
,
int32_t
type
);
void
assignVal
(
char
*
val
,
const
char
*
src
,
int32_t
len
,
int32_t
type
);
void
operateVal
(
void
*
dst
,
void
*
s1
,
void
*
s2
,
int32_t
optr
,
int32_t
type
);
void
operateVal
(
void
*
dst
,
void
*
s1
,
void
*
s2
,
int32_t
optr
,
int32_t
type
);
void
*
getDataMin
(
int32_t
type
);
void
*
getDataMin
(
int32_t
type
,
void
*
value
);
void
*
getDataMax
(
int32_t
type
);
void
*
getDataMax
(
int32_t
type
,
void
*
value
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
include/libs/function/taosudf.h
浏览文件 @
d31d05fe
...
@@ -104,7 +104,7 @@ typedef int32_t (*TUdfDestroyFunc)();
...
@@ -104,7 +104,7 @@ typedef int32_t (*TUdfDestroyFunc)();
} while (0)
} while (0)
#define udfColDataSetNull_var(pColumn, row) ((pColumn->colData.varLenCol.varOffsets)[row] = -1)
#define udfColDataSetNull_var(pColumn, row) ((pColumn->colData.varLenCol.varOffsets)[row] = -1)
typedef
uint16_t
VarDataLenT
;
// maxVarDataLen:
32767
typedef
uint16_t
VarDataLenT
;
// maxVarDataLen:
65535
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define varDataLen(v) ((VarDataLenT *)(v))[0]
#define varDataLen(v) ((VarDataLenT *)(v))[0]
#define varDataVal(v) ((char *)(v) + VARSTR_HEADER_SIZE)
#define varDataVal(v) ((char *)(v) + VARSTR_HEADER_SIZE)
...
...
include/libs/nodes/querynodes.h
浏览文件 @
d31d05fe
...
@@ -74,9 +74,8 @@ typedef struct SColumnNode {
...
@@ -74,9 +74,8 @@ typedef struct SColumnNode {
char
tableName
[
TSDB_TABLE_NAME_LEN
];
char
tableName
[
TSDB_TABLE_NAME_LEN
];
char
tableAlias
[
TSDB_TABLE_NAME_LEN
];
char
tableAlias
[
TSDB_TABLE_NAME_LEN
];
char
colName
[
TSDB_COL_NAME_LEN
];
char
colName
[
TSDB_COL_NAME_LEN
];
// SNode* pProjectRef;
int16_t
dataBlockId
;
int16_t
dataBlockId
;
int16_t
slotId
;
int16_t
slotId
;
}
SColumnNode
;
}
SColumnNode
;
typedef
struct
SColumnRefNode
{
typedef
struct
SColumnRefNode
{
...
...
include/util/types.h
浏览文件 @
d31d05fe
...
@@ -78,7 +78,7 @@ static FORCE_INLINE double taos_align_get_double(const char *pBuf) {
...
@@ -78,7 +78,7 @@ static FORCE_INLINE double taos_align_get_double(const char *pBuf) {
{ (*(double *)(x)) = (*(double *)(y)); }
{ (*(double *)(x)) = (*(double *)(y)); }
// #endif
// #endif
typedef
uint16_t
VarDataLenT
;
// maxVarDataLen:
32767
typedef
uint16_t
VarDataLenT
;
// maxVarDataLen:
65535
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define VARSTR_HEADER_SIZE sizeof(VarDataLenT)
#define varDataLen(v) ((VarDataLenT *)(v))[0]
#define varDataLen(v) ((VarDataLenT *)(v))[0]
...
...
packaging/release.bat
浏览文件 @
d31d05fe
...
@@ -39,7 +39,7 @@ if not exist %work_dir%\debug\ver-%2-x86 (
...
@@ -39,7 +39,7 @@ if not exist %work_dir%\debug\ver-%2-x86 (
md
%work_dir%
\debug\ver
-
%
2
-x
86
md
%work_dir%
\debug\ver
-
%
2
-x
86
)
)
cd
%work_dir%
\debug\ver
-
%
2
-x
64
cd
%work_dir%
\debug\ver
-
%
2
-x
64
rem #
call vcvarsall.bat x64
call
vcvarsall
.bat
x64
cmake
../../
-G
"NMake Makefiles JOM"
-DCMAKE
_MAKE_PROGRAM
=
jom
-DBUILD
_TOOLS
=
true
-DWEBSOCKET
=
true
-DBUILD
_HTTP
=
false
-DBUILD
_TEST
=
false
-DVERNUMBER
=
%
2
-DCPUTYPE
=
x64
cmake
../../
-G
"NMake Makefiles JOM"
-DCMAKE
_MAKE_PROGRAM
=
jom
-DBUILD
_TOOLS
=
true
-DWEBSOCKET
=
true
-DBUILD
_HTTP
=
false
-DBUILD
_TEST
=
false
-DVERNUMBER
=
%
2
-DCPUTYPE
=
x64
cmake
--build
.
cmake
--build
.
rd
/s /Q
C
:\TDengine
rd
/s /Q
C
:\TDengine
...
...
packaging/tools/tdengine.iss
浏览文件 @
d31d05fe
...
@@ -61,6 +61,16 @@ Source: {#MyAppSourceDir}{#MyAppExeName}; DestDir: "{app}"; Excludes: {#MyAppExc
...
@@ -61,6 +61,16 @@ Source: {#MyAppSourceDir}{#MyAppExeName}; DestDir: "{app}"; Excludes: {#MyAppExc
Source: {#MyAppSourceDir}{#MyAppTaosdemoExeName}; DestDir: "{app}"; Flags: igNoreversion recursesubdirs createallsubdirs
Source: {#MyAppSourceDir}{#MyAppTaosdemoExeName}; DestDir: "{app}"; Flags: igNoreversion recursesubdirs createallsubdirs
[run]
Filename: {sys}\sc.exe; Parameters: "create taosd start= DEMAND binPath= ""C:\\TDengine\\taosd.exe --win_service""" ; Flags: runhidden
Filename: {sys}\sc.exe; Parameters: "create taosadapter start= DEMAND binPath= ""C:\\TDengine\\taosadapter.exe --win_service""" ; Flags: runhidden
[UninstallRun]
RunOnceId: "stoptaosd"; Filename: {sys}\sc.exe; Parameters: "stop taosd" ; Flags: runhidden
RunOnceId: "stoptaosadapter"; Filename: {sys}\sc.exe; Parameters: "stop taosadapter" ; Flags: runhidden
RunOnceId: "deltaosd"; Filename: {sys}\sc.exe; Parameters: "delete taosd" ; Flags: runhidden
RunOnceId: "deltaosadapter"; Filename: {sys}\sc.exe; Parameters: "delete taosadapter" ; Flags: runhidden
[Registry]
[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};C:\TDengine"; \
ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};C:\TDengine"; \
...
...
source/client/src/clientMain.c
浏览文件 @
d31d05fe
...
@@ -677,6 +677,7 @@ static void destoryCatalogReq(SCatalogReq *pCatalogReq) {
...
@@ -677,6 +677,7 @@ static void destoryCatalogReq(SCatalogReq *pCatalogReq) {
taosArrayDestroy
(
pCatalogReq
->
pIndex
);
taosArrayDestroy
(
pCatalogReq
->
pIndex
);
taosArrayDestroy
(
pCatalogReq
->
pUser
);
taosArrayDestroy
(
pCatalogReq
->
pUser
);
taosArrayDestroy
(
pCatalogReq
->
pTableIndex
);
taosArrayDestroy
(
pCatalogReq
->
pTableIndex
);
taosArrayDestroy
(
pCatalogReq
->
pTableCfg
);
taosMemoryFree
(
pCatalogReq
);
taosMemoryFree
(
pCatalogReq
);
}
}
...
...
source/common/src/tdatablock.c
浏览文件 @
d31d05fe
...
@@ -277,7 +277,9 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int
...
@@ -277,7 +277,9 @@ int32_t colDataMergeCol(SColumnInfoData* pColumnInfoData, int32_t numOfRow1, int
pColumnInfoData
->
varmeta
.
allocLen
=
len
+
oldLen
;
pColumnInfoData
->
varmeta
.
allocLen
=
len
+
oldLen
;
}
}
memcpy
(
pColumnInfoData
->
pData
+
oldLen
,
pSource
->
pData
,
len
);
if
(
pColumnInfoData
->
pData
&&
pSource
->
pData
)
{
// TD-20382
memcpy
(
pColumnInfoData
->
pData
+
oldLen
,
pSource
->
pData
,
len
);
}
pColumnInfoData
->
varmeta
.
length
=
len
+
oldLen
;
pColumnInfoData
->
varmeta
.
length
=
len
+
oldLen
;
}
else
{
}
else
{
if
(
finalNumOfRows
>
(
*
capacity
))
{
if
(
finalNumOfRows
>
(
*
capacity
))
{
...
...
source/common/src/tmsg.c
浏览文件 @
d31d05fe
...
@@ -2591,7 +2591,10 @@ int32_t tDeserializeSUseDbBatchRsp(void *buf, int32_t bufLen, SUseDbBatchRsp *pR
...
@@ -2591,7 +2591,10 @@ int32_t tDeserializeSUseDbBatchRsp(void *buf, int32_t bufLen, SUseDbBatchRsp *pR
for
(
int32_t
i
=
0
;
i
<
numOfBatch
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfBatch
;
++
i
)
{
SUseDbRsp
usedbRsp
=
{
0
};
SUseDbRsp
usedbRsp
=
{
0
};
if
(
tDeserializeSUseDbRspImp
(
&
decoder
,
&
usedbRsp
)
<
0
)
return
-
1
;
if
(
tDeserializeSUseDbRspImp
(
&
decoder
,
&
usedbRsp
)
<
0
)
{
tDecoderClear
(
&
decoder
);
return
-
1
;
}
taosArrayPush
(
pRsp
->
pArray
,
&
usedbRsp
);
taosArrayPush
(
pRsp
->
pArray
,
&
usedbRsp
);
}
}
tEndDecode
(
&
decoder
);
tEndDecode
(
&
decoder
);
...
...
source/common/src/ttypes.c
浏览文件 @
d31d05fe
...
@@ -61,26 +61,36 @@ tDataTypeDescriptor tDataTypes[TSDB_DATA_TYPE_MAX] = {
...
@@ -61,26 +61,36 @@ tDataTypeDescriptor tDataTypes[TSDB_DATA_TYPE_MAX] = {
static
float
floatMin
=
-
FLT_MAX
,
floatMax
=
FLT_MAX
;
static
float
floatMin
=
-
FLT_MAX
,
floatMax
=
FLT_MAX
;
static
double
doubleMin
=
-
DBL_MAX
,
doubleMax
=
DBL_MAX
;
static
double
doubleMin
=
-
DBL_MAX
,
doubleMax
=
DBL_MAX
;
FORCE_INLINE
void
*
getDataMin
(
int32_t
type
)
{
FORCE_INLINE
void
*
getDataMin
(
int32_t
type
,
void
*
value
)
{
switch
(
type
)
{
switch
(
type
)
{
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_FLOAT
:
return
&
floatMin
;
*
(
float
*
)
value
=
floatMin
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
case
TSDB_DATA_TYPE_DOUBLE
:
return
&
doubleMin
;
*
(
double
*
)
value
=
doubleMin
;
break
;
default:
default:
return
&
tDataTypes
[
type
].
minValue
;
*
(
int64_t
*
)
value
=
tDataTypes
[
type
].
minValue
;
break
;
}
}
return
value
;
}
}
FORCE_INLINE
void
*
getDataMax
(
int32_t
type
)
{
FORCE_INLINE
void
*
getDataMax
(
int32_t
type
,
void
*
value
)
{
switch
(
type
)
{
switch
(
type
)
{
case
TSDB_DATA_TYPE_FLOAT
:
case
TSDB_DATA_TYPE_FLOAT
:
return
&
floatMax
;
*
(
float
*
)
value
=
floatMax
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
case
TSDB_DATA_TYPE_DOUBLE
:
return
&
doubleMax
;
*
(
double
*
)
value
=
doubleMax
;
break
;
default:
default:
return
&
tDataTypes
[
type
].
maxValue
;
*
(
int64_t
*
)
value
=
tDataTypes
[
type
].
maxValue
;
break
;
}
}
return
value
;
}
}
bool
isValidDataType
(
int32_t
type
)
{
return
type
>=
TSDB_DATA_TYPE_NULL
&&
type
<
TSDB_DATA_TYPE_MAX
;
}
bool
isValidDataType
(
int32_t
type
)
{
return
type
>=
TSDB_DATA_TYPE_NULL
&&
type
<
TSDB_DATA_TYPE_MAX
;
}
...
...
source/dnode/mnode/impl/src/mndQuery.c
浏览文件 @
d31d05fe
...
@@ -178,8 +178,10 @@ int32_t mndProcessBatchMetaMsg(SRpcMsg *pMsg) {
...
@@ -178,8 +178,10 @@ int32_t mndProcessBatchMetaMsg(SRpcMsg *pMsg) {
offset
+=
sizeof
(
p
->
msgLen
);
offset
+=
sizeof
(
p
->
msgLen
);
*
(
int32_t
*
)((
char
*
)
pRsp
+
offset
)
=
htonl
(
p
->
rspCode
);
*
(
int32_t
*
)((
char
*
)
pRsp
+
offset
)
=
htonl
(
p
->
rspCode
);
offset
+=
sizeof
(
p
->
rspCode
);
offset
+=
sizeof
(
p
->
rspCode
);
memcpy
((
char
*
)
pRsp
+
offset
,
p
->
msg
,
p
->
msgLen
);
if
(
p
->
msg
!=
NULL
)
{
offset
+=
p
->
msgLen
;
memcpy
((
char
*
)
pRsp
+
offset
,
p
->
msg
,
p
->
msgLen
);
offset
+=
p
->
msgLen
;
}
rpcFreeCont
(
p
->
msg
);
rpcFreeCont
(
p
->
msg
);
}
}
...
...
source/dnode/vnode/src/vnd/vnodeQuery.c
浏览文件 @
d31d05fe
...
@@ -388,8 +388,10 @@ int32_t vnodeGetBatchMeta(SVnode *pVnode, SRpcMsg *pMsg) {
...
@@ -388,8 +388,10 @@ int32_t vnodeGetBatchMeta(SVnode *pVnode, SRpcMsg *pMsg) {
offset
+=
sizeof
(
p
->
msgLen
);
offset
+=
sizeof
(
p
->
msgLen
);
*
(
int32_t
*
)((
char
*
)
pRsp
+
offset
)
=
htonl
(
p
->
rspCode
);
*
(
int32_t
*
)((
char
*
)
pRsp
+
offset
)
=
htonl
(
p
->
rspCode
);
offset
+=
sizeof
(
p
->
rspCode
);
offset
+=
sizeof
(
p
->
rspCode
);
memcpy
((
char
*
)
pRsp
+
offset
,
p
->
msg
,
p
->
msgLen
);
if
(
p
->
msg
)
{
offset
+=
p
->
msgLen
;
memcpy
((
char
*
)
pRsp
+
offset
,
p
->
msg
,
p
->
msgLen
);
offset
+=
p
->
msgLen
;
}
taosMemoryFreeClear
(
p
->
msg
);
taosMemoryFreeClear
(
p
->
msg
);
}
}
...
...
source/libs/command/src/command.c
浏览文件 @
d31d05fe
...
@@ -528,7 +528,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p
...
@@ -528,7 +528,7 @@ static int32_t setCreateTBResultIntoDataBlock(SSDataBlock* pBlock, SDbCfgInfo* p
appendTableOptions
(
buf2
,
&
len
,
pDbCfg
,
pCfg
);
appendTableOptions
(
buf2
,
&
len
,
pDbCfg
,
pCfg
);
}
}
varDataLen
(
buf2
)
=
len
;
varDataLen
(
buf2
)
=
(
len
>
65535
)
?
65535
:
len
;
colDataAppend
(
pCol2
,
0
,
buf2
,
false
);
colDataAppend
(
pCol2
,
0
,
buf2
,
false
);
...
...
source/libs/function/src/builtins.c
浏览文件 @
d31d05fe
...
@@ -475,7 +475,7 @@ static int32_t translateNowToday(SFunctionNode* pFunc, char* pErrBuf, int32_t le
...
@@ -475,7 +475,7 @@ static int32_t translateNowToday(SFunctionNode* pFunc, char* pErrBuf, int32_t le
// add database precision as param
// add database precision as param
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
return
code
;
}
}
...
@@ -1506,7 +1506,7 @@ static int32_t translateIrate(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
...
@@ -1506,7 +1506,7 @@ static int32_t translateIrate(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
// add database precision as param
// add database precision as param
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
return
code
;
}
}
...
@@ -1519,7 +1519,7 @@ static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
...
@@ -1519,7 +1519,7 @@ static int32_t translateInterp(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
int32_t
numOfParams
=
LIST_LENGTH
(
pFunc
->
pParameterList
);
int32_t
numOfParams
=
LIST_LENGTH
(
pFunc
->
pParameterList
);
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
//if (1 != numOfParams && 3 != numOfParams && 4 != numOfParams) {
//
if (1 != numOfParams && 3 != numOfParams && 4 != numOfParams) {
if
(
1
!=
numOfParams
)
{
if
(
1
!=
numOfParams
)
{
return
invaildFuncParaNumErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
return
invaildFuncParaNumErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
}
...
@@ -1835,7 +1835,7 @@ static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
...
@@ -1835,7 +1835,7 @@ static int32_t translateCast(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
// add database precision as param
// add database precision as param
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
return
code
;
}
}
...
@@ -1894,7 +1894,7 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int
...
@@ -1894,7 +1894,7 @@ static int32_t translateToUnixtimestamp(SFunctionNode* pFunc, char* pErrBuf, int
// add database precision as param
// add database precision as param
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
uint8_t
dbPrec
=
pFunc
->
node
.
resType
.
precision
;
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
int32_t
code
=
addDbPrecisonParam
(
&
pFunc
->
pParameterList
,
dbPrec
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
return
code
;
}
}
...
@@ -2474,7 +2474,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
...
@@ -2474,7 +2474,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
{
.
name
=
"first"
,
.
name
=
"first"
,
.
type
=
FUNCTION_TYPE_FIRST
,
.
type
=
FUNCTION_TYPE_FIRST
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_MULTI_RES_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_MULTI_RES_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
|
FUNC_MGT_KEEP_ORDER_FUNC
,
.
translateFunc
=
translateFirstLast
,
.
translateFunc
=
translateFirstLast
,
.
dynDataRequiredFunc
=
firstDynDataReq
,
.
dynDataRequiredFunc
=
firstDynDataReq
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
...
@@ -2512,7 +2512,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
...
@@ -2512,7 +2512,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
{
.
name
=
"last"
,
.
name
=
"last"
,
.
type
=
FUNCTION_TYPE_LAST
,
.
type
=
FUNCTION_TYPE_LAST
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_MULTI_RES_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SELECT_FUNC
|
FUNC_MGT_MULTI_RES_FUNC
|
FUNC_MGT_IMPLICIT_TS_FUNC
|
FUNC_MGT_KEEP_ORDER_FUNC
,
.
translateFunc
=
translateFirstLast
,
.
translateFunc
=
translateFirstLast
,
.
dynDataRequiredFunc
=
lastDynDataReq
,
.
dynDataRequiredFunc
=
lastDynDataReq
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
.
getEnvFunc
=
getFirstLastFuncEnv
,
...
...
source/libs/nodes/src/nodesUtilFuncs.c
浏览文件 @
d31d05fe
...
@@ -622,7 +622,7 @@ void nodesDestroyNode(SNode* pNode) {
...
@@ -622,7 +622,7 @@ void nodesDestroyNode(SNode* pNode) {
}
}
switch
(
nodeType
(
pNode
))
{
switch
(
nodeType
(
pNode
))
{
case
QUERY_NODE_COLUMN
:
// pProjectRef is weak reference, no need to release
case
QUERY_NODE_COLUMN
:
destroyExprNode
((
SExprNode
*
)
pNode
);
destroyExprNode
((
SExprNode
*
)
pNode
);
break
;
break
;
case
QUERY_NODE_VALUE
:
{
case
QUERY_NODE_VALUE
:
{
...
...
source/libs/parser/src/parInsertSql.c
浏览文件 @
d31d05fe
...
@@ -1364,6 +1364,7 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt,
...
@@ -1364,6 +1364,7 @@ static int32_t parseCsvFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* pStmt,
break
;
break
;
}
}
}
}
taosMemoryFree
(
pLine
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
0
==
(
*
pNumOfRows
)
&&
if
(
TSDB_CODE_SUCCESS
==
code
&&
0
==
(
*
pNumOfRows
)
&&
(
!
TSDB_QUERY_HAS_TYPE
(
pStmt
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
))
&&
!
pStmt
->
fileProcessing
)
{
(
!
TSDB_QUERY_HAS_TYPE
(
pStmt
->
insertType
,
TSDB_QUERY_TYPE_STMT_INSERT
))
&&
!
pStmt
->
fileProcessing
)
{
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
d31d05fe
...
@@ -744,7 +744,8 @@ static bool isPrimaryKeyImpl(SNode* pExpr) {
...
@@ -744,7 +744,8 @@ static bool isPrimaryKeyImpl(SNode* pExpr) {
return
(
PRIMARYKEY_TIMESTAMP_COL_ID
==
((
SColumnNode
*
)
pExpr
)
->
colId
);
return
(
PRIMARYKEY_TIMESTAMP_COL_ID
==
((
SColumnNode
*
)
pExpr
)
->
colId
);
}
else
if
(
QUERY_NODE_FUNCTION
==
nodeType
(
pExpr
))
{
}
else
if
(
QUERY_NODE_FUNCTION
==
nodeType
(
pExpr
))
{
SFunctionNode
*
pFunc
=
(
SFunctionNode
*
)
pExpr
;
SFunctionNode
*
pFunc
=
(
SFunctionNode
*
)
pExpr
;
if
(
FUNCTION_TYPE_SELECT_VALUE
==
pFunc
->
funcType
)
{
if
(
FUNCTION_TYPE_SELECT_VALUE
==
pFunc
->
funcType
||
FUNCTION_TYPE_FIRST
==
pFunc
->
funcType
||
FUNCTION_TYPE_LAST
==
pFunc
->
funcType
)
{
return
isPrimaryKeyImpl
(
nodesListGetNode
(
pFunc
->
pParameterList
,
0
));
return
isPrimaryKeyImpl
(
nodesListGetNode
(
pFunc
->
pParameterList
,
0
));
}
else
if
(
FUNCTION_TYPE_WSTART
==
pFunc
->
funcType
||
FUNCTION_TYPE_WEND
==
pFunc
->
funcType
)
{
}
else
if
(
FUNCTION_TYPE_WSTART
==
pFunc
->
funcType
||
FUNCTION_TYPE_WEND
==
pFunc
->
funcType
)
{
return
true
;
return
true
;
...
@@ -787,7 +788,6 @@ static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* p
...
@@ -787,7 +788,6 @@ static void setColumnInfoBySchema(const SRealTableNode* pTable, const SSchema* p
static
void
setColumnInfoByExpr
(
STempTableNode
*
pTable
,
SExprNode
*
pExpr
,
SColumnNode
**
pColRef
)
{
static
void
setColumnInfoByExpr
(
STempTableNode
*
pTable
,
SExprNode
*
pExpr
,
SColumnNode
**
pColRef
)
{
SColumnNode
*
pCol
=
*
pColRef
;
SColumnNode
*
pCol
=
*
pColRef
;
// pCol->pProjectRef = (SNode*)pExpr;
if
(
NULL
==
pExpr
->
pAssociation
)
{
if
(
NULL
==
pExpr
->
pAssociation
)
{
pExpr
->
pAssociation
=
taosArrayInit
(
TARRAY_MIN_SIZE
,
POINTER_BYTES
);
pExpr
->
pAssociation
=
taosArrayInit
(
TARRAY_MIN_SIZE
,
POINTER_BYTES
);
}
}
...
@@ -2932,8 +2932,8 @@ static int32_t checkFill(STranslateContext* pCxt, SFillNode* pFill, SValueNode*
...
@@ -2932,8 +2932,8 @@ static int32_t checkFill(STranslateContext* pCxt, SFillNode* pFill, SValueNode*
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
if
(
TSWINDOW_IS_EQUAL
(
pFill
->
timeRange
,
TSWINDOW_INITIALIZER
)
||
if
(
!
pCxt
->
createStream
&&
(
TSWINDOW_IS_EQUAL
(
pFill
->
timeRange
,
TSWINDOW_INITIALIZER
)
||
TSWINDOW_IS_EQUAL
(
pFill
->
timeRange
,
TSWINDOW_DESC_INITIALIZER
))
{
TSWINDOW_IS_EQUAL
(
pFill
->
timeRange
,
TSWINDOW_DESC_INITIALIZER
)
))
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_FILL_TIME_RANGE
);
return
generateSyntaxErrMsg
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_FILL_TIME_RANGE
);
}
}
...
@@ -5268,9 +5268,7 @@ static int32_t checkTopicQuery(STranslateContext* pCxt, SSelectStmt* pSelect) {
...
@@ -5268,9 +5268,7 @@ static int32_t checkTopicQuery(STranslateContext* pCxt, SSelectStmt* pSelect) {
}
}
static
int32_t
buildCreateTopicReq
(
STranslateContext
*
pCxt
,
SCreateTopicStmt
*
pStmt
,
SCMCreateTopicReq
*
pReq
)
{
static
int32_t
buildCreateTopicReq
(
STranslateContext
*
pCxt
,
SCreateTopicStmt
*
pStmt
,
SCMCreateTopicReq
*
pReq
)
{
SName
name
;
snprintf
(
pReq
->
name
,
sizeof
(
pReq
->
name
),
"%d.%s"
,
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
topicName
);
tNameSetDbName
(
&
name
,
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
topicName
,
strlen
(
pStmt
->
topicName
));
tNameGetFullDbName
(
&
name
,
pReq
->
name
);
pReq
->
igExists
=
pStmt
->
ignoreExists
;
pReq
->
igExists
=
pStmt
->
ignoreExists
;
pReq
->
withMeta
=
pStmt
->
withMeta
;
pReq
->
withMeta
=
pStmt
->
withMeta
;
...
@@ -5280,7 +5278,7 @@ static int32_t buildCreateTopicReq(STranslateContext* pCxt, SCreateTopicStmt* pS
...
@@ -5280,7 +5278,7 @@ static int32_t buildCreateTopicReq(STranslateContext* pCxt, SCreateTopicStmt* pS
}
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
SName
name
;
if
(
'\0'
!=
pStmt
->
subSTbName
[
0
])
{
if
(
'\0'
!=
pStmt
->
subSTbName
[
0
])
{
pReq
->
subType
=
TOPIC_SUB_TYPE__TABLE
;
pReq
->
subType
=
TOPIC_SUB_TYPE__TABLE
;
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
subDbName
,
pStmt
->
subSTbName
,
&
name
);
toName
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
subDbName
,
pStmt
->
subSTbName
,
&
name
);
...
@@ -5548,6 +5546,10 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SSelectStmt* pSelect) {
...
@@ -5548,6 +5546,10 @@ static int32_t checkStreamQuery(STranslateContext* pCxt, SSelectStmt* pSelect) {
crossTableWithUdaf
(
pSelect
))
{
crossTableWithUdaf
(
pSelect
))
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STREAM_QUERY
,
"Unsupported stream query"
);
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STREAM_QUERY
,
"Unsupported stream query"
);
}
}
if
(
NULL
!=
pSelect
->
pSubtable
&&
TSDB_DATA_TYPE_VARCHAR
!=
((
SExprNode
*
)
pSelect
->
pSubtable
)
->
resType
.
type
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_STREAM_QUERY
,
"SUBTABLE expression must be of VARCHAR type"
);
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -6060,11 +6062,11 @@ static int32_t extractShowCreateTableResultSchema(int32_t* numOfCols, SSchema**
...
@@ -6060,11 +6062,11 @@ static int32_t extractShowCreateTableResultSchema(int32_t* numOfCols, SSchema**
}
}
(
*
pSchema
)[
0
].
type
=
TSDB_DATA_TYPE_BINARY
;
(
*
pSchema
)[
0
].
type
=
TSDB_DATA_TYPE_BINARY
;
(
*
pSchema
)[
0
].
bytes
=
TSDB_TABLE_NAME
_LEN
;
(
*
pSchema
)[
0
].
bytes
=
SHOW_CREATE_TB_RESULT_FIELD1
_LEN
;
strcpy
((
*
pSchema
)[
0
].
name
,
"Table"
);
strcpy
((
*
pSchema
)[
0
].
name
,
"Table"
);
(
*
pSchema
)[
1
].
type
=
TSDB_DATA_TYPE_BINARY
;
(
*
pSchema
)[
1
].
type
=
TSDB_DATA_TYPE_BINARY
;
(
*
pSchema
)[
1
].
bytes
=
TSDB_MAX_BINARY
_LEN
;
(
*
pSchema
)[
1
].
bytes
=
SHOW_CREATE_TB_RESULT_FIELD2
_LEN
;
strcpy
((
*
pSchema
)[
1
].
name
,
"Create Table"
);
strcpy
((
*
pSchema
)[
1
].
name
,
"Create Table"
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
source/libs/scalar/src/filter.c
浏览文件 @
d31d05fe
...
@@ -512,15 +512,17 @@ int32_t filterReuseRangeCtx(SFilterRangeCtx *ctx, int32_t type, int32_t options)
...
@@ -512,15 +512,17 @@ int32_t filterReuseRangeCtx(SFilterRangeCtx *ctx, int32_t type, int32_t options)
}
}
int32_t
filterConvertRange
(
SFilterRangeCtx
*
cur
,
SFilterRange
*
ra
,
bool
*
notNull
)
{
int32_t
filterConvertRange
(
SFilterRangeCtx
*
cur
,
SFilterRange
*
ra
,
bool
*
notNull
)
{
int64_t
tmp
=
0
;
if
(
!
FILTER_GET_FLAG
(
ra
->
sflag
,
RANGE_FLG_NULL
))
{
if
(
!
FILTER_GET_FLAG
(
ra
->
sflag
,
RANGE_FLG_NULL
))
{
int32_t
sr
=
cur
->
pCompareFunc
(
&
ra
->
s
,
getDataMin
(
cur
->
type
));
int32_t
sr
=
cur
->
pCompareFunc
(
&
ra
->
s
,
getDataMin
(
cur
->
type
,
&
tmp
));
if
(
sr
==
0
)
{
if
(
sr
==
0
)
{
FILTER_SET_FLAG
(
ra
->
sflag
,
RANGE_FLG_NULL
);
FILTER_SET_FLAG
(
ra
->
sflag
,
RANGE_FLG_NULL
);
}
}
}
}
if
(
!
FILTER_GET_FLAG
(
ra
->
eflag
,
RANGE_FLG_NULL
))
{
if
(
!
FILTER_GET_FLAG
(
ra
->
eflag
,
RANGE_FLG_NULL
))
{
int32_t
er
=
cur
->
pCompareFunc
(
&
ra
->
e
,
getDataMax
(
cur
->
type
));
int32_t
er
=
cur
->
pCompareFunc
(
&
ra
->
e
,
getDataMax
(
cur
->
type
,
&
tmp
));
if
(
er
==
0
)
{
if
(
er
==
0
)
{
FILTER_SET_FLAG
(
ra
->
eflag
,
RANGE_FLG_NULL
);
FILTER_SET_FLAG
(
ra
->
eflag
,
RANGE_FLG_NULL
);
}
}
...
@@ -696,14 +698,15 @@ int32_t filterAddRangeImpl(void *h, SFilterRange *ra, int32_t optr) {
...
@@ -696,14 +698,15 @@ int32_t filterAddRangeImpl(void *h, SFilterRange *ra, int32_t optr) {
int32_t
filterAddRange
(
void
*
h
,
SFilterRange
*
ra
,
int32_t
optr
)
{
int32_t
filterAddRange
(
void
*
h
,
SFilterRange
*
ra
,
int32_t
optr
)
{
SFilterRangeCtx
*
ctx
=
(
SFilterRangeCtx
*
)
h
;
SFilterRangeCtx
*
ctx
=
(
SFilterRangeCtx
*
)
h
;
int64_t
tmp
=
0
;
if
(
FILTER_GET_FLAG
(
ra
->
sflag
,
RANGE_FLG_NULL
))
{
if
(
FILTER_GET_FLAG
(
ra
->
sflag
,
RANGE_FLG_NULL
))
{
SIMPLE_COPY_VALUES
(
&
ra
->
s
,
getDataMin
(
ctx
->
type
));
SIMPLE_COPY_VALUES
(
&
ra
->
s
,
getDataMin
(
ctx
->
type
,
&
tmp
));
// FILTER_CLR_FLAG(ra->sflag, RA_NULL);
// FILTER_CLR_FLAG(ra->sflag, RA_NULL);
}
}
if
(
FILTER_GET_FLAG
(
ra
->
eflag
,
RANGE_FLG_NULL
))
{
if
(
FILTER_GET_FLAG
(
ra
->
eflag
,
RANGE_FLG_NULL
))
{
SIMPLE_COPY_VALUES
(
&
ra
->
e
,
getDataMax
(
ctx
->
type
));
SIMPLE_COPY_VALUES
(
&
ra
->
e
,
getDataMax
(
ctx
->
type
,
&
tmp
));
// FILTER_CLR_FLAG(ra->eflag, RA_NULL);
// FILTER_CLR_FLAG(ra->eflag, RA_NULL);
}
}
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
d31d05fe
...
@@ -286,9 +286,11 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
...
@@ -286,9 +286,11 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
if
(
pJob
->
execRes
.
res
)
{
if
(
pJob
->
execRes
.
res
)
{
SSubmitRsp
*
sum
=
pJob
->
execRes
.
res
;
SSubmitRsp
*
sum
=
pJob
->
execRes
.
res
;
sum
->
affectedRows
+=
rsp
->
affectedRows
;
sum
->
affectedRows
+=
rsp
->
affectedRows
;
sum
->
nBlocks
+=
rsp
->
nBlocks
;
sum
->
nBlocks
+=
rsp
->
nBlocks
;
sum
->
pBlocks
=
taosMemoryRealloc
(
sum
->
pBlocks
,
sum
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
if
(
rsp
->
nBlocks
>
0
&&
rsp
->
pBlocks
)
{
memcpy
(
sum
->
pBlocks
+
sum
->
nBlocks
-
rsp
->
nBlocks
,
rsp
->
pBlocks
,
rsp
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
sum
->
pBlocks
=
taosMemoryRealloc
(
sum
->
pBlocks
,
sum
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
memcpy
(
sum
->
pBlocks
+
sum
->
nBlocks
-
rsp
->
nBlocks
,
rsp
->
pBlocks
,
rsp
->
nBlocks
*
sizeof
(
*
sum
->
pBlocks
));
}
taosMemoryFree
(
rsp
->
pBlocks
);
taosMemoryFree
(
rsp
->
pBlocks
);
taosMemoryFree
(
rsp
);
taosMemoryFree
(
rsp
);
}
else
{
}
else
{
...
...
source/libs/stream/src/streamState.c
浏览文件 @
d31d05fe
...
@@ -114,12 +114,12 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath, int
...
@@ -114,12 +114,12 @@ SStreamState* streamStateOpen(char* path, SStreamTask* pTask, bool specPath, int
return
NULL
;
return
NULL
;
}
}
char
statePath
[
300
];
char
statePath
[
1024
];
if
(
!
specPath
)
{
if
(
!
specPath
)
{
sprintf
(
statePath
,
"%s/%d"
,
path
,
pTask
->
taskId
);
sprintf
(
statePath
,
"%s/%d"
,
path
,
pTask
->
taskId
);
}
else
{
}
else
{
memset
(
statePath
,
0
,
300
);
memset
(
statePath
,
0
,
1024
);
tstrncpy
(
statePath
,
path
,
300
);
tstrncpy
(
statePath
,
path
,
1024
);
}
}
if
(
tdbOpen
(
statePath
,
szPage
,
pages
,
&
pState
->
db
,
0
)
<
0
)
{
if
(
tdbOpen
(
statePath
,
szPage
,
pages
,
&
pState
->
db
,
0
)
<
0
)
{
goto
_err
;
goto
_err
;
...
...
source/libs/tdb/src/db/tdbPCache.c
浏览文件 @
d31d05fe
...
@@ -169,7 +169,7 @@ int tdbPCacheAlter(SPCache *pCache, int32_t nPage) {
...
@@ -169,7 +169,7 @@ int tdbPCacheAlter(SPCache *pCache, int32_t nPage) {
SPage
*
tdbPCacheFetch
(
SPCache
*
pCache
,
const
SPgid
*
pPgid
,
TXN
*
pTxn
)
{
SPage
*
tdbPCacheFetch
(
SPCache
*
pCache
,
const
SPgid
*
pPgid
,
TXN
*
pTxn
)
{
SPage
*
pPage
;
SPage
*
pPage
;
i32
nRef
;
i32
nRef
=
0
;
tdbPCacheLock
(
pCache
);
tdbPCacheLock
(
pCache
);
...
@@ -178,14 +178,17 @@ SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn) {
...
@@ -178,14 +178,17 @@ SPage *tdbPCacheFetch(SPCache *pCache, const SPgid *pPgid, TXN *pTxn) {
nRef
=
tdbRefPage
(
pPage
);
nRef
=
tdbRefPage
(
pPage
);
}
}
ASSERT
(
pPage
);
tdbPCacheUnlock
(
pCache
);
tdbPCacheUnlock
(
pCache
);
// printf("thread %" PRId64 " fetch page %d pgno %d pPage %p nRef %d\n", taosGetSelfPthreadId(), pPage->id,
// printf("thread %" PRId64 " fetch page %d pgno %d pPage %p nRef %d\n", taosGetSelfPthreadId(), pPage->id,
// TDB_PAGE_PGNO(pPage), pPage, nRef);
// TDB_PAGE_PGNO(pPage), pPage, nRef);
tdbDebug
(
"pcache/fetch page %p/%d/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
nRef
);
if
(
pPage
)
{
tdbDebug
(
"pcache/fetch page %p/%d/%d/%d"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
pPage
->
id
,
nRef
);
}
else
{
tdbDebug
(
"pcache/fetch page %p"
,
pPage
);
}
return
pPage
;
return
pPage
;
}
}
...
@@ -266,7 +269,7 @@ static SPage *tdbPCacheFetchImpl(SPCache *pCache, const SPgid *pPgid, TXN *pTxn)
...
@@ -266,7 +269,7 @@ static SPage *tdbPCacheFetchImpl(SPCache *pCache, const SPgid *pPgid, TXN *pTxn)
}
}
// 4. Try a create new page
// 4. Try a create new page
if
(
!
pPage
)
{
if
(
!
pPage
&&
pTxn
->
xMalloc
!=
NULL
)
{
ret
=
tdbPageCreate
(
pCache
->
szPage
,
&
pPage
,
pTxn
->
xMalloc
,
pTxn
->
xArg
);
ret
=
tdbPageCreate
(
pCache
->
szPage
,
&
pPage
,
pTxn
->
xMalloc
,
pTxn
->
xArg
);
if
(
ret
<
0
||
pPage
==
NULL
)
{
if
(
ret
<
0
||
pPage
==
NULL
)
{
// TODO
// TODO
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
d31d05fe
...
@@ -27,6 +27,116 @@ typedef struct {
...
@@ -27,6 +27,116 @@ typedef struct {
TDB_STATIC_ASSERT
(
sizeof
(
SFileHdr
)
==
128
,
"Size of file header is not correct"
);
TDB_STATIC_ASSERT
(
sizeof
(
SFileHdr
)
==
128
,
"Size of file header is not correct"
);
struct
hashset_st
{
size_t
nbits
;
size_t
mask
;
size_t
capacity
;
size_t
*
items
;
size_t
nitems
;
double
load_factor
;
};
static
const
unsigned
int
prime
=
39
;
static
const
unsigned
int
prime2
=
5009
;
hashset_t
hashset_create
(
void
)
{
hashset_t
set
=
tdbOsCalloc
(
1
,
sizeof
(
struct
hashset_st
));
if
(
!
set
)
{
return
NULL
;
}
set
->
nbits
=
4
;
set
->
capacity
=
(
size_t
)(
1
<<
set
->
nbits
);
set
->
items
=
tdbOsCalloc
(
set
->
capacity
,
sizeof
(
size_t
));
if
(
!
set
->
items
)
{
tdbOsFree
(
set
);
return
NULL
;
}
set
->
mask
=
set
->
capacity
-
1
;
set
->
nitems
=
0
;
set
->
load_factor
=
0
.
75
;
return
set
;
}
void
hashset_destroy
(
hashset_t
set
)
{
if
(
set
)
{
tdbOsFree
(
set
->
items
);
tdbOsFree
(
set
);
}
}
int
hashset_add_member
(
hashset_t
set
,
void
*
item
)
{
size_t
value
=
(
size_t
)
item
;
size_t
h
;
if
(
value
==
0
)
{
return
-
1
;
}
for
(
h
=
set
->
mask
&
(
prime
*
value
);
set
->
items
[
h
]
!=
0
;
h
=
set
->
mask
&
(
h
+
prime2
))
{
if
(
set
->
items
[
h
]
==
value
)
{
return
0
;
}
}
set
->
items
[
h
]
=
value
;
++
set
->
nitems
;
return
1
;
}
int
hashset_add
(
hashset_t
set
,
void
*
item
)
{
int
ret
=
hashset_add_member
(
set
,
item
);
size_t
old_capacity
=
set
->
capacity
;
if
(
set
->
nitems
>=
(
double
)
old_capacity
*
set
->
load_factor
)
{
size_t
*
old_items
=
set
->
items
;
++
set
->
nbits
;
set
->
capacity
=
(
size_t
)(
1
<<
set
->
nbits
);
set
->
mask
=
set
->
capacity
-
1
;
set
->
items
=
tdbOsCalloc
(
set
->
capacity
,
sizeof
(
size_t
));
if
(
!
set
->
items
)
{
return
-
1
;
}
set
->
nitems
=
0
;
for
(
size_t
i
=
0
;
i
<
old_capacity
;
++
i
)
{
hashset_add_member
(
set
,
(
void
*
)
old_items
[
i
]);
}
tdbOsFree
(
old_items
);
}
return
ret
;
}
int
hashset_remove
(
hashset_t
set
,
void
*
item
)
{
size_t
value
=
(
size_t
)
item
;
for
(
size_t
h
=
set
->
mask
&
(
prime
*
value
);
set
->
items
[
h
]
!=
0
;
h
=
set
->
mask
&
(
h
+
prime2
))
{
if
(
set
->
items
[
h
]
==
value
)
{
set
->
items
[
h
]
=
0
;
--
set
->
nitems
;
return
1
;
}
}
return
0
;
}
int
hashset_contains
(
hashset_t
set
,
void
*
item
)
{
size_t
value
=
(
size_t
)
item
;
for
(
size_t
h
=
set
->
mask
&
(
prime
*
value
);
set
->
items
[
h
]
!=
0
;
h
=
set
->
mask
&
(
h
+
prime2
))
{
if
(
set
->
items
[
h
]
==
value
)
{
return
1
;
}
}
return
0
;
}
#define TDB_PAGE_INITIALIZED(pPage) ((pPage)->pPager != NULL)
#define TDB_PAGE_INITIALIZED(pPage) ((pPage)->pPager != NULL)
static
int
tdbPagerInitPage
(
SPager
*
pPager
,
SPage
*
pPage
,
int
(
*
initPage
)(
SPage
*
,
void
*
,
int
),
void
*
arg
,
static
int
tdbPagerInitPage
(
SPager
*
pPager
,
SPage
*
pPage
,
int
(
*
initPage
)(
SPage
*
,
void
*
,
int
),
void
*
arg
,
...
@@ -209,12 +319,16 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) {
...
@@ -209,12 +319,16 @@ int tdbPagerWrite(SPager *pPager, SPage *pPage) {
tRBTreePut
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
tRBTreePut
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
// Write page to journal if neccessary
// Write page to journal if neccessary
if
(
TDB_PAGE_PGNO
(
pPage
)
<=
pPager
->
dbOrigSize
)
{
if
(
TDB_PAGE_PGNO
(
pPage
)
<=
pPager
->
dbOrigSize
&&
(
pPager
->
jPageSet
==
NULL
||
!
hashset_contains
(
pPager
->
jPageSet
,
(
void
*
)((
long
)
TDB_PAGE_PGNO
(
pPage
))))
)
{
ret
=
tdbPagerWritePageToJournal
(
pPager
,
pPage
);
ret
=
tdbPagerWritePageToJournal
(
pPager
,
pPage
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
tdbError
(
"failed to write page to journal since %s"
,
tstrerror
(
terrno
));
tdbError
(
"failed to write page to journal since %s"
,
tstrerror
(
terrno
));
return
-
1
;
return
-
1
;
}
}
if
(
pPager
->
jPageSet
)
{
hashset_add
(
pPager
->
jPageSet
,
(
void
*
)((
long
)
TDB_PAGE_PGNO
(
pPage
)));
}
}
}
return
0
;
return
0
;
...
@@ -233,6 +347,7 @@ int tdbPagerBegin(SPager *pPager, TXN *pTxn) {
...
@@ -233,6 +347,7 @@ int tdbPagerBegin(SPager *pPager, TXN *pTxn) {
return
-
1
;
return
-
1
;
}
}
pPager
->
jPageSet
=
hashset_create
();
// TODO: write the size of the file
// TODO: write the size of the file
pPager
->
inTran
=
1
;
pPager
->
inTran
=
1
;
...
@@ -275,6 +390,9 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) {
...
@@ -275,6 +390,9 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) {
pPage
->
isDirty
=
0
;
pPage
->
isDirty
=
0
;
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
if
(
pPager
->
jPageSet
)
{
hashset_remove
(
pPager
->
jPageSet
,
(
void
*
)((
long
)
TDB_PAGE_PGNO
(
pPage
)));
}
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
}
}
...
@@ -304,6 +422,9 @@ int tdbPagerPostCommit(SPager *pPager, TXN *pTxn) {
...
@@ -304,6 +422,9 @@ int tdbPagerPostCommit(SPager *pPager, TXN *pTxn) {
return
-
1
;
return
-
1
;
}
}
if
(
pPager
->
jPageSet
)
{
hashset_destroy
(
pPager
->
jPageSet
);
}
pPager
->
inTran
=
0
;
pPager
->
inTran
=
0
;
return
0
;
return
0
;
...
@@ -375,36 +496,61 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
...
@@ -375,36 +496,61 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
return
-
1
;
return
-
1
;
}
}
tdb_fd_t
jfd
=
tdbOsOpen
(
pPager
->
jFileName
,
TDB_O_RDWR
,
0755
);
tdb_fd_t
jfd
=
pPager
->
jfd
;
if
(
jfd
==
NULL
)
{
return
-
1
;
}
ret
=
tdbGetFileSize
(
jfd
,
pPager
->
pageSize
,
&
journalSize
);
ret
=
tdbGetFileSize
(
jfd
,
pPager
->
pageSize
,
&
journalSize
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
return
-
1
;
return
-
1
;
}
}
// 1, read pages from jounal file
u8
*
pageBuf
=
tdbOsCalloc
(
1
,
pPager
->
pageSize
);
// 2, write original pages to buffered ones
if
(
pageBuf
==
NULL
)
{
return
-
1
;
}
/* TODO: reset the buffered pages instead of releasing them
for
(
int
pgIndex
=
0
;
pgIndex
<
journalSize
;
++
pgIndex
)
{
// loop to reset the dirty pages from file
for (pgIdx = 0, pPage = pPager->pDirty; pPage != NULL && pgIndex < journalSize; pPage = pPage->pDirtyNext, ++pgIdx) {
// read pgno & the page from journal
// read pgno & the page from journal
SPgno
pgno
;
SPgno
pgno
;
int
ret
=
tdbOsRead
(
jfd
,
&
pgno
,
sizeof
(
pgno
));
int
ret
=
tdbOsRead
(
jfd
,
&
pgno
,
sizeof
(
pgno
));
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
tdbOsFree
(
pageBuf
);
return
-
1
;
return
-
1
;
}
}
ret
=
tdbOsRead
(
jfd
,
pageBuf
,
pPager
->
pageSize
);
ret
=
tdbOsRead
(
jfd
,
pageBuf
,
pPager
->
pageSize
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
tdbOsFree
(
pageBuf
);
return
-
1
;
}
i64
offset
=
pPager
->
pageSize
*
(
pgno
-
1
);
if
(
tdbOsLSeek
(
pPager
->
fd
,
offset
,
SEEK_SET
)
<
0
)
{
tdbError
(
"failed to lseek fd due to %s. file:%s, offset:%"
PRId64
,
strerror
(
errno
),
pPager
->
dbFileName
,
offset
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
tdbOsFree
(
pageBuf
);
return
-
1
;
}
ret
=
tdbOsWrite
(
pPager
->
fd
,
pageBuf
,
pPager
->
pageSize
);
if
(
ret
<
0
)
{
tdbError
(
"failed to write buf due to %s. file: %s, bufsize:%d"
,
strerror
(
errno
),
pPager
->
dbFileName
,
pPager
->
pageSize
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
tdbOsFree
(
pageBuf
);
return
-
1
;
return
-
1
;
}
}
}
}
*/
if
(
tdbOsFSync
(
pPager
->
fd
)
<
0
)
{
tdbError
(
"failed to fsync fd due to %s. dbfile:%s"
,
strerror
(
errno
),
pPager
->
dbFileName
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
tdbOsFree
(
pageBuf
);
return
-
1
;
}
tdbOsFree
(
pageBuf
);
// 3, release the dirty pages
// 3, release the dirty pages
SRBTreeIter
iter
=
tRBTreeIterCreate
(
&
pPager
->
rbt
,
1
);
SRBTreeIter
iter
=
tRBTreeIterCreate
(
&
pPager
->
rbt
,
1
);
SRBTreeNode
*
pNode
=
NULL
;
SRBTreeNode
*
pNode
=
NULL
;
...
@@ -414,6 +560,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
...
@@ -414,6 +560,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
pPage
->
isDirty
=
0
;
pPage
->
isDirty
=
0
;
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
hashset_remove
(
pPager
->
jPageSet
,
(
void
*
)((
long
)
TDB_PAGE_PGNO
(
pPage
)));
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
}
}
...
@@ -422,11 +569,48 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
...
@@ -422,11 +569,48 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
// 4, remove the journal file
// 4, remove the journal file
tdbOsClose
(
pPager
->
jfd
);
tdbOsClose
(
pPager
->
jfd
);
(
void
)
tdbOsRemove
(
pPager
->
jFileName
);
(
void
)
tdbOsRemove
(
pPager
->
jFileName
);
hashset_destroy
(
pPager
->
jPageSet
);
pPager
->
inTran
=
0
;
pPager
->
inTran
=
0
;
return
0
;
return
0
;
}
}
int
tdbPagerFlushPage
(
SPager
*
pPager
,
TXN
*
pTxn
)
{
SPage
*
pPage
;
int
ret
;
// loop to write the dirty pages to file
SRBTreeIter
iter
=
tRBTreeIterCreate
(
&
pPager
->
rbt
,
1
);
SRBTreeNode
*
pNode
=
NULL
;
while
((
pNode
=
tRBTreeIterNext
(
&
iter
))
!=
NULL
)
{
pPage
=
(
SPage
*
)
pNode
;
ret
=
tdbPagerWritePageToDB
(
pPager
,
pPage
);
if
(
ret
<
0
)
{
tdbError
(
"failed to write page to db since %s"
,
tstrerror
(
terrno
));
return
-
1
;
}
}
tdbTrace
(
"tdbttl commit:%p, %d/%d"
,
pPager
,
pPager
->
dbOrigSize
,
pPager
->
dbFileSize
);
pPager
->
dbOrigSize
=
pPager
->
dbFileSize
;
// release the page
iter
=
tRBTreeIterCreate
(
&
pPager
->
rbt
,
1
);
while
((
pNode
=
tRBTreeIterNext
(
&
iter
))
!=
NULL
)
{
pPage
=
(
SPage
*
)
pNode
;
pPage
->
isDirty
=
0
;
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
}
tRBTreeCreate
(
&
pPager
->
rbt
,
pageCmpFn
);
return
0
;
}
int
tdbPagerFetchPage
(
SPager
*
pPager
,
SPgno
*
ppgno
,
SPage
**
ppPage
,
int
(
*
initPage
)(
SPage
*
,
void
*
,
int
),
void
*
arg
,
int
tdbPagerFetchPage
(
SPager
*
pPager
,
SPgno
*
ppgno
,
SPage
**
ppPage
,
int
(
*
initPage
)(
SPage
*
,
void
*
,
int
),
void
*
arg
,
TXN
*
pTxn
)
{
TXN
*
pTxn
)
{
SPage
*
pPage
;
SPage
*
pPage
;
...
@@ -453,10 +637,8 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initPa
...
@@ -453,10 +637,8 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initPa
// fetch a page container
// fetch a page container
memcpy
(
&
pgid
,
pPager
->
fid
,
TDB_FILE_ID_LEN
);
memcpy
(
&
pgid
,
pPager
->
fid
,
TDB_FILE_ID_LEN
);
pgid
.
pgno
=
pgno
;
pgid
.
pgno
=
pgno
;
pPage
=
tdbPCacheFetch
(
pPager
->
pCache
,
&
pgid
,
pTxn
);
while
((
pPage
=
tdbPCacheFetch
(
pPager
->
pCache
,
&
pgid
,
pTxn
))
==
NULL
)
{
if
(
pPage
==
NULL
)
{
tdbPagerFlushPage
(
pPager
,
pTxn
);
ASSERT
(
0
);
return
-
1
;
}
}
tdbTrace
(
"tdbttl fetch pager:%p"
,
pPage
->
pPager
);
tdbTrace
(
"tdbttl fetch pager:%p"
,
pPage
->
pPager
);
...
...
source/libs/tdb/src/inc/tdbInt.h
浏览文件 @
d31d05fe
...
@@ -384,6 +384,8 @@ struct STDB {
...
@@ -384,6 +384,8 @@ struct STDB {
#endif
#endif
};
};
typedef
struct
hashset_st
*
hashset_t
;
struct
SPager
{
struct
SPager
{
char
*
dbFileName
;
char
*
dbFileName
;
char
*
jFileName
;
char
*
jFileName
;
...
@@ -394,7 +396,8 @@ struct SPager {
...
@@ -394,7 +396,8 @@ struct SPager {
SPCache
*
pCache
;
SPCache
*
pCache
;
SPgno
dbFileSize
;
SPgno
dbFileSize
;
SPgno
dbOrigSize
;
SPgno
dbOrigSize
;
SPage
*
pDirty
;
//SPage *pDirty;
hashset_t
jPageSet
;
SRBTree
rbt
;
SRBTree
rbt
;
u8
inTran
;
u8
inTran
;
SPager
*
pNext
;
// used by TDB
SPager
*
pNext
;
// used by TDB
...
...
source/libs/wal/src/walWrite.c
浏览文件 @
d31d05fe
...
@@ -319,7 +319,7 @@ int32_t walEndSnapshot(SWal *pWal) {
...
@@ -319,7 +319,7 @@ int32_t walEndSnapshot(SWal *pWal) {
SWalFileInfo
*
pInfo
=
taosArraySearch
(
pWal
->
fileInfoSet
,
&
tmp
,
compareWalFileInfo
,
TD_LE
);
SWalFileInfo
*
pInfo
=
taosArraySearch
(
pWal
->
fileInfoSet
,
&
tmp
,
compareWalFileInfo
,
TD_LE
);
if
(
pInfo
)
{
if
(
pInfo
)
{
if
(
ver
>=
pInfo
->
lastVer
)
{
if
(
ver
>=
pInfo
->
lastVer
)
{
pInfo
--
;
pInfo
++
;
}
}
if
(
POINTER_DISTANCE
(
pInfo
,
pWal
->
fileInfoSet
->
pData
)
>
0
)
{
if
(
POINTER_DISTANCE
(
pInfo
,
pWal
->
fileInfoSet
->
pData
)
>
0
)
{
wDebug
(
"vgId:%d, begin remove from %"
PRId64
,
pWal
->
cfg
.
vgId
,
pInfo
->
firstVer
);
wDebug
(
"vgId:%d, begin remove from %"
PRId64
,
pWal
->
cfg
.
vgId
,
pInfo
->
firstVer
);
...
...
source/util/src/tconfig.c
浏览文件 @
d31d05fe
...
@@ -271,8 +271,11 @@ static int32_t cfgSetTimezone(SConfigItem *pItem, const char *value, ECfgSrcType
...
@@ -271,8 +271,11 @@ static int32_t cfgSetTimezone(SConfigItem *pItem, const char *value, ECfgSrcType
cfgStypeStr
(
stype
),
value
,
terrstr
());
cfgStypeStr
(
stype
),
value
,
terrstr
());
return
-
1
;
return
-
1
;
}
}
pItem
->
stype
=
stype
;
pItem
->
stype
=
stype
;
// apply new timezone
osSetTimezone
(
value
);
return
0
;
return
0
;
}
}
...
...
tests/parallel_test/cases.task
浏览文件 @
d31d05fe
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
,,y,script,./test.sh -f tsim/user/basic.sim
,,y,script,./test.sh -f tsim/user/basic.sim
,,y,script,./test.sh -f tsim/user/password.sim
,,y,script,./test.sh -f tsim/user/password.sim
,,y,script,./test.sh -f tsim/user/privilege_db.sim
,,y,script,./test.sh -f tsim/user/privilege_db.sim
,,,script,./test.sh -f tsim/user/privilege_sysinfo.sim
,,
y
,script,./test.sh -f tsim/user/privilege_sysinfo.sim
,,,script,./test.sh -f tsim/db/alter_option.sim
,,,script,./test.sh -f tsim/db/alter_option.sim
,,,script,./test.sh -f tsim/db/alter_replica_13.sim
,,,script,./test.sh -f tsim/db/alter_replica_13.sim
,,,script,./test.sh -f tsim/db/alter_replica_31.sim
,,,script,./test.sh -f tsim/db/alter_replica_31.sim
...
@@ -23,16 +23,16 @@
...
@@ -23,16 +23,16 @@
,,,script,./test.sh -f tsim/db/create_all_options.sim
,,,script,./test.sh -f tsim/db/create_all_options.sim
,,y,script,./test.sh -f tsim/db/delete_reuse1.sim
,,y,script,./test.sh -f tsim/db/delete_reuse1.sim
,,y,script,./test.sh -f tsim/db/delete_reuse2.sim
,,y,script,./test.sh -f tsim/db/delete_reuse2.sim
,,,script,./test.sh -f tsim/db/delete_reusevnode.sim
,,
y
,script,./test.sh -f tsim/db/delete_reusevnode.sim
,,y,script,./test.sh -f tsim/db/delete_reusevnode2.sim
,,y,script,./test.sh -f tsim/db/delete_reusevnode2.sim
,,,script,./test.sh -f tsim/db/delete_writing1.sim
,,
y
,script,./test.sh -f tsim/db/delete_writing1.sim
,,,script,./test.sh -f tsim/db/delete_writing2.sim
,,
y
,script,./test.sh -f tsim/db/delete_writing2.sim
,,y,script,./test.sh -f tsim/db/error1.sim
,,y,script,./test.sh -f tsim/db/error1.sim
,,y,script,./test.sh -f tsim/db/keep.sim
,,y,script,./test.sh -f tsim/db/keep.sim
,,y,script,./test.sh -f tsim/db/len.sim
,,y,script,./test.sh -f tsim/db/len.sim
,,y,script,./test.sh -f tsim/db/repeat.sim
,,y,script,./test.sh -f tsim/db/repeat.sim
,,y,script,./test.sh -f tsim/db/show_create_db.sim
,,y,script,./test.sh -f tsim/db/show_create_db.sim
,,,script,./test.sh -f tsim/db/show_create_table.sim
,,
y
,script,./test.sh -f tsim/db/show_create_table.sim
,,y,script,./test.sh -f tsim/db/tables.sim
,,y,script,./test.sh -f tsim/db/tables.sim
,,y,script,./test.sh -f tsim/db/taosdlog.sim
,,y,script,./test.sh -f tsim/db/taosdlog.sim
,,,script,./test.sh -f tsim/dnode/balance_replica1.sim
,,,script,./test.sh -f tsim/dnode/balance_replica1.sim
...
@@ -80,8 +80,8 @@
...
@@ -80,8 +80,8 @@
,,y,script,./test.sh -f tsim/insert/query_multi_file.sim
,,y,script,./test.sh -f tsim/insert/query_multi_file.sim
,,y,script,./test.sh -f tsim/insert/tcp.sim
,,y,script,./test.sh -f tsim/insert/tcp.sim
,,y,script,./test.sh -f tsim/insert/update0.sim
,,y,script,./test.sh -f tsim/insert/update0.sim
,,,script,./test.sh -f tsim/insert/update1_sort_merge.sim
,,
y
,script,./test.sh -f tsim/insert/update1_sort_merge.sim
,,,script,./test.sh -f tsim/parser/alter__for_community_version.sim
,,
y
,script,./test.sh -f tsim/parser/alter__for_community_version.sim
,,y,script,./test.sh -f tsim/parser/alter_column.sim
,,y,script,./test.sh -f tsim/parser/alter_column.sim
,,y,script,./test.sh -f tsim/parser/alter_stable.sim
,,y,script,./test.sh -f tsim/parser/alter_stable.sim
,,y,script,./test.sh -f tsim/parser/alter.sim
,,y,script,./test.sh -f tsim/parser/alter.sim
...
@@ -92,21 +92,21 @@
...
@@ -92,21 +92,21 @@
,,y,script,./test.sh -f tsim/parser/binary_escapeCharacter.sim
,,y,script,./test.sh -f tsim/parser/binary_escapeCharacter.sim
,,,script,./test.sh -f tsim/parser/col_arithmetic_operation.sim
,,,script,./test.sh -f tsim/parser/col_arithmetic_operation.sim
,,y,script,./test.sh -f tsim/parser/columnValue_bigint.sim
,,y,script,./test.sh -f tsim/parser/columnValue_bigint.sim
,,,script,./test.sh -f tsim/parser/columnValue_bool.sim
,,
y
,script,./test.sh -f tsim/parser/columnValue_bool.sim
,,y,script,./test.sh -f tsim/parser/columnValue_double.sim
,,y,script,./test.sh -f tsim/parser/columnValue_double.sim
,,y,script,./test.sh -f tsim/parser/columnValue_float.sim
,,y,script,./test.sh -f tsim/parser/columnValue_float.sim
,,y,script,./test.sh -f tsim/parser/columnValue_int.sim
,,y,script,./test.sh -f tsim/parser/columnValue_int.sim
,,y,script,./test.sh -f tsim/parser/columnValue_smallint.sim
,,y,script,./test.sh -f tsim/parser/columnValue_smallint.sim
,,y,script,./test.sh -f tsim/parser/columnValue_tinyint.sim
,,y,script,./test.sh -f tsim/parser/columnValue_tinyint.sim
,,,script,./test.sh -f tsim/parser/columnValue_unsign.sim
,,,script,./test.sh -f tsim/parser/columnValue_unsign.sim
,,,script,./test.sh -f tsim/parser/commit.sim
,,
y
,script,./test.sh -f tsim/parser/commit.sim
,,,script,./test.sh -f tsim/parser/condition.sim
,,
y
,script,./test.sh -f tsim/parser/condition.sim
,,y,script,./test.sh -f tsim/parser/constCol.sim
,,y,script,./test.sh -f tsim/parser/constCol.sim
,,,script,./test.sh -f tsim/parser/create_db.sim
,,
y
,script,./test.sh -f tsim/parser/create_db.sim
,,,script,./test.sh -f tsim/parser/create_mt.sim
,,
y
,script,./test.sh -f tsim/parser/create_mt.sim
,,y,script,./test.sh -f tsim/parser/create_tb_with_tag_name.sim
,,y,script,./test.sh -f tsim/parser/create_tb_with_tag_name.sim
,,y,script,./test.sh -f tsim/parser/create_tb.sim
,,y,script,./test.sh -f tsim/parser/create_tb.sim
,,,script,./test.sh -f tsim/parser/dbtbnameValidate.sim
,,
y
,script,./test.sh -f tsim/parser/dbtbnameValidate.sim
,,y,script,./test.sh -f tsim/parser/distinct.sim
,,y,script,./test.sh -f tsim/parser/distinct.sim
,,y,script,./test.sh -f tsim/parser/fill_us.sim
,,y,script,./test.sh -f tsim/parser/fill_us.sim
,,,script,./test.sh -f tsim/parser/fill.sim
,,,script,./test.sh -f tsim/parser/fill.sim
...
@@ -120,9 +120,9 @@
...
@@ -120,9 +120,9 @@
,,y,script,./test.sh -f tsim/parser/import_commit1.sim
,,y,script,./test.sh -f tsim/parser/import_commit1.sim
,,y,script,./test.sh -f tsim/parser/import_commit2.sim
,,y,script,./test.sh -f tsim/parser/import_commit2.sim
,,y,script,./test.sh -f tsim/parser/import_commit3.sim
,,y,script,./test.sh -f tsim/parser/import_commit3.sim
,,,script,./test.sh -f tsim/parser/import_file.sim
,,
y
,script,./test.sh -f tsim/parser/import_file.sim
,,y,script,./test.sh -f tsim/parser/import.sim
,,y,script,./test.sh -f tsim/parser/import.sim
,,,script,./test.sh -f tsim/parser/insert_multiTbl.sim
,,
y
,script,./test.sh -f tsim/parser/insert_multiTbl.sim
,,y,script,./test.sh -f tsim/parser/insert_tb.sim
,,y,script,./test.sh -f tsim/parser/insert_tb.sim
,,,script,./test.sh -f tsim/parser/join_manyblocks.sim
,,,script,./test.sh -f tsim/parser/join_manyblocks.sim
,,y,script,./test.sh -f tsim/parser/join_multitables.sim
,,y,script,./test.sh -f tsim/parser/join_multitables.sim
...
@@ -131,12 +131,12 @@
...
@@ -131,12 +131,12 @@
,,y,script,./test.sh -f tsim/parser/last_cache.sim
,,y,script,./test.sh -f tsim/parser/last_cache.sim
,,y,script,./test.sh -f tsim/parser/last_groupby.sim
,,y,script,./test.sh -f tsim/parser/last_groupby.sim
,,y,script,./test.sh -f tsim/parser/lastrow.sim
,,y,script,./test.sh -f tsim/parser/lastrow.sim
,,,script,./test.sh -f tsim/parser/lastrow2.sim
,,
y
,script,./test.sh -f tsim/parser/lastrow2.sim
,,y,script,./test.sh -f tsim/parser/like.sim
,,y,script,./test.sh -f tsim/parser/like.sim
,,,script,./test.sh -f tsim/parser/limit.sim
,,,script,./test.sh -f tsim/parser/limit.sim
,,,script,./test.sh -f tsim/parser/limit1.sim
,,,script,./test.sh -f tsim/parser/limit1.sim
,,y,script,./test.sh -f tsim/parser/mixed_blocks.sim
,,y,script,./test.sh -f tsim/parser/mixed_blocks.sim
,,,script,./test.sh -f tsim/parser/nchar.sim
,,
y
,script,./test.sh -f tsim/parser/nchar.sim
,,,script,./test.sh -f tsim/parser/nestquery.sim
,,,script,./test.sh -f tsim/parser/nestquery.sim
,,,script,./test.sh -f tsim/parser/null_char.sim
,,,script,./test.sh -f tsim/parser/null_char.sim
,,y,script,./test.sh -f tsim/parser/precision_ns.sim
,,y,script,./test.sh -f tsim/parser/precision_ns.sim
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
,,y,script,./test.sh -f tsim/parser/select_distinct_tag.sim
,,y,script,./test.sh -f tsim/parser/select_distinct_tag.sim
,,y,script,./test.sh -f tsim/parser/select_from_cache_disk.sim
,,y,script,./test.sh -f tsim/parser/select_from_cache_disk.sim
,,y,script,./test.sh -f tsim/parser/select_with_tags.sim
,,y,script,./test.sh -f tsim/parser/select_with_tags.sim
,,,script,./test.sh -f tsim/parser/selectResNum.sim
,,
y
,script,./test.sh -f tsim/parser/selectResNum.sim
,,,script,./test.sh -f tsim/parser/set_tag_vals.sim
,,,script,./test.sh -f tsim/parser/set_tag_vals.sim
,,y,script,./test.sh -f tsim/parser/single_row_in_tb.sim
,,y,script,./test.sh -f tsim/parser/single_row_in_tb.sim
,,,script,./test.sh -f tsim/parser/sliding.sim
,,,script,./test.sh -f tsim/parser/sliding.sim
...
@@ -271,7 +271,7 @@
...
@@ -271,7 +271,7 @@
,,y,script,./test.sh -f tsim/stable/tag_filter.sim
,,y,script,./test.sh -f tsim/stable/tag_filter.sim
,,y,script,./test.sh -f tsim/stable/tag_modify.sim
,,y,script,./test.sh -f tsim/stable/tag_modify.sim
,,y,script,./test.sh -f tsim/stable/tag_rename.sim
,,y,script,./test.sh -f tsim/stable/tag_rename.sim
,,,script,./test.sh -f tsim/stable/values.sim
,,
y
,script,./test.sh -f tsim/stable/values.sim
,,y,script,./test.sh -f tsim/stable/vnode3.sim
,,y,script,./test.sh -f tsim/stable/vnode3.sim
,,y,script,./test.sh -f tsim/stable/metrics_idx.sim
,,y,script,./test.sh -f tsim/stable/metrics_idx.sim
,,,script,./test.sh -f tsim/sma/drop_sma.sim
,,,script,./test.sh -f tsim/sma/drop_sma.sim
...
@@ -325,7 +325,7 @@
...
@@ -325,7 +325,7 @@
,,y,script,./test.sh -f tsim/compute/bottom.sim
,,y,script,./test.sh -f tsim/compute/bottom.sim
,,y,script,./test.sh -f tsim/compute/count.sim
,,y,script,./test.sh -f tsim/compute/count.sim
,,y,script,./test.sh -f tsim/compute/diff.sim
,,y,script,./test.sh -f tsim/compute/diff.sim
,,,script,./test.sh -f tsim/compute/diff2.sim
,,
y
,script,./test.sh -f tsim/compute/diff2.sim
,,y,script,./test.sh -f tsim/compute/first.sim
,,y,script,./test.sh -f tsim/compute/first.sim
,,y,script,./test.sh -f tsim/compute/interval.sim
,,y,script,./test.sh -f tsim/compute/interval.sim
,,y,script,./test.sh -f tsim/compute/last_row.sim
,,y,script,./test.sh -f tsim/compute/last_row.sim
...
@@ -358,7 +358,7 @@
...
@@ -358,7 +358,7 @@
,,y,script,./test.sh -f tsim/vector/metrics_query.sim
,,y,script,./test.sh -f tsim/vector/metrics_query.sim
,,y,script,./test.sh -f tsim/vector/metrics_tag.sim
,,y,script,./test.sh -f tsim/vector/metrics_tag.sim
,,y,script,./test.sh -f tsim/vector/metrics_time.sim
,,y,script,./test.sh -f tsim/vector/metrics_time.sim
,,,script,./test.sh -f tsim/vector/multi.sim
,,
y
,script,./test.sh -f tsim/vector/multi.sim
,,y,script,./test.sh -f tsim/vector/single.sim
,,y,script,./test.sh -f tsim/vector/single.sim
,,y,script,./test.sh -f tsim/vector/table_field.sim
,,y,script,./test.sh -f tsim/vector/table_field.sim
,,y,script,./test.sh -f tsim/vector/table_mix.sim
,,y,script,./test.sh -f tsim/vector/table_mix.sim
...
@@ -380,7 +380,7 @@
...
@@ -380,7 +380,7 @@
,,y,script,./test.sh -f tsim/tag/column.sim
,,y,script,./test.sh -f tsim/tag/column.sim
,,y,script,./test.sh -f tsim/tag/commit.sim
,,y,script,./test.sh -f tsim/tag/commit.sim
,,y,script,./test.sh -f tsim/tag/create.sim
,,y,script,./test.sh -f tsim/tag/create.sim
,,,script,./test.sh -f tsim/tag/delete.sim
,,
y
,script,./test.sh -f tsim/tag/delete.sim
,,y,script,./test.sh -f tsim/tag/double.sim
,,y,script,./test.sh -f tsim/tag/double.sim
,,y,script,./test.sh -f tsim/tag/filter.sim
,,y,script,./test.sh -f tsim/tag/filter.sim
,,y,script,./test.sh -f tsim/tag/float.sim
,,y,script,./test.sh -f tsim/tag/float.sim
...
@@ -392,7 +392,7 @@
...
@@ -392,7 +392,7 @@
,,y,script,./test.sh -f tsim/tag/tinyint.sim
,,y,script,./test.sh -f tsim/tag/tinyint.sim
,,y,script,./test.sh -f tsim/tag/drop_tag.sim
,,y,script,./test.sh -f tsim/tag/drop_tag.sim
,,y,script,./test.sh -f tsim/tag/tbNameIn.sim
,,y,script,./test.sh -f tsim/tag/tbNameIn.sim
,,,script,./test.sh -f tmp/monitor.sim
,,
y
,script,./test.sh -f tmp/monitor.sim
#system test
#system test
...
...
tests/script/sh/checkAsan.sh
浏览文件 @
d31d05fe
...
@@ -20,7 +20,7 @@ LOG_DIR=$TAOS_DIR/sim/tsim/asan
...
@@ -20,7 +20,7 @@ LOG_DIR=$TAOS_DIR/sim/tsim/asan
error_num
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"ERROR"
|
wc
-l
`
error_num
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"ERROR"
|
wc
-l
`
memory_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Direct leak"
|
wc
-l
`
memory_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Direct leak"
|
wc
-l
`
indirect_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Indirect leak"
|
wc
-l
`
indirect_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Indirect leak"
|
wc
-l
`
runtime_error
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"runtime error"
|
wc
-l
`
runtime_error
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"runtime error"
|
grep
-v
"trees.c:873"
|
wc
-l
`
echo
-e
"
\0
33[44;32;1m"
asan error_num:
$error_num
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan error_num:
$error_num
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan memory_leak:
$memory_leak
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan memory_leak:
$memory_leak
"
\0
33[0m"
...
...
tools/CMakeLists.txt
浏览文件 @
d31d05fe
...
@@ -87,6 +87,7 @@ ELSE ()
...
@@ -87,6 +87,7 @@ ELSE ()
MESSAGE
(
"CURRENT SOURCE DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
MESSAGE
(
"CURRENT SOURCE DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
IF
(
TD_WINDOWS
)
IF
(
TD_WINDOWS
)
MESSAGE
(
"Building taosAdapter on Windows"
)
INCLUDE
(
ExternalProject
)
INCLUDE
(
ExternalProject
)
ExternalProject_Add
(
taosadapter
ExternalProject_Add
(
taosadapter
PREFIX
"taosadapter"
PREFIX
"taosadapter"
...
@@ -104,14 +105,18 @@ ELSE ()
...
@@ -104,14 +105,18 @@ ELSE ()
COMMAND go build -a -o taosadapter-debug.exe -ldflags
"-X github.com/taosdata/taosadapter/v3/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/v3/version.CommitID=
${
taosadapter_commit_sha1
}
"
COMMAND go build -a -o taosadapter-debug.exe -ldflags
"-X github.com/taosdata/taosadapter/v3/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/v3/version.CommitID=
${
taosadapter_commit_sha1
}
"
INSTALL_COMMAND
INSTALL_COMMAND
COMMAND cmake -E time upx taosadapter ||:
COMMAND cmake -E echo
"Comparessing taosadapter.exe"
COMMAND cmake -E copy taosadapter.exe
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E time upx taosadapter.exe
COMMAND cmake -E echo
"Copy taosadapter.exe"
COMMAND cmake -E copy taosadapter.exe
${
CMAKE_BINARY_DIR
}
/build/bin/taosadapter.exe
COMMAND cmake -E make_directory
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E make_directory
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E echo
"Copy taosadapter.toml"
COMMAND cmake -E copy ./example/config/taosadapter.toml
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./example/config/taosadapter.toml
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E
copy ./taosadapter.service
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E
echo
"Copy taosadapter-debug.exe"
COMMAND cmake -E copy taosadapter-debug.exe
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E copy taosadapter-debug.exe
${
CMAKE_BINARY_DIR
}
/build/bin
)
)
ELSE
(
TD_WINDOWS
)
ELSE
(
TD_WINDOWS
)
MESSAGE
(
"Building taosAdapter on non-Windows"
)
INCLUDE
(
ExternalProject
)
INCLUDE
(
ExternalProject
)
ExternalProject_Add
(
taosadapter
ExternalProject_Add
(
taosadapter
PREFIX
"taosadapter"
PREFIX
"taosadapter"
...
@@ -126,11 +131,15 @@ ELSE ()
...
@@ -126,11 +131,15 @@ ELSE ()
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -ldflags
"-s -w -X github.com/taosdata/taosadapter/v3/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/v3/version.CommitID=
${
taosadapter_commit_sha1
}
"
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -ldflags
"-s -w -X github.com/taosdata/taosadapter/v3/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/v3/version.CommitID=
${
taosadapter_commit_sha1
}
"
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -o taosadapter-debug -ldflags
"-X github.com/taosdata/taosadapter/v3/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/v3/version.CommitID=
${
taosadapter_commit_sha1
}
"
COMMAND CGO_CFLAGS=-I
${
CMAKE_CURRENT_SOURCE_DIR
}
/../include/client CGO_LDFLAGS=-L
${
CMAKE_BINARY_DIR
}
/build/lib go build -a -o taosadapter-debug -ldflags
"-X github.com/taosdata/taosadapter/v3/version.Version=
${
taos_version
}
-X github.com/taosdata/taosadapter/v3/version.CommitID=
${
taosadapter_commit_sha1
}
"
INSTALL_COMMAND
INSTALL_COMMAND
COMMAND cmake -E echo
"Comparessing taosadapter.exe"
COMMAND upx taosadapter || :
COMMAND upx taosadapter || :
COMMAND cmake -E echo
"Copy taosadapter"
COMMAND cmake -E copy taosadapter
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E copy taosadapter
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E make_directory
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E make_directory
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E echo
"Copy taosadapter.toml"
COMMAND cmake -E copy ./example/config/taosadapter.toml
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./example/config/taosadapter.toml
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./taosadapter.service
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E copy ./taosadapter.service
${
CMAKE_BINARY_DIR
}
/test/cfg/
COMMAND cmake -E echo
"Copy taosadapter-debug"
COMMAND cmake -E copy taosadapter-debug
${
CMAKE_BINARY_DIR
}
/build/bin
COMMAND cmake -E copy taosadapter-debug
${
CMAKE_BINARY_DIR
}
/build/bin
)
)
ENDIF
(
TD_WINDOWS
)
ENDIF
(
TD_WINDOWS
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录