Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
472a1aa9
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
472a1aa9
编写于
10月 29, 2021
作者:
D
dapan1121
提交者:
GitHub
10月 29, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8331 from taosdata/szhou/hotfix/td-10683
Szhou/hotfix/td 10683
上级
bf15479f
d1766a61
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
13 deletion
+21
-13
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+10
-5
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+1
-1
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
src/tsdb/src/tsdbMemTable.c
src/tsdb/src/tsdbMemTable.c
+1
-1
tests/pytest/dbmgmt/nanoSecondCheck.py
tests/pytest/dbmgmt/nanoSecondCheck.py
+2
-1
tests/script/general/parser/alter.sim
tests/script/general/parser/alter.sim
+3
-2
tests/script/general/parser/alter__for_community_version.sim
tests/script/general/parser/alter__for_community_version.sim
+3
-2
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
472a1aa9
...
...
@@ -6792,16 +6792,21 @@ static int32_t setKeepOption(SSqlCmd* pCmd, SCreateDbMsg* pMsg, SCreateDbInfo* p
tVariantListItem
*
p1
=
(
s
>
1
)
?
taosArrayGet
(
pKeep
,
1
)
:
p0
;
tVariantListItem
*
p2
=
(
s
>
2
)
?
taosArrayGet
(
pKeep
,
2
)
:
p1
;
if
((
int32_t
)
p0
->
pVar
.
i64
<=
0
||
(
int32_t
)
p1
->
pVar
.
i64
<=
0
||
(
int32_t
)
p2
->
pVar
.
i64
<=
0
)
{
int32_t
daysToKeep0
=
(
int32_t
)
p0
->
pVar
.
i64
;
int32_t
daysToKeep1
=
(
int32_t
)(
int32_t
)
p1
->
pVar
.
i64
;
int32_t
daysToKeep2
=
(
int32_t
)
p2
->
pVar
.
i64
;
if
(
daysToKeep0
<=
0
||
daysToKeep1
<=
0
||
daysToKeep2
<=
0
||
daysToKeep0
>
TSDB_MAX_KEEP
||
daysToKeep1
>
TSDB_MAX_KEEP
||
daysToKeep2
>
TSDB_MAX_KEEP
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
if
(
!
(((
int32_t
)
p0
->
pVar
.
i64
<=
(
int32_t
)
p1
->
pVar
.
i64
)
&&
((
int32_t
)
p1
->
pVar
.
i64
<=
(
int32_t
)
p2
->
pVar
.
i64
)))
{
if
(
!
((
daysToKeep0
<=
daysToKeep1
)
&&
(
daysToKeep1
<=
daysToKeep2
)))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg3
);
}
pMsg
->
daysToKeep0
=
htonl
(
(
int32_t
)
p0
->
pVar
.
i64
);
pMsg
->
daysToKeep1
=
htonl
(
(
int32_t
)
p1
->
pVar
.
i64
);
pMsg
->
daysToKeep2
=
htonl
(
(
int32_t
)
p2
->
pVar
.
i64
);
pMsg
->
daysToKeep0
=
htonl
(
daysToKeep0
);
pMsg
->
daysToKeep1
=
htonl
(
daysToKeep1
);
pMsg
->
daysToKeep2
=
htonl
(
daysToKeep2
);
}
...
...
src/common/inc/tdataformat.h
浏览文件 @
472a1aa9
...
...
@@ -139,7 +139,7 @@ typedef uint64_t TKEY;
#define tdGetTKEY(key) (((TKEY)ABS(key)) | (TKEY_NEGATIVE_FLAG & (TKEY)(key)))
#define tdGetKey(tkey) (((TSKEY)((tkey)&TKEY_VALUE_FILTER)) * (TKEY_IS_NEGATIVE(tkey) ? -1 : 1))
#define MIN_TS_KEY ((TSKEY)0x
8
000000000000001)
#define MIN_TS_KEY ((TSKEY)0x
c
000000000000001)
#define MAX_TS_KEY ((TSKEY)0x3fffffffffffffff)
#define TD_TO_TKEY(key) tdGetTKEY(((key) < MIN_TS_KEY) ? MIN_TS_KEY : (((key) > MAX_TS_KEY) ? MAX_TS_KEY : key))
...
...
src/inc/taosdef.h
浏览文件 @
472a1aa9
...
...
@@ -295,7 +295,7 @@ do { \
#define TSDB_DEFAULT_DAYS_PER_FILE 10
#define TSDB_MIN_KEEP 1 // data in db to be reserved.
#define TSDB_MAX_KEEP 36500
0
// data in db to be reserved.
#define TSDB_MAX_KEEP 36500 // data in db to be reserved.
#define TSDB_DEFAULT_KEEP 3650 // ten years
#define TSDB_DEFAULT_MIN_ROW_FBLOCK 100
...
...
src/tsdb/src/tsdbMemTable.c
浏览文件 @
472a1aa9
...
...
@@ -647,7 +647,7 @@ static int tsdbScanAndConvertSubmitMsg(STsdbRepo *pRepo, SSubmitMsg *pMsg) {
TSKEY
now
=
taosGetTimestamp
(
pRepo
->
config
.
precision
);
TSKEY
minKey
=
now
-
tsTickPerDay
[
pRepo
->
config
.
precision
]
*
pRepo
->
config
.
keep
;
TSKEY
maxKey
=
now
+
tsTickPerDay
[
pRepo
->
config
.
precision
]
*
pRepo
->
config
.
daysPerFile
;
terrno
=
TSDB_CODE_SUCCESS
;
pMsg
->
length
=
htonl
(
pMsg
->
length
);
pMsg
->
numOfBlocks
=
htonl
(
pMsg
->
numOfBlocks
);
...
...
tests/pytest/dbmgmt/nanoSecondCheck.py
浏览文件 @
472a1aa9
...
...
@@ -31,6 +31,7 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
error
(
'create database db keep 365000'
);
tdSql
.
execute
(
'create database db precision "ns";'
)
tdSql
.
query
(
'show databases;'
)
tdSql
.
checkData
(
0
,
16
,
'ns'
)
...
...
@@ -216,4 +217,4 @@ class TDTestCase:
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/script/general/parser/alter.sim
浏览文件 @
472a1aa9
...
...
@@ -86,12 +86,13 @@ endi
if $data07 != 11,12,13 then
return -1
endi
sql alter database $db keep 365000,365000,365000
sql_error alter database $db keep 365000,365000,365000
sql alter database $db keep 36500,36500,36500
sql show databases
if $rows != 1 then
return -1
endi
if $data07 != 36500
0,365000,3650
00 then
if $data07 != 36500
,36500,365
00 then
return -1
endi
...
...
tests/script/general/parser/alter__for_community_version.sim
浏览文件 @
472a1aa9
...
...
@@ -79,15 +79,16 @@ endi
if $data07 != 13 then
return -1
endi
sql alter database $db keep 36500
0
sql alter database $db keep 36500
sql show databases
if $rows != 1 then
return -1
endi
if $data07 != 36500
0
then
if $data07 != 36500 then
return -1
endi
sql_error alter database $db keep 365000
##### alter table test, simeplest case
sql create table tb (ts timestamp, c1 int, c2 int, c3 int)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录