Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
32b10a42
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
32b10a42
编写于
2月 04, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1207 rename in windows
上级
9db8f7c3
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
63 addition
and
41 deletion
+63
-41
src/inc/tfs.h
src/inc/tfs.h
+1
-1
src/os/inc/osDir.h
src/os/inc/osDir.h
+1
-1
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+2
-0
src/os/src/detail/osDir.c
src/os/src/detail/osDir.c
+11
-8
src/os/src/windows/wFile.c
src/os/src/windows/wFile.c
+11
-1
src/tsdb/src/tsdbFS.c
src/tsdb/src/tsdbFS.c
+1
-1
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+11
-4
tests/script/general/parser/col_arithmetic_operation.sim
tests/script/general/parser/col_arithmetic_operation.sim
+1
-1
tests/script/general/parser/col_arithmetic_query.sim
tests/script/general/parser/col_arithmetic_query.sim
+7
-7
tests/script/sh/deploy.bat
tests/script/sh/deploy.bat
+17
-17
未找到文件。
src/inc/tfs.h
浏览文件 @
32b10a42
...
...
@@ -64,7 +64,7 @@ typedef struct {
#define tfsclose(fd) close(fd)
#define tfsremove(pf) remove(TFILE_NAME(pf))
#define tfscopy(sf, df) taosCopy(TFILE_NAME(sf), TFILE_NAME(df))
#define tfsrename(sf, df)
r
ename(TFILE_NAME(sf), TFILE_NAME(df))
#define tfsrename(sf, df)
taosR
ename(TFILE_NAME(sf), TFILE_NAME(df))
void
tfsInitFile
(
TFILE
*
pf
,
int
level
,
int
id
,
const
char
*
bname
);
bool
tfsIsSameFile
(
const
TFILE
*
pf1
,
const
TFILE
*
pf2
);
...
...
src/os/inc/osDir.h
浏览文件 @
32b10a42
...
...
@@ -25,8 +25,8 @@ extern "C" {
// TAOS_OS_FUNC_DIR
void
taosRemoveDir
(
char
*
rootDir
);
int
taosMkDir
(
const
char
*
pathname
,
mode_t
mode
);
void
taosRename
(
char
*
oldName
,
char
*
newName
);
void
taosRemoveOldLogFiles
(
char
*
rootDir
,
int32_t
keepDays
);
int32_t
taosRename
(
char
*
oldName
,
char
*
newName
);
int32_t
taosCompressFile
(
char
*
srcFileName
,
char
*
destFileName
);
#ifdef __cplusplus
...
...
src/os/inc/osWindows.h
浏览文件 @
32b10a42
...
...
@@ -69,6 +69,8 @@ extern "C" {
#define TAOS_OS_FUNC_FILE_GETTMPFILEPATH
#define TAOS_OS_FUNC_FILE_FTRUNCATE
#define TAOS_OS_FUNC_DIR
#define TAOS_OS_FUNC_MATH
#define SWAP(a, b, c) \
do { \
...
...
src/os/src/detail/osDir.c
浏览文件 @
32b10a42
...
...
@@ -51,19 +51,22 @@ int taosMkDir(const char *path, mode_t mode) {
return
code
;
}
void
taosRename
(
char
*
oldName
,
char
*
newName
)
{
// if newName in not empty, rename return fail.
// the newName must be empty or does not exist
#ifdef WINDOWS
remove
(
newName
);
#endif
if
(
rename
(
oldName
,
newName
))
{
#ifndef TAOS_OS_FUNC_DIR
int32_t
taosRename
(
char
*
oldName
,
char
*
newName
)
{
int32_t
code
=
rename
(
oldName
,
newName
);
if
(
code
<
0
)
{
uError
(
"failed to rename file %s to %s, reason:%s"
,
oldName
,
newName
,
strerror
(
errno
));
}
else
{
u
Info
(
"successfully to rename file %s to %s"
,
oldName
,
newName
);
u
Trace
(
"successfully to rename file %s to %s"
,
oldName
,
newName
);
}
return
code
;
}
#endif
void
taosRemoveOldLogFiles
(
char
*
rootDir
,
int32_t
keepDays
)
{
DIR
*
dir
=
opendir
(
rootDir
);
if
(
dir
==
NULL
)
return
;
...
...
src/os/src/windows/wFile.c
浏览文件 @
32b10a42
...
...
@@ -160,7 +160,6 @@ int32_t taosFtruncate(int32_t fd, int64_t l_size) {
return
0
;
}
int
fsync
(
int
filedes
)
{
if
(
filedes
<
0
)
{
errno
=
EBADF
;
...
...
@@ -172,3 +171,14 @@ int fsync(int filedes) {
return
FlushFileBuffers
(
h
);
}
int32_t
taosRename
(
char
*
oldName
,
char
*
newName
)
{
int32_t
code
=
MoveFileEx
(
oldName
,
newName
,
MOVEFILE_REPLACE_EXISTING
|
MOVEFILE_COPY_ALLOWED
);
if
(
code
<
0
)
{
uError
(
"failed to rename file %s to %s, reason:%s"
,
oldName
,
newName
,
strerror
(
errno
));
}
else
{
uTrace
(
"successfully to rename file %s to %s"
,
oldName
,
newName
);
}
return
code
;
}
\ No newline at end of file
src/tsdb/src/tsdbFS.c
浏览文件 @
32b10a42
...
...
@@ -395,7 +395,7 @@ static int tsdbSaveFSStatus(SFSStatus *pStatus, int vid) {
}
(
void
)
close
(
fd
);
(
void
)
r
ename
(
tfname
,
cfname
);
(
void
)
taosR
ename
(
tfname
,
cfname
);
taosTZfree
(
pBuf
);
return
0
;
...
...
src/wal/src/walWrite.c
浏览文件 @
32b10a42
...
...
@@ -39,7 +39,7 @@ int32_t walRenew(void *handle) {
if
(
tfValid
(
pWal
->
tfd
))
{
tfClose
(
pWal
->
tfd
);
wDebug
(
"vgId:%d, file:%s, it is closed"
,
pWal
->
vgId
,
pWal
->
name
);
wDebug
(
"vgId:%d, file:%s, it is closed
while renew
"
,
pWal
->
vgId
,
pWal
->
name
);
}
if
(
pWal
->
keep
==
TAOS_WAL_KEEP
)
{
...
...
@@ -56,7 +56,7 @@ int32_t walRenew(void *handle) {
code
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d, file:%s, failed to open since %s"
,
pWal
->
vgId
,
pWal
->
name
,
strerror
(
errno
));
}
else
{
wDebug
(
"vgId:%d, file:%s, it is created"
,
pWal
->
vgId
,
pWal
->
name
);
wDebug
(
"vgId:%d, file:%s, it is created
and open while renew
"
,
pWal
->
vgId
,
pWal
->
name
);
}
pthread_mutex_unlock
(
&
pWal
->
mutex
);
...
...
@@ -95,11 +95,15 @@ void walRemoveAllOldFiles(void *handle) {
int64_t
fileId
=
-
1
;
pthread_mutex_lock
(
&
pWal
->
mutex
);
tfClose
(
pWal
->
tfd
);
wDebug
(
"vgId:%d, file:%s, it is closed before remove all wals"
,
pWal
->
vgId
,
pWal
->
name
);
while
(
walGetNextFile
(
pWal
,
&
fileId
)
>=
0
)
{
snprintf
(
pWal
->
name
,
sizeof
(
pWal
->
name
),
"%s/%s%"
PRId64
,
pWal
->
path
,
WAL_PREFIX
,
fileId
);
if
(
remove
(
pWal
->
name
)
<
0
)
{
wError
(
"vgId:%d, wal:%p file:%s, failed to remove
"
,
pWal
->
vgId
,
pWal
,
pWal
->
name
);
wError
(
"vgId:%d, wal:%p file:%s, failed to remove
since %s"
,
pWal
->
vgId
,
pWal
,
pWal
->
name
,
strerror
(
errno
)
);
}
else
{
wInfo
(
"vgId:%d, wal:%p file:%s, it is removed"
,
pWal
->
vgId
,
pWal
,
pWal
->
name
);
}
...
...
@@ -192,7 +196,7 @@ int32_t walRestore(void *handle, void *pVnode, FWalWrite writeFp) {
wError
(
"vgId:%d, file:%s, failed to open since %s"
,
pWal
->
vgId
,
pWal
->
name
,
strerror
(
errno
));
return
TAOS_SYSTEM_ERROR
(
errno
);
}
wDebug
(
"vgId:%d, file:%s
open success
"
,
pWal
->
vgId
,
pWal
->
name
);
wDebug
(
"vgId:%d, file:%s
, it is created and open while restore
"
,
pWal
->
vgId
,
pWal
->
name
);
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -265,6 +269,8 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch
wError
(
"vgId:%d, file:%s, failed to open for restore since %s"
,
pWal
->
vgId
,
name
,
strerror
(
errno
));
tfree
(
buffer
);
return
TAOS_SYSTEM_ERROR
(
errno
);
}
else
{
wDebug
(
"vgId:%d, file:%s, open for restore"
,
pWal
->
vgId
,
name
);
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -332,6 +338,7 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch
tfClose
(
tfd
);
tfree
(
buffer
);
wDebug
(
"vgId:%d, file:%s, it is closed after restore"
,
pWal
->
vgId
,
name
);
return
code
;
}
...
...
tests/script/general/parser/col_arithmetic_operation.sim
浏览文件 @
32b10a42
...
...
@@ -110,7 +110,7 @@ system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql connect
sleep 500
c
sleep 500
0
run general/parser/col_arithmetic_query.sim
...
...
tests/script/general/parser/col_arithmetic_query.sim
浏览文件 @
32b10a42
...
...
@@ -41,10 +41,10 @@ if $data00 != 0.000000000 then
return -1
endi
if $data01 != -nan then
print expect -nan, actual: $data01
return -1
endi
#
if $data01 != -nan then
#
print expect -nan, actual: $data01
#
return -1
#
endi
if $data10 != 0.666666667 then
return -1
...
...
@@ -185,9 +185,9 @@ if $data00 != 0.000000000 then
return -1
endi
if $data01 != -nan then
return -1
endi
#
if $data01 != -nan then
#
return -1
#
endi
if $data02 != 0.000000000 then
return -1
...
...
tests/script/sh/deploy.bat
浏览文件 @
32b10a42
...
...
@@ -65,24 +65,24 @@ echo serverPort %NODE% >> %TAOS_CFG%
echo
dataDir
%DATA_DIR%
>>
%TAOS_CFG%
echo
logDir
%LOG_DIR%
>>
%TAOS_CFG%
echo
debugFlag
0
>>
%TAOS_CFG%
echo
mDebugFlag
1
43
>>
%TAOS_CFG%
echo
sdbDebugFlag
1
43
>>
%TAOS_CFG%
echo
dDebugFlag
1
43
>>
%TAOS_CFG%
echo
vDebugFlag
1
43
>>
%TAOS_CFG%
echo
tsdbDebugFlag
1
43
>>
%TAOS_CFG%
echo
cDebugFlag
1
43
>>
%TAOS_CFG%
echo
jnidebugFlag
1
43
>>
%TAOS_CFG%
echo
odbcdebugFlag
1
43
>>
%TAOS_CFG%
echo
httpDebugFlag
1
43
>>
%TAOS_CFG%
echo
monDebugFlag
1
43
>>
%TAOS_CFG%
echo
mqttDebugFlag
1
43
>>
%TAOS_CFG%
echo
qdebugFlag
1
43
>>
%TAOS_CFG%
echo
rpcDebugFlag
1
43
>>
%TAOS_CFG%
echo
mDebugFlag
1
35
>>
%TAOS_CFG%
echo
sdbDebugFlag
1
35
>>
%TAOS_CFG%
echo
dDebugFlag
1
35
>>
%TAOS_CFG%
echo
vDebugFlag
1
35
>>
%TAOS_CFG%
echo
tsdbDebugFlag
1
35
>>
%TAOS_CFG%
echo
cDebugFlag
1
35
>>
%TAOS_CFG%
echo
jnidebugFlag
1
35
>>
%TAOS_CFG%
echo
odbcdebugFlag
1
35
>>
%TAOS_CFG%
echo
httpDebugFlag
1
35
>>
%TAOS_CFG%
echo
monDebugFlag
1
35
>>
%TAOS_CFG%
echo
mqttDebugFlag
1
35
>>
%TAOS_CFG%
echo
qdebugFlag
1
35
>>
%TAOS_CFG%
echo
rpcDebugFlag
1
35
>>
%TAOS_CFG%
echo
tmrDebugFlag
131
>>
%TAOS_CFG%
echo
udebugFlag
1
43
>>
%TAOS_CFG%
echo
sdebugFlag
1
43
>>
%TAOS_CFG%
echo
wdebugFlag
1
43
>>
%TAOS_CFG%
echo
cqdebugFlag
1
43
>>
%TAOS_CFG%
echo
udebugFlag
1
35
>>
%TAOS_CFG%
echo
sdebugFlag
1
35
>>
%TAOS_CFG%
echo
wdebugFlag
1
35
>>
%TAOS_CFG%
echo
cqdebugFlag
1
35
>>
%TAOS_CFG%
echo
monitor
0
>>
%TAOS_CFG%
echo
monitorInterval
1
>>
%TAOS_CFG%
echo
http
0
>>
%TAOS_CFG%
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录