Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
df8354af
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
df8354af
编写于
4月 18, 2022
作者:
H
Haojun Liao
提交者:
GitHub
4月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11590 from taosdata/feature/3.0_liaohj
enh(query): set the parameters for system database to be NULL
上级
b0519b57
ea8832ba
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
209 addition
and
184 deletion
+209
-184
include/os/osMemory.h
include/os/osMemory.h
+6
-6
source/client/src/clientMain.c
source/client/src/clientMain.c
+1
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-1
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+1
-0
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+92
-75
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+3
-0
source/util/src/tcache.c
source/util/src/tcache.c
+2
-0
source/util/src/tconfig.c
source/util/src/tconfig.c
+3
-3
source/util/src/tlog.c
source/util/src/tlog.c
+85
-78
tests/script/tsim/parser/fourArithmetic-basic.sim
tests/script/tsim/parser/fourArithmetic-basic.sim
+0
-1
tests/script/tsim/query/charScalarFunction.sim
tests/script/tsim/query/charScalarFunction.sim
+0
-1
tests/script/tsim/query/scalarFunction.sim
tests/script/tsim/query/scalarFunction.sim
+0
-1
tests/script/tsim/query/session.sim
tests/script/tsim/query/session.sim
+0
-1
tests/script/tsim/tmq/basic1.sim
tests/script/tsim/tmq/basic1.sim
+0
-1
tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim
tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim
+0
-1
tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim
tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim
+0
-1
tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim
tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim
+0
-1
tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim
tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim
+0
-1
tests/script/tsim/tmq/mainConsumerInMultiTopic.sim
tests/script/tsim/tmq/mainConsumerInMultiTopic.sim
+0
-1
tests/script/tsim/tmq/mainConsumerInOneTopic.sim
tests/script/tsim/tmq/mainConsumerInOneTopic.sim
+0
-1
tests/script/tsim/tmq/multiTopic.sim
tests/script/tsim/tmq/multiTopic.sim
+0
-1
tests/script/tsim/tmq/oneTopic.sim
tests/script/tsim/tmq/oneTopic.sim
+0
-1
tests/script/tsim/tmq/overlapTopic2Con1Cgrp.sim
tests/script/tsim/tmq/overlapTopic2Con1Cgrp.sim
+0
-1
tests/tsim/inc/simInt.h
tests/tsim/inc/simInt.h
+1
-1
tests/tsim/src/simExe.c
tests/tsim/src/simExe.c
+13
-4
tools/shell/src/shellMain.c
tools/shell/src/shellMain.c
+1
-1
未找到文件。
include/os/osMemory.h
浏览文件 @
df8354af
...
...
@@ -36,12 +36,12 @@ void *taosMemoryStrDup(void *ptr);
void
taosMemoryFree
(
void
*
ptr
);
int32_t
taosMemorySize
(
void
*
ptr
);
#define taosMemoryFreeClear(ptr) \
do { \
if (ptr) { \
taosMemoryFree((void
*)ptr);
\
(ptr) = NULL; \
} \
#define taosMemoryFreeClear(ptr)
\
do {
\
if (ptr) {
\
taosMemoryFree((void
*)ptr);
\
(ptr) = NULL;
\
}
\
} while (0)
#ifdef __cplusplus
...
...
source/client/src/clientMain.c
浏览文件 @
df8354af
...
...
@@ -69,9 +69,9 @@ void taos_cleanup(void) {
rpcCleanup
();
catalogDestroy
();
schedulerDestroy
();
taosCloseLog
();
tscInfo
(
"all local resources released"
);
taosCloseLog
();
}
setConfRet
taos_set_config
(
const
char
*
config
)
{
...
...
source/common/src/tglobal.c
浏览文件 @
df8354af
...
...
@@ -238,7 +238,7 @@ static int32_t taosLoadCfg(SConfig *pCfg, const char *inputCfgDir, const char *e
if
(
cfgLoad
(
pCfg
,
CFG_STYPE_CFG_FILE
,
cfgDir
)
!=
0
)
{
if
(
cfgLoad
(
pCfg
,
CFG_STYPE_CFG_FILE
,
cfgFile
)
!=
0
)
{
u
Error
(
"failed to load from config file:%s
since %s"
,
cfgFile
,
terrstr
());
u
Info
(
"cfg file:%s not read
since %s"
,
cfgFile
,
terrstr
());
return
0
;
}
}
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
df8354af
...
...
@@ -262,6 +262,7 @@ static void vmCleanup(SMgmtWrapper *pWrapper) {
vmCloseVnodes
(
pMgmt
);
vmStopWorker
(
pMgmt
);
vnodeCleanup
();
tfsClose
(
pMgmt
->
pTfs
);
// walCleanUp();
taosMemoryFree
(
pMgmt
);
pWrapper
->
pMgmt
=
NULL
;
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
df8354af
...
...
@@ -1354,7 +1354,7 @@ char *mndGetDbStr(char *src) {
return
pos
;
}
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
)
{
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
bool
sysDb
)
{
int32_t
cols
=
0
;
char
*
buf
=
taosMemoryMalloc
(
pShow
->
bytes
[
cols
]);
...
...
@@ -1366,100 +1366,117 @@ static void dumpDbInfoData(SSDataBlock* pBlock, SDbObj *pDb, SShowObj *pShow, in
ASSERT
(
0
);
}
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
)
;
c
olDataAppend
(
pColInfo
,
rows
,
buf
,
false
)
;
taosMemoryFree
(
buf
);
char
*
status
=
"ready"
;
c
har
b
[
24
]
=
{
0
}
;
STR_WITH_SIZE_TO_VARSTR
(
b
,
status
,
strlen
(
status
)
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
createdTime
,
false
);
if
(
sysDb
)
{
for
(
int32_t
i
=
0
;
i
<
pShow
->
numOfColumns
;
++
i
)
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
if
(
i
==
0
)
{
colDataAppend
(
pColInfo
,
rows
,
buf
,
false
);
}
else
if
(
i
==
3
)
{
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
numOfTables
,
false
);
}
else
if
(
i
==
20
)
{
colDataAppend
(
pColInfo
,
rows
,
b
,
false
);
}
else
{
colDataAppendNULL
(
pColInfo
,
rows
);
}
}
}
else
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
buf
,
false
);
taosMemoryFree
(
buf
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
numOfVgroups
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
createdTime
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
numOfTable
s
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
numOfVgroup
s
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
replication
s
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
numOfTable
s
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
quorum
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
replications
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
daysPerFile
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
quorum
,
false
);
char
tmp
[
128
]
=
{
0
};
int32_t
len
=
0
;
if
(
pDb
->
cfg
.
daysToKeep0
>
pDb
->
cfg
.
daysToKeep1
||
pDb
->
cfg
.
daysToKeep0
>
pDb
->
cfg
.
daysToKeep2
)
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
daysToKeep1
,
pDb
->
cfg
.
daysToKeep2
,
pDb
->
cfg
.
daysToKeep0
);
}
else
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
daysToKeep0
,
pDb
->
cfg
.
daysToKeep1
,
pDb
->
cfg
.
daysToKeep2
);
}
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
daysPerFile
,
false
);
varDataSetLen
(
tmp
,
len
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
tmp
,
false
);
char
tmp
[
128
]
=
{
0
};
int32_t
len
=
0
;
if
(
pDb
->
cfg
.
daysToKeep0
>
pDb
->
cfg
.
daysToKeep1
||
pDb
->
cfg
.
daysToKeep0
>
pDb
->
cfg
.
daysToKeep2
)
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
daysToKeep1
,
pDb
->
cfg
.
daysToKeep2
,
pDb
->
cfg
.
daysToKeep0
);
}
else
{
len
=
sprintf
(
&
tmp
[
VARSTR_HEADER_SIZE
],
"%d,%d,%d"
,
pDb
->
cfg
.
daysToKeep0
,
pDb
->
cfg
.
daysToKeep1
,
pDb
->
cfg
.
daysToKeep2
);
}
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheBlockSize
,
false
);
varDataSetLen
(
tmp
,
len
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
tmp
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
totalBlocks
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheBlockSize
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
minRow
s
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
totalBlock
s
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
max
Rows
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
min
Rows
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walLevel
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
maxRows
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
fsyncPeriod
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
walLevel
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
fsyncPeriod
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheLastRow
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
compression
,
false
);
char
*
prec
=
NULL
;
switch
(
pDb
->
cfg
.
precision
)
{
case
TSDB_TIME_PRECISION_MILLI
:
prec
=
TSDB_TIME_PRECISION_MILLI_STR
;
break
;
case
TSDB_TIME_PRECISION_MICRO
:
prec
=
TSDB_TIME_PRECISION_MICRO_STR
;
break
;
case
TSDB_TIME_PRECISION_NANO
:
prec
=
TSDB_TIME_PRECISION_NANO_STR
;
break
;
default:
prec
=
"none"
;
break
;
}
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
cacheLastRow
,
false
);
char
t
[
10
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
t
,
prec
,
2
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
t
,
false
);
char
*
prec
=
NULL
;
switch
(
pDb
->
cfg
.
precision
)
{
case
TSDB_TIME_PRECISION_MILLI
:
prec
=
TSDB_TIME_PRECISION_MILLI_STR
;
break
;
case
TSDB_TIME_PRECISION_MICRO
:
prec
=
TSDB_TIME_PRECISION_MICRO_STR
;
break
;
case
TSDB_TIME_PRECISION_NANO
:
prec
=
TSDB_TIME_PRECISION_NANO_STR
;
break
;
default:
prec
=
"none"
;
break
;
}
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
ttl
,
false
);
char
t
[
10
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
t
,
prec
,
2
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
t
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
singleSTable
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
ttl
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
streamMod
e
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
singleSTabl
e
,
false
);
char
*
status
=
"ready"
;
char
b
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
b
,
status
,
strlen
(
status
));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
&
pDb
->
cfg
.
streamMode
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
b
,
false
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
b
,
false
);
}
// pWrite = getDataPosition(data, pShow, cols, rows, rowCapacity);
// *(int8_t *)pWrite = pDb->cfg.update;
...
...
@@ -1508,13 +1525,13 @@ static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlo
if
(
!
pShow
->
sysDbRsp
)
{
SDbObj
infoschemaDb
=
{
0
};
setInformationSchemaDbCfg
(
&
infoschemaDb
);
dumpDbInfoData
(
pBlock
,
&
infoschemaDb
,
pShow
,
numOfRows
,
14
);
dumpDbInfoData
(
pBlock
,
&
infoschemaDb
,
pShow
,
numOfRows
,
14
,
true
);
numOfRows
+=
1
;
SDbObj
perfschemaDb
=
{
0
};
setPerfSchemaDbCfg
(
&
perfschemaDb
);
dumpDbInfoData
(
pBlock
,
&
perfschemaDb
,
pShow
,
numOfRows
,
3
);
dumpDbInfoData
(
pBlock
,
&
perfschemaDb
,
pShow
,
numOfRows
,
3
,
true
);
numOfRows
+=
1
;
pShow
->
sysDbRsp
=
true
;
...
...
@@ -1529,7 +1546,7 @@ static int32_t mndRetrieveDbs(SNodeMsg *pReq, SShowObj *pShow, SSDataBlock* pBlo
int32_t
numOfTables
=
0
;
sdbTraverse
(
pSdb
,
SDB_VGROUP
,
mndGetTablesOfDbFp
,
&
numOfTables
,
NULL
,
NULL
);
dumpDbInfoData
(
pBlock
,
pDb
,
pShow
,
numOfRows
,
numOfTables
);
dumpDbInfoData
(
pBlock
,
pDb
,
pShow
,
numOfRows
,
numOfTables
,
false
);
numOfRows
++
;
sdbRelease
(
pSdb
,
pDb
);
}
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
df8354af
...
...
@@ -1470,6 +1470,9 @@ void qWorkerDestroy(void **qWorkerMgmt) {
//TODO FREE ALL
taosHashCleanup
(
mgmt
->
ctxHash
);
taosHashCleanup
(
mgmt
->
schHash
);
taosMemoryFreeClear
(
*
qWorkerMgmt
);
}
...
...
source/util/src/tcache.c
浏览文件 @
df8354af
...
...
@@ -910,6 +910,8 @@ void taosCacheRefresh(SCacheObj *pCacheObj, __cache_trav_fn_t fp, void *param1)
void
taosStopCacheRefreshWorker
(
void
)
{
stopRefreshWorker
=
true
;
taosThreadJoin
(
cacheRefreshWorker
,
NULL
);
taosArrayDestroy
(
pCacheArrayList
);
}
size_t
taosCacheGetNumOfObj
(
const
SCacheObj
*
pCacheObj
)
{
...
...
source/util/src/tconfig.c
浏览文件 @
df8354af
...
...
@@ -591,12 +591,12 @@ void cfgDumpCfg(SConfig *pCfg, bool tsc, bool dump) {
}
int32_t
cfgLoadFromEnvVar
(
SConfig
*
pConfig
)
{
u
Info
(
"load from env variables not implemented yet"
);
u
Debug
(
"load from env variables not implemented yet"
);
return
0
;
}
int32_t
cfgLoadFromEnvFile
(
SConfig
*
pConfig
,
const
char
*
filepath
)
{
u
Info
(
"load from env file not implemented yet"
);
u
Debug
(
"load from env file not implemented yet"
);
return
0
;
}
...
...
@@ -655,6 +655,6 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
}
int32_t
cfgLoadFromApollUrl
(
SConfig
*
pConfig
,
const
char
*
url
)
{
u
Info
(
"load from apoll url not implemented yet"
);
u
Debug
(
"load from apoll url not implemented yet"
);
return
0
;
}
source/util/src/tlog.c
浏览文件 @
df8354af
...
...
@@ -38,27 +38,26 @@
#define LOG_BUF_MUTEX(x) ((x)->buffMutex)
typedef
struct
{
char
*
buffer
;
int32_t
buffStart
;
int32_t
buffEnd
;
int32_t
buffSize
;
int32_t
minBuffSize
;
TdFilePtr
pFile
;
int32_t
stop
;
TdThread
asyncThread
;
char
*
buffer
;
int32_t
buffStart
;
int32_t
buffEnd
;
int32_t
buffSize
;
int32_t
minBuffSize
;
TdFilePtr
pFile
;
int32_t
stop
;
TdThread
asyncThread
;
TdThreadMutex
buffMutex
;
tsem_t
buffNotEmpty
;
}
SLogBuff
;
typedef
struct
{
int32_t
fileNum
;
int32_t
maxLines
;
int32_t
lines
;
int32_t
flag
;
int32_t
openInProgress
;
pid_t
pid
;
char
logName
[
LOG_FILE_NAME_LEN
];
SLogBuff
*
logHandle
;
int32_t
fileNum
;
int32_t
maxLines
;
int32_t
lines
;
int32_t
flag
;
int32_t
openInProgress
;
pid_t
pid
;
char
logName
[
LOG_FILE_NAME_LEN
];
SLogBuff
*
logHandle
;
TdThreadMutex
logMutex
;
}
SLogObj
;
...
...
@@ -100,7 +99,7 @@ int64_t dbgBigWN = 0;
int64_t
dbgWSize
=
0
;
static
void
*
taosAsyncOutputLog
(
void
*
param
);
static
int32_t
taosPushLogBuffer
(
SLogBuff
*
tLogBuf
f
,
const
char
*
msg
,
int32_t
msgLen
);
static
int32_t
taosPushLogBuffer
(
SLogBuff
*
pLogBu
f
,
const
char
*
msg
,
int32_t
msgLen
);
static
SLogBuff
*
taosLogBuffNew
(
int32_t
bufSize
);
static
void
taosCloseLogByFd
(
TdFilePtr
pFile
);
static
int32_t
taosOpenLogFile
(
char
*
fn
,
int32_t
maxLines
,
int32_t
maxFileNum
);
...
...
@@ -136,16 +135,24 @@ static void taosStopLog() {
}
}
static
void
taosLogBuffDestroy
()
{
taosThreadMutexDestroy
(
&
tsLogObj
.
logHandle
->
buffMutex
);
taosCloseFile
(
&
tsLogObj
.
logHandle
->
pFile
);
taosMemoryFreeClear
(
tsLogObj
.
logHandle
->
buffer
);
memset
(
&
tsLogObj
.
logHandle
->
buffer
,
0
,
sizeof
(
tsLogObj
.
logHandle
->
buffer
));
taosThreadMutexDestroy
(
&
tsLogObj
.
logMutex
);
taosMemoryFreeClear
(
tsLogObj
.
logHandle
);
memset
(
&
tsLogObj
.
logHandle
,
0
,
sizeof
(
tsLogObj
.
logHandle
));
tsLogObj
.
logHandle
=
NULL
;
}
void
taosCloseLog
()
{
taosStopLog
();
if
(
taosCheckPthreadValid
(
tsLogObj
.
logHandle
->
asyncThread
))
{
taosThreadJoin
(
tsLogObj
.
logHandle
->
asyncThread
,
NULL
);
}
tsLogInited
=
0
;
// In case that other threads still use log resources causing invalid write in valgrind
// we comment two lines below.
// taosLogBuffDestroy(tsLogObj.logHandle);
// taosCloseLog();
taosLogBuffDestroy
(
tsLogObj
.
logHandle
);
}
static
bool
taosLockLogFile
(
TdFilePtr
pFile
)
{
...
...
@@ -231,7 +238,7 @@ static int32_t taosOpenNewLogFile() {
tsLogObj
.
openInProgress
=
1
;
uInfo
(
"open new log file ......"
);
TdThread
thread
;
TdThread
thread
;
TdThreadAttr
attr
;
taosThreadAttrInit
(
&
attr
);
taosThreadAttrSetDetachState
(
&
attr
,
PTHREAD_CREATE_DETACHED
);
...
...
@@ -506,45 +513,45 @@ static void taosCloseLogByFd(TdFilePtr pFile) {
}
static
SLogBuff
*
taosLogBuffNew
(
int32_t
bufSize
)
{
SLogBuff
*
tLogBuf
f
=
NULL
;
SLogBuff
*
pLogBu
f
=
NULL
;
tLogBuf
f
=
taosMemoryCalloc
(
1
,
sizeof
(
SLogBuff
));
if
(
tLogBuf
f
==
NULL
)
return
NULL
;
pLogBu
f
=
taosMemoryCalloc
(
1
,
sizeof
(
SLogBuff
));
if
(
pLogBu
f
==
NULL
)
return
NULL
;
LOG_BUF_BUFFER
(
tLogBuf
f
)
=
taosMemoryMalloc
(
bufSize
);
if
(
LOG_BUF_BUFFER
(
tLogBuf
f
)
==
NULL
)
goto
_err
;
LOG_BUF_BUFFER
(
pLogBu
f
)
=
taosMemoryMalloc
(
bufSize
);
if
(
LOG_BUF_BUFFER
(
pLogBu
f
)
==
NULL
)
goto
_err
;
LOG_BUF_START
(
tLogBuff
)
=
LOG_BUF_END
(
tLogBuf
f
)
=
0
;
LOG_BUF_SIZE
(
tLogBuf
f
)
=
bufSize
;
tLogBuf
f
->
minBuffSize
=
bufSize
/
10
;
tLogBuf
f
->
stop
=
0
;
LOG_BUF_START
(
pLogBuf
)
=
LOG_BUF_END
(
pLogBu
f
)
=
0
;
LOG_BUF_SIZE
(
pLogBu
f
)
=
bufSize
;
pLogBu
f
->
minBuffSize
=
bufSize
/
10
;
pLogBu
f
->
stop
=
0
;
if
(
taosThreadMutexInit
(
&
LOG_BUF_MUTEX
(
tLogBuf
f
),
NULL
)
<
0
)
goto
_err
;
// tsem_init(&(
tLogBuf
f->buffNotEmpty), 0, 0);
if
(
taosThreadMutexInit
(
&
LOG_BUF_MUTEX
(
pLogBu
f
),
NULL
)
<
0
)
goto
_err
;
// tsem_init(&(
pLogBu
f->buffNotEmpty), 0, 0);
return
tLogBuf
f
;
return
pLogBu
f
;
_err:
taosMemoryFreeClear
(
LOG_BUF_BUFFER
(
tLogBuf
f
));
taosMemoryFreeClear
(
tLogBuf
f
);
taosMemoryFreeClear
(
LOG_BUF_BUFFER
(
pLogBu
f
));
taosMemoryFreeClear
(
pLogBu
f
);
return
NULL
;
}
static
void
taosCopyLogBuffer
(
SLogBuff
*
tLogBuf
f
,
int32_t
start
,
int32_t
end
,
const
char
*
msg
,
int32_t
msgLen
)
{
static
void
taosCopyLogBuffer
(
SLogBuff
*
pLogBu
f
,
int32_t
start
,
int32_t
end
,
const
char
*
msg
,
int32_t
msgLen
)
{
if
(
start
>
end
)
{
memcpy
(
LOG_BUF_BUFFER
(
tLogBuf
f
)
+
end
,
msg
,
msgLen
);
memcpy
(
LOG_BUF_BUFFER
(
pLogBu
f
)
+
end
,
msg
,
msgLen
);
}
else
{
if
(
LOG_BUF_SIZE
(
tLogBuf
f
)
-
end
<
msgLen
)
{
memcpy
(
LOG_BUF_BUFFER
(
tLogBuff
)
+
end
,
msg
,
LOG_BUF_SIZE
(
tLogBuf
f
)
-
end
);
memcpy
(
LOG_BUF_BUFFER
(
tLogBuff
),
msg
+
LOG_BUF_SIZE
(
tLogBuff
)
-
end
,
msgLen
-
LOG_BUF_SIZE
(
tLogBuf
f
)
+
end
);
if
(
LOG_BUF_SIZE
(
pLogBu
f
)
-
end
<
msgLen
)
{
memcpy
(
LOG_BUF_BUFFER
(
pLogBuf
)
+
end
,
msg
,
LOG_BUF_SIZE
(
pLogBu
f
)
-
end
);
memcpy
(
LOG_BUF_BUFFER
(
pLogBuf
),
msg
+
LOG_BUF_SIZE
(
pLogBuf
)
-
end
,
msgLen
-
LOG_BUF_SIZE
(
pLogBu
f
)
+
end
);
}
else
{
memcpy
(
LOG_BUF_BUFFER
(
tLogBuf
f
)
+
end
,
msg
,
msgLen
);
memcpy
(
LOG_BUF_BUFFER
(
pLogBu
f
)
+
end
,
msg
,
msgLen
);
}
}
LOG_BUF_END
(
tLogBuff
)
=
(
LOG_BUF_END
(
tLogBuff
)
+
msgLen
)
%
LOG_BUF_SIZE
(
tLogBuf
f
);
LOG_BUF_END
(
pLogBuf
)
=
(
LOG_BUF_END
(
pLogBuf
)
+
msgLen
)
%
LOG_BUF_SIZE
(
pLogBu
f
);
}
static
int32_t
taosPushLogBuffer
(
SLogBuff
*
tLogBuf
f
,
const
char
*
msg
,
int32_t
msgLen
)
{
static
int32_t
taosPushLogBuffer
(
SLogBuff
*
pLogBu
f
,
const
char
*
msg
,
int32_t
msgLen
)
{
int32_t
start
=
0
;
int32_t
end
=
0
;
int32_t
remainSize
=
0
;
...
...
@@ -552,13 +559,13 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, const char *msg, int32_t ms
char
tmpBuf
[
40
]
=
{
0
};
int32_t
tmpBufLen
=
0
;
if
(
tLogBuff
==
NULL
||
tLogBuf
f
->
stop
)
return
-
1
;
if
(
pLogBuf
==
NULL
||
pLogBu
f
->
stop
)
return
-
1
;
taosThreadMutexLock
(
&
LOG_BUF_MUTEX
(
tLogBuf
f
));
start
=
LOG_BUF_START
(
tLogBuf
f
);
end
=
LOG_BUF_END
(
tLogBuf
f
);
taosThreadMutexLock
(
&
LOG_BUF_MUTEX
(
pLogBu
f
));
start
=
LOG_BUF_START
(
pLogBu
f
);
end
=
LOG_BUF_END
(
pLogBu
f
);
remainSize
=
(
start
>
end
)
?
(
start
-
end
-
1
)
:
(
start
+
LOG_BUF_SIZE
(
tLogBuf
f
)
-
end
-
1
);
remainSize
=
(
start
>
end
)
?
(
start
-
end
-
1
)
:
(
start
+
LOG_BUF_SIZE
(
pLogBu
f
)
-
end
-
1
);
if
(
lostLine
>
0
)
{
sprintf
(
tmpBuf
,
"...Lost %"
PRId64
" lines here...
\n
"
,
lostLine
);
...
...
@@ -568,47 +575,47 @@ static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, const char *msg, int32_t ms
if
(
remainSize
<=
msgLen
||
((
lostLine
>
0
)
&&
(
remainSize
<=
(
msgLen
+
tmpBufLen
))))
{
lostLine
++
;
tsAsyncLogLostLines
++
;
taosThreadMutexUnlock
(
&
LOG_BUF_MUTEX
(
tLogBuf
f
));
taosThreadMutexUnlock
(
&
LOG_BUF_MUTEX
(
pLogBu
f
));
return
-
1
;
}
if
(
lostLine
>
0
)
{
taosCopyLogBuffer
(
tLogBuf
f
,
start
,
end
,
tmpBuf
,
tmpBufLen
);
taosCopyLogBuffer
(
pLogBu
f
,
start
,
end
,
tmpBuf
,
tmpBufLen
);
lostLine
=
0
;
}
taosCopyLogBuffer
(
tLogBuff
,
LOG_BUF_START
(
tLogBuff
),
LOG_BUF_END
(
tLogBuf
f
),
msg
,
msgLen
);
taosCopyLogBuffer
(
pLogBuf
,
LOG_BUF_START
(
pLogBuf
),
LOG_BUF_END
(
pLogBu
f
),
msg
,
msgLen
);
// int32_t w = atomic_sub_fetch_32(&waitLock, 1);
/*
if (w <= 0 || ((remainSize - msgLen - tmpBufLen) < (LOG_BUF_SIZE(
tLogBuf
f) * 4 /5))) {
tsem_post(&(
tLogBuf
f->buffNotEmpty));
if (w <= 0 || ((remainSize - msgLen - tmpBufLen) < (LOG_BUF_SIZE(
pLogBu
f) * 4 /5))) {
tsem_post(&(
pLogBu
f->buffNotEmpty));
dbgPostN++;
} else {
dbgNoPostN++;
}
*/
taosThreadMutexUnlock
(
&
LOG_BUF_MUTEX
(
tLogBuf
f
));
taosThreadMutexUnlock
(
&
LOG_BUF_MUTEX
(
pLogBu
f
));
return
0
;
}
static
int32_t
taosGetLogRemainSize
(
SLogBuff
*
tLogBuf
f
,
int32_t
start
,
int32_t
end
)
{
static
int32_t
taosGetLogRemainSize
(
SLogBuff
*
pLogBu
f
,
int32_t
start
,
int32_t
end
)
{
int32_t
rSize
=
end
-
start
;
return
rSize
>=
0
?
rSize
:
LOG_BUF_SIZE
(
tLogBuf
f
)
+
rSize
;
return
rSize
>=
0
?
rSize
:
LOG_BUF_SIZE
(
pLogBu
f
)
+
rSize
;
}
static
void
taosWriteLog
(
SLogBuff
*
tLogBuf
f
)
{
static
void
taosWriteLog
(
SLogBuff
*
pLogBu
f
)
{
static
int32_t
lastDuration
=
0
;
int32_t
remainChecked
=
0
;
int32_t
start
,
end
,
pollSize
;
do
{
if
(
remainChecked
==
0
)
{
start
=
LOG_BUF_START
(
tLogBuf
f
);
end
=
LOG_BUF_END
(
tLogBuf
f
);
start
=
LOG_BUF_START
(
pLogBu
f
);
end
=
LOG_BUF_END
(
pLogBu
f
);
if
(
start
==
end
)
{
dbgEmptyW
++
;
...
...
@@ -616,8 +623,8 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
return
;
}
pollSize
=
taosGetLogRemainSize
(
tLogBuf
f
,
start
,
end
);
if
(
pollSize
<
tLogBuf
f
->
minBuffSize
)
{
pollSize
=
taosGetLogRemainSize
(
pLogBu
f
,
start
,
end
);
if
(
pollSize
<
pLogBu
f
->
minBuffSize
)
{
lastDuration
+=
tsWriteInterval
;
if
(
lastDuration
<
LOG_MAX_WAIT_MSEC
)
{
break
;
...
...
@@ -628,38 +635,38 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
}
if
(
start
<
end
)
{
taosWriteFile
(
tLogBuff
->
pFile
,
LOG_BUF_BUFFER
(
tLogBuf
f
)
+
start
,
pollSize
);
taosWriteFile
(
pLogBuf
->
pFile
,
LOG_BUF_BUFFER
(
pLogBu
f
)
+
start
,
pollSize
);
}
else
{
int32_t
tsize
=
LOG_BUF_SIZE
(
tLogBuf
f
)
-
start
;
taosWriteFile
(
tLogBuff
->
pFile
,
LOG_BUF_BUFFER
(
tLogBuf
f
)
+
start
,
tsize
);
int32_t
tsize
=
LOG_BUF_SIZE
(
pLogBu
f
)
-
start
;
taosWriteFile
(
pLogBuf
->
pFile
,
LOG_BUF_BUFFER
(
pLogBu
f
)
+
start
,
tsize
);
taosWriteFile
(
tLogBuff
->
pFile
,
LOG_BUF_BUFFER
(
tLogBuf
f
),
end
);
taosWriteFile
(
pLogBuf
->
pFile
,
LOG_BUF_BUFFER
(
pLogBu
f
),
end
);
}
dbgWN
++
;
dbgWSize
+=
pollSize
;
if
(
pollSize
<
tLogBuf
f
->
minBuffSize
)
{
if
(
pollSize
<
pLogBu
f
->
minBuffSize
)
{
dbgSmallWN
++
;
if
(
tsWriteInterval
<
LOG_MAX_INTERVAL
)
{
tsWriteInterval
+=
LOG_INTERVAL_STEP
;
}
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
tLogBuf
f
)
/
3
)
{
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
pLogBu
f
)
/
3
)
{
dbgBigWN
++
;
tsWriteInterval
=
LOG_MIN_INTERVAL
;
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
tLogBuf
f
)
/
4
)
{
}
else
if
(
pollSize
>
LOG_BUF_SIZE
(
pLogBu
f
)
/
4
)
{
if
(
tsWriteInterval
>
LOG_MIN_INTERVAL
)
{
tsWriteInterval
-=
LOG_INTERVAL_STEP
;
}
}
LOG_BUF_START
(
tLogBuff
)
=
(
LOG_BUF_START
(
tLogBuff
)
+
pollSize
)
%
LOG_BUF_SIZE
(
tLogBuf
f
);
LOG_BUF_START
(
pLogBuf
)
=
(
LOG_BUF_START
(
pLogBuf
)
+
pollSize
)
%
LOG_BUF_SIZE
(
pLogBu
f
);
start
=
LOG_BUF_START
(
tLogBuf
f
);
end
=
LOG_BUF_END
(
tLogBuf
f
);
start
=
LOG_BUF_START
(
pLogBu
f
);
end
=
LOG_BUF_END
(
pLogBu
f
);
pollSize
=
taosGetLogRemainSize
(
tLogBuf
f
,
start
,
end
);
if
(
pollSize
<
tLogBuf
f
->
minBuffSize
)
{
pollSize
=
taosGetLogRemainSize
(
pLogBu
f
,
start
,
end
);
if
(
pollSize
<
pLogBu
f
->
minBuffSize
)
{
break
;
}
...
...
@@ -670,16 +677,16 @@ static void taosWriteLog(SLogBuff *tLogBuff) {
}
static
void
*
taosAsyncOutputLog
(
void
*
param
)
{
SLogBuff
*
tLogBuf
f
=
(
SLogBuff
*
)
param
;
SLogBuff
*
pLogBu
f
=
(
SLogBuff
*
)
param
;
setThreadName
(
"log"
);
while
(
1
)
{
taosMsleep
(
tsWriteInterval
);
// Polling the buffer
taosWriteLog
(
tLogBuf
f
);
taosWriteLog
(
pLogBu
f
);
if
(
tLogBuf
f
->
stop
)
break
;
if
(
pLogBu
f
->
stop
)
break
;
}
return
NULL
;
...
...
tests/script/tsim/parser/fourArithmetic-basic.sim
浏览文件 @
df8354af
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/query/charScalarFunction.sim
浏览文件 @
df8354af
...
...
@@ -2,7 +2,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/query/scalarFunction.sim
浏览文件 @
df8354af
...
...
@@ -2,7 +2,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/query/session.sim
浏览文件 @
df8354af
...
...
@@ -2,7 +2,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/basic1.sim
浏览文件 @
df8354af
...
...
@@ -11,7 +11,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/main2Con1Cgrp1TopicFrCtb.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/main2Con1Cgrp1TopicFrStb.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/main2Con1Cgrp2TopicFrCtb.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/main2Con1Cgrp2TopicFrStb.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/mainConsumerInMultiTopic.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/mainConsumerInOneTopic.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/multiTopic.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/oneTopic.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/script/tsim/tmq/overlapTopic2Con1Cgrp.sim
浏览文件 @
df8354af
...
...
@@ -14,7 +14,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
...
...
tests/tsim/inc/simInt.h
浏览文件 @
df8354af
...
...
@@ -33,7 +33,7 @@
#define MAX_BACKGROUND_SCRIPT_NUM 10
#define MAX_FILE_NAME_LEN 256
#define MAX_ERROR_LEN 1024
#define MAX_QUERY_VALUE_LEN 40
#define MAX_QUERY_VALUE_LEN
102
40
#define MAX_QUERY_COL_NUM 20
#define MAX_QUERY_ROW_NUM 20
#define MAX_SYSTEM_RESULT_LEN 2048
...
...
tests/tsim/src/simExe.c
浏览文件 @
df8354af
...
...
@@ -18,7 +18,7 @@
void
simLogSql
(
char
*
sql
,
bool
useSharp
)
{
static
TdFilePtr
pFile
=
NULL
;
char
filename
[
256
];
char
filename
[
256
];
sprintf
(
filename
,
"%s/sim.sql"
,
simScriptDir
);
if
(
pFile
==
NULL
)
{
// fp = fopen(filename, "w");
...
...
@@ -305,7 +305,8 @@ bool simExecuteRunBackCmd(SScript *script, char *option) {
return
true
;
}
void
simReplaceStr
(
char
*
buf
,
char
*
src
,
char
*
dst
)
{
bool
simReplaceStr
(
char
*
buf
,
char
*
src
,
char
*
dst
)
{
bool
replaced
=
false
;
char
*
begin
=
strstr
(
buf
,
src
);
if
(
begin
!=
NULL
)
{
int32_t
srcLen
=
(
int32_t
)
strlen
(
src
);
...
...
@@ -320,13 +321,16 @@ void simReplaceStr(char *buf, char *src, char *dst) {
}
memcpy
(
begin
,
dst
,
dstLen
);
replaced
=
true
;
}
simInfo
(
"system cmd is %s"
,
buf
);
return
replaced
;
}
bool
simExecuteSystemCmd
(
SScript
*
script
,
char
*
option
)
{
char
buf
[
4096
]
=
{
0
};
bool
replaced
=
false
;
#ifndef WINDOWS
sprintf
(
buf
,
"cd %s; "
,
simScriptDir
);
...
...
@@ -341,7 +345,7 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
}
if
(
useValgrind
)
{
simReplaceStr
(
buf
,
"exec.sh"
,
"exec.sh -v"
);
replaced
=
simReplaceStr
(
buf
,
"exec.sh"
,
"exec.sh -v"
);
}
simLogSql
(
buf
,
true
);
...
...
@@ -359,6 +363,11 @@ bool simExecuteSystemCmd(SScript *script, char *option) {
sprintf
(
script
->
system_exit_code
,
"%d"
,
code
);
script
->
linePos
++
;
if
(
replaced
&&
strstr
(
buf
,
"start"
)
!=
NULL
)
{
simInfo
(
"====> startup is slow in valgrind mode, so sleep 5 seconds after exec.sh -s start"
);
taosMsleep
(
5000
);
}
return
true
;
}
...
...
@@ -774,7 +783,7 @@ bool simExecuteSqlSlowCmd(SScript *script, char *rest) {
bool
simExecuteRestfulCmd
(
SScript
*
script
,
char
*
rest
)
{
TdFilePtr
pFile
=
NULL
;
char
filename
[
256
];
char
filename
[
256
];
sprintf
(
filename
,
"%s/tmp.sql"
,
simScriptDir
);
// fp = fopen(filename, "w");
pFile
=
taosOpenFile
(
filename
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_TRUNC
|
TD_FILE_STREAM
);
...
...
tools/shell/src/shellMain.c
浏览文件 @
df8354af
...
...
@@ -45,7 +45,7 @@ static tsem_t cancelSem;
static
struct
argp_option
options
[]
=
{
{
"host"
,
'h'
,
"HOST"
,
0
,
"TDengine server FQDN to connect. The default host is localhost."
},
{
"password"
,
'p'
,
0
,
0
,
"The password to use when connecting to the server."
},
{
"password"
,
'p'
,
0
,
0
,
"The password to use when connecting to the server."
},
{
"port"
,
'P'
,
"PORT"
,
0
,
"The TCP/IP port number to use for the connection."
},
{
"user"
,
'u'
,
"USER"
,
0
,
"The user name to use when connecting to the server."
},
{
"auth"
,
'A'
,
"Auth"
,
0
,
"The auth string to use when connecting to the server."
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录