Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
76883aa4
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
76883aa4
编写于
4月 20, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: check db options
上级
4e64e8db
变更
22
展开全部
隐藏空白更改
内联
并排
Showing
22 changed file
with
331 addition
and
403 deletion
+331
-403
include/common/tmsg.h
include/common/tmsg.h
+7
-7
include/util/tdef.h
include/util/tdef.h
+59
-95
source/common/src/tmsg.c
source/common/src/tmsg.c
+10
-10
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+0
-1
source/dnode/mgmt/test/vnode/vnode.cpp
source/dnode/mgmt/test/vnode/vnode.cpp
+2
-2
source/dnode/mnode/impl/inc/mndAuth.h
source/dnode/mnode/impl/inc/mndAuth.h
+1
-1
source/dnode/mnode/impl/inc/mndDb.h
source/dnode/mnode/impl/inc/mndDb.h
+2
-1
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+2
-2
source/dnode/mnode/impl/src/mndAuth.c
source/dnode/mnode/impl/src/mndAuth.c
+1
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+202
-237
source/dnode/mnode/impl/src/mndInfoSchema.c
source/dnode/mnode/impl/src/mndInfoSchema.c
+1
-1
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+2
-2
source/dnode/mnode/impl/test/db/db.cpp
source/dnode/mnode/impl/test/db/db.cpp
+3
-3
source/dnode/mnode/impl/test/sma/sma.cpp
source/dnode/mnode/impl/test/sma/sma.cpp
+1
-1
source/dnode/mnode/impl/test/stb/stb.cpp
source/dnode/mnode/impl/test/stb/stb.cpp
+1
-1
source/dnode/mnode/impl/test/topic/topic.cpp
source/dnode/mnode/impl/test/topic/topic.cpp
+1
-1
source/dnode/mnode/impl/test/user/user.cpp
source/dnode/mnode/impl/test/user/user.cpp
+1
-1
source/dnode/vnode/src/tsdb/tsdbMain.c
source/dnode/vnode/src/tsdb/tsdbMain.c
+10
-10
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+1
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+2
-2
source/libs/function/src/taggfunction.c
source/libs/function/src/taggfunction.c
+2
-2
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+20
-21
未找到文件。
include/common/tmsg.h
浏览文件 @
76883aa4
...
...
@@ -509,7 +509,7 @@ typedef struct {
int8_t
precision
;
// time resolution
int8_t
compression
;
int8_t
replications
;
int8_t
quorum
;
int8_t
strict
;
int8_t
update
;
int8_t
cacheLastRow
;
int8_t
ignoreExist
;
...
...
@@ -531,7 +531,7 @@ typedef struct {
int32_t
daysToKeep2
;
int32_t
fsyncPeriod
;
int8_t
walLevel
;
int8_t
quorum
;
int8_t
strict
;
int8_t
cacheLastRow
;
int8_t
replications
;
}
SAlterDbReq
;
...
...
@@ -604,7 +604,7 @@ typedef struct {
int8_t
precision
;
int8_t
compression
;
int8_t
replications
;
int8_t
quorum
;
int8_t
strict
;
int8_t
update
;
int8_t
cacheLastRow
;
int8_t
streamMode
;
...
...
@@ -639,10 +639,10 @@ void tFreeSUseDbBatchRsp(SUseDbBatchRsp* pRsp);
typedef
struct
{
char
db
[
TSDB_DB_FNAME_LEN
];
}
S
SyncDbReq
,
S
CompactDbReq
;
}
SCompactDbReq
;
int32_t
tSerializeS
SyncDbReq
(
void
*
buf
,
int32_t
bufLen
,
SSync
DbReq
*
pReq
);
int32_t
tDeserializeS
SyncDbReq
(
void
*
buf
,
int32_t
bufLen
,
SSync
DbReq
*
pReq
);
int32_t
tSerializeS
CompactDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCompact
DbReq
*
pReq
);
int32_t
tDeserializeS
CompactDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCompact
DbReq
*
pReq
);
typedef
struct
{
char
name
[
TSDB_FUNC_NAME_LEN
];
...
...
@@ -814,7 +814,7 @@ typedef struct {
int8_t
walLevel
;
int8_t
precision
;
int8_t
compression
;
int8_t
quorum
;
int8_t
strict
;
int8_t
update
;
int8_t
cacheLastRow
;
int8_t
replica
;
...
...
include/util/tdef.h
浏览文件 @
76883aa4
...
...
@@ -297,16 +297,6 @@ typedef enum ELogicConditionType {
#define TSDB_DNODE_CONFIG_LEN 128
#define TSDB_DNODE_VALUE_LEN 256
#define TSDB_MQTT_HOSTNAME_LEN 64
#define TSDB_MQTT_PORT_LEN 8
#define TSDB_MQTT_USER_LEN 24
#define TSDB_MQTT_PASS_LEN 24
#define TSDB_MQTT_TOPIC_LEN 64
#define TSDB_MQTT_CLIENT_ID_LEN 32
#define TSDB_DB_TYPE_DEFAULT 0
#define TSDB_DB_TYPE_TOPIC 1
#define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE
#define TSDB_PAYLOAD_SIZE TSDB_DEFAULT_PKT_SIZE
...
...
@@ -315,9 +305,6 @@ typedef enum ELogicConditionType {
#define TSDB_CQ_SQL_SIZE 1024
#define TSDB_MIN_VNODES 16
#define TSDB_MAX_VNODES 512
#define TSDB_MIN_VNODES_PER_DB 1
#define TSDB_MAX_VNODES_PER_DB 4096
#define TSDB_DEFAULT_VN_PER_DB 2
#define TSDB_DNODE_ROLE_ANY 0
#define TSDB_DNODE_ROLE_MGMT 1
...
...
@@ -331,104 +318,81 @@ typedef enum ELogicConditionType {
#define TSDB_MULTI_TABLEMETA_MAX_NUM 100000 // maximum batch size allowed to load table meta
#define TSDB_MIN_VNODES_PER_DB 1
#define TSDB_MAX_VNODES_PER_DB 4096
#define TSDB_DEFAULT_VN_PER_DB 2
#define TSDB_MIN_CACHE_BLOCK_SIZE 1
#define TSDB_MAX_CACHE_BLOCK_SIZE 128 // 128MB for each vnode
#define TSDB_DEFAULT_CACHE_BLOCK_SIZE 16
#define TSDB_MIN_TOTAL_BLOCKS 3
#define TSDB_MAX_TOTAL_BLOCKS 10000
#define TSDB_DEFAULT_TOTAL_BLOCKS 6
#define TSDB_MIN_DAYS_PER_FILE 60 // unit minute
#define TSDB_MAX_DAYS_PER_FILE (3650 * 1440)
#define TSDB_DEFAULT_DAYS_PER_FILE (10 * 1440)
#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute
#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved.
#define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years
#define TSDB_MIN_MIN_ROW_FBLOCK 10
#define TSDB_MAX_MIN_ROW_FBLOCK 1000
#define TSDB_DEFAULT_MIN_ROW_FBLOCK 100
#define TSDB_MIN_MAX_ROW_FBLOCK 200
#define TSDB_MAX_MAX_ROW_FBLOCK 10000
#define TSDB_DEFAULT_MAX_ROW_FBLOCK 4096
#define TSDB_MIN_COMMIT_TIME 30
#define TSDB_MAX_COMMIT_TIME 40960
#define TSDB_DEFAULT_COMMIT_TIME 3600
#define TSDB_MIN_FSYNC_PERIOD 0
#define TSDB_MAX_FSYNC_PERIOD 180000 // millisecond
#define TSDB_DEFAULT_FSYNC_PERIOD 3000 // three second
#define TSDB_MIN_WAL_LEVEL 1
#define TSDB_MAX_WAL_LEVEL 2
#define TSDB_DEFAULT_WAL_LEVEL 1
#define TSDB_MIN_PRECISION TSDB_TIME_PRECISION_MILLI
#define TSDB_MAX_PRECISION TSDB_TIME_PRECISION_NANO
#define TSDB_DEFAULT_PRECISION TSDB_TIME_PRECISION_MILLI
#define TSDB_MIN_COMP_LEVEL 0
#define TSDB_MAX_COMP_LEVEL 2
#define TSDB_DEFAULT_COMP_LEVEL 2
#define TSDB_MIN_DB_REPLICA_OPTION 1
#define TSDB_MAX_DB_REPLICA_OPTION 3
#define TSDB_DEFAULT_DB_REPLICA_OPTION 1
#define TSDB_MIN_DB_QUORUM_OPTION 1
#define TSDB_MAX_DB_QUORUM_OPTION 2
#define TSDB_DEFAULT_DB_QUORUM_OPTION 1
#define TSDB_MIN_DB_TTL_OPTION 1
#define TSDB_DEFAULT_DB_TTL_OPTION 0
#define TSDB_MIN_DB_SINGLE_STABLE_OPTION 0
#define TSDB_MAX_DB_SINGLE_STABLE_OPTION 1
#define TSDB_DEFAULT_DB_SINGLE_STABLE_OPTION 0
#define TSDB_MIN_DB_STREAM_MODE_OPTION 0
#define TSDB_MAX_DB_STREAM_MODE_OPTION 1
#define TSDB_DEFAULT_DB_STREAM_MODE_OPTION 0
#define TSDB_MAX_JOIN_TABLE_NUM 10
#define TSDB_MAX_UNION_CLAUSE 5
#define TSDB_MIN_TOTAL_BLOCKS 3
#define TSDB_MAX_TOTAL_BLOCKS 10000
#define TSDB_DEFAULT_TOTAL_BLOCKS 6
#define TSDB_MIN_DAYS_PER_FILE 60 // unit minute
#define TSDB_MAX_DAYS_PER_FILE (3650 * 1440)
#define TSDB_DEFAULT_DAYS_PER_FILE (10 * 1440)
#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute
#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved.
#define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years
#define TSDB_MIN_MINROWS_FBLOCK 10
#define TSDB_MAX_MINROWS_FBLOCK 1000
#define TSDB_DEFAULT_MINROWS_FBLOCK 100
#define TSDB_MIN_MAXROWS_FBLOCK 200
#define TSDB_MAX_MAXROWS_FBLOCK 10000
#define TSDB_DEFAULT_MAXROWS_FBLOCK 4096
#define TSDB_MIN_COMMIT_TIME 30
#define TSDB_MAX_COMMIT_TIME 40960
#define TSDB_DEFAULT_COMMIT_TIME 3600
#define TSDB_MIN_FSYNC_PERIOD 0
#define TSDB_MAX_FSYNC_PERIOD 180000 // millisecond
#define TSDB_DEFAULT_FSYNC_PERIOD 3000 // three second
#define TSDB_MIN_DB_TTL 1
#define TSDB_DEFAULT_DB_TTL 1
#define TSDB_MIN_WAL_LEVEL 1
#define TSDB_MAX_WAL_LEVEL 2
#define TSDB_DEFAULT_WAL_LEVEL 1
#define TSDB_MIN_PRECISION TSDB_TIME_PRECISION_MILLI
#define TSDB_MAX_PRECISION TSDB_TIME_PRECISION_NANO
#define TSDB_DEFAULT_PRECISION TSDB_TIME_PRECISION_MILLI
#define TSDB_MIN_COMP_LEVEL 0
#define TSDB_MAX_COMP_LEVEL 2
#define TSDB_DEFAULT_COMP_LEVEL 2
#define TSDB_MIN_DB_REPLICA 1
#define TSDB_MAX_DB_REPLICA 3
#define TSDB_DEFAULT_DB_REPLICA 1
#define TSDB_MIN_DB_STRICT 0
#define TSDB_MAX_DB_STRICT 1
#define TSDB_DEFAULT_DB_STRICT 0
#define TSDB_MIN_DB_UPDATE 0
#define TSDB_MAX_DB_UPDATE 2
#define TSDB_DEFAULT_DB_UPDATE_OPTION 0
#define TSDB_MIN_DB_CACHE_LAST_ROW 0
#define TSDB_MAX_DB_CACHE_LAST_ROW 3
#define TSDB_DEFAULT_CACHE_LAST_ROW 0
#define TSDB_MIN_DB_STREAM_MODE 0
#define TSDB_MAX_DB_STREAM_MODE 1
#define TSDB_DEFAULT_DB_STREAM_MODE 0
#define TSDB_DEFAULT_DB_UPDATE 0
#define TSDB_MIN_DB_CACHE_LAST_ROW 0
#define TSDB_MAX_DB_CACHE_LAST_ROW 3
#define TSDB_DEFAULT_CACHE_LAST_ROW 0
#define TSDB_MIN_DB_STREAM_MODE 0
#define TSDB_MAX_DB_STREAM_MODE 1
#define TSDB_DEFAULT_DB_STREAM_MODE 0
#define TSDB_MIN_DB_SINGLE_STABLE 0
#define TSDB_MAX_DB_SINGLE_STABLE 1
#define TSDB_DEFAULT_DB_SINGLE_STABLE 0
#define TSDB_MIN_DB_FILE_FACTOR 0
#define TSDB_MAX_DB_FILE_FACTOR 1
#define TSDB_DEFAULT_DB_FILE_FACTOR 0.1
#define TSDB_MIN_DB_DELAY 1
#define TSDB_MAX_DB_DELAY 10
#define TSDB_DEFAULT_DB_DELAY 2
#define TSDB_MIN_EXPLAIN_RATIO 0
#define TSDB_MAX_EXPLAIN_RATIO 1
#define TSDB_DEFAULT_EXPLAIN_RATIO 0.001
#define TSDB_MIN_DB_DELAY 1
#define TSDB_MAX_DB_DELAY 10
#define TSDB_DEFAULT_DB_DELAY 2
#define TSDB_MAX_JOIN_TABLE_NUM 10
#define TSDB_MAX_UNION_CLAUSE 5
#define TSDB_DEFAULT_EXPLAIN_VERBOSE false
#define TSDB_MIN_EXPLAIN_RATIO 0
#define TSDB_MAX_EXPLAIN_RATIO 1
#define TSDB_DEFAULT_EXPLAIN_RATIO 0.001
#define TSDB_EXPLAIN_RESULT_ROW_SIZE 1024
#define TSDB_EXPLAIN_RESULT_COLUMN_NAME "QUERY PLAN"
#define TSDB_MAX_JOIN_TABLE_NUM 10
#define TSDB_MAX_UNION_CLAUSE 5
#define TSDB_MAX_FIELD_LEN 16384
#define TSDB_MAX_BINARY_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384
#define TSDB_MAX_NCHAR_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384
...
...
source/common/src/tmsg.c
浏览文件 @
76883aa4
...
...
@@ -1736,7 +1736,7 @@ int32_t tSerializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq) {
if
(
tEncodeI8
(
&
encoder
,
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
compression
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
replications
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
quorum
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
update
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
...
...
@@ -1779,7 +1779,7 @@ int32_t tDeserializeSCreateDbReq(void *buf, int32_t bufLen, SCreateDbReq *pReq)
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
compression
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
replications
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
quorum
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
update
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
ignoreExist
)
<
0
)
return
-
1
;
...
...
@@ -1827,7 +1827,7 @@ int32_t tSerializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
if
(
tEncodeI32
(
&
encoder
,
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
quorum
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
replications
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
...
...
@@ -1849,7 +1849,7 @@ int32_t tDeserializeSAlterDbReq(void *buf, int32_t bufLen, SAlterDbReq *pReq) {
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
daysToKeep2
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
&
decoder
,
&
pReq
->
fsyncPeriod
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
quorum
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
replications
)
<
0
)
return
-
1
;
tEndDecode
(
&
decoder
);
...
...
@@ -2006,7 +2006,7 @@ int32_t tDeserializeSQnodeListRsp(void *buf, int32_t bufLen, SQnodeListRsp *pRsp
void
tFreeSQnodeListRsp
(
SQnodeListRsp
*
pRsp
)
{
taosArrayDestroy
(
pRsp
->
epSetList
);
}
int32_t
tSerializeS
SyncDbReq
(
void
*
buf
,
int32_t
bufLen
,
SSync
DbReq
*
pReq
)
{
int32_t
tSerializeS
CompactDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCompact
DbReq
*
pReq
)
{
SCoder
encoder
=
{
0
};
tCoderInit
(
&
encoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_ENCODER
);
...
...
@@ -2019,7 +2019,7 @@ int32_t tSerializeSSyncDbReq(void *buf, int32_t bufLen, SSyncDbReq *pReq) {
return
tlen
;
}
int32_t
tDeserializeS
SyncDbReq
(
void
*
buf
,
int32_t
bufLen
,
SSync
DbReq
*
pReq
)
{
int32_t
tDeserializeS
CompactDbReq
(
void
*
buf
,
int32_t
bufLen
,
SCompact
DbReq
*
pReq
)
{
SCoder
decoder
=
{
0
};
tCoderInit
(
&
decoder
,
TD_LITTLE_ENDIAN
,
buf
,
bufLen
,
TD_DECODER
);
...
...
@@ -2207,7 +2207,7 @@ int32_t tSerializeSDbCfgRsp(void *buf, int32_t bufLen, const SDbCfgRsp *pRsp) {
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
compression
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
replications
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
quorum
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
update
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pRsp
->
streamMode
)
<
0
)
return
-
1
;
...
...
@@ -2238,7 +2238,7 @@ int32_t tDeserializeSDbCfgRsp(void *buf, int32_t bufLen, SDbCfgRsp *pRsp) {
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
compression
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
replications
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
quorum
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
update
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pRsp
->
streamMode
)
<
0
)
return
-
1
;
...
...
@@ -2831,7 +2831,7 @@ int32_t tSerializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *pR
if
(
tEncodeI8
(
&
encoder
,
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
compression
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
quorum
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
update
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tEncodeI8
(
&
encoder
,
pReq
->
replica
)
<
0
)
return
-
1
;
...
...
@@ -2882,7 +2882,7 @@ int32_t tDeserializeSCreateVnodeReq(void *buf, int32_t bufLen, SCreateVnodeReq *
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
walLevel
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
precision
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
compression
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
quorum
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
strict
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
update
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
cacheLastRow
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
&
decoder
,
&
pReq
->
replica
)
<
0
)
return
-
1
;
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
76883aa4
...
...
@@ -188,7 +188,6 @@ void mmInitMsgHandle(SMgmtWrapper *pWrapper) {
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DB
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_USE_DB
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_DB
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_SYNC_DB
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_COMPACT_DB
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_FUNC
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_RETRIEVE_FUNC
,
mmProcessWriteMsg
,
DEFAULT_HANDLE
);
...
...
source/dnode/mgmt/test/vnode/vnode.cpp
浏览文件 @
76883aa4
...
...
@@ -47,7 +47,7 @@ TEST_F(DndTestVnode, 01_Create_Vnode) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replica
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
selfIndex
=
0
;
...
...
@@ -94,7 +94,7 @@ TEST_F(DndTestVnode, 02_Alter_Vnode) {
alterReq
.
precision
=
0
;
alterReq
.
compression
=
2
;
alterReq
.
replica
=
1
;
alterReq
.
quorum
=
1
;
alterReq
.
strict
=
1
;
alterReq
.
update
=
0
;
alterReq
.
cacheLastRow
=
0
;
alterReq
.
selfIndex
=
0
;
...
...
source/dnode/mnode/impl/inc/mndAuth.h
浏览文件 @
76883aa4
...
...
@@ -33,7 +33,7 @@ int32_t mndCheckNodeAuth(SUserObj *pOperUser);
int32_t
mndCheckFuncAuth
(
SUserObj
*
pOperUser
);
int32_t
mndCheckCreateDbAuth
(
SUserObj
*
pOperUser
);
int32_t
mndCheckAlterDropCompact
Sync
DbAuth
(
SUserObj
*
pOperUser
,
SDbObj
*
pDb
);
int32_t
mndCheckAlterDropCompactDbAuth
(
SUserObj
*
pOperUser
,
SDbObj
*
pDb
);
int32_t
mndCheckUseDbAuth
(
SUserObj
*
pOperUser
,
SDbObj
*
pDb
);
int32_t
mndCheckWriteAuth
(
SUserObj
*
pOperUser
,
SDbObj
*
pDb
);
...
...
source/dnode/mnode/impl/inc/mndDb.h
浏览文件 @
76883aa4
...
...
@@ -27,9 +27,10 @@ void mndCleanupDb(SMnode *pMnode);
SDbObj
*
mndAcquireDb
(
SMnode
*
pMnode
,
const
char
*
db
);
void
mndReleaseDb
(
SMnode
*
pMnode
,
SDbObj
*
pDb
);
int32_t
mndValidateDbInfo
(
SMnode
*
pMnode
,
SDbVgVersion
*
pDbs
,
int32_t
numOfDbs
,
void
**
ppRsp
,
int32_t
*
pRspLen
);
char
*
mndGetDbStr
(
char
*
src
);
int32_t
mndExtractDbInfo
(
SMnode
*
pMnode
,
SDbObj
*
pDb
,
SUseDbRsp
*
pRsp
,
const
SUseDbReq
*
pReq
);
const
char
*
mndGetDbStr
(
const
char
*
src
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
76883aa4
...
...
@@ -265,11 +265,12 @@ typedef struct {
int8_t
precision
;
int8_t
compression
;
int8_t
replications
;
int8_t
quorum
;
int8_t
strict
;
int8_t
update
;
int8_t
cacheLastRow
;
int8_t
streamMode
;
int8_t
singleSTable
;
int8_t
hashMethod
;
// default is 1
int32_t
numOfRetensions
;
SArray
*
pRetensions
;
}
SDbCfg
;
...
...
@@ -283,7 +284,6 @@ typedef struct {
int64_t
uid
;
int32_t
cfgVersion
;
int32_t
vgVersion
;
int8_t
hashMethod
;
// default is 1
SDbCfg
cfg
;
SRWLatch
lock
;
}
SDbObj
;
...
...
source/dnode/mnode/impl/src/mndAuth.c
浏览文件 @
76883aa4
...
...
@@ -146,7 +146,7 @@ int32_t mndCheckFuncAuth(SUserObj *pOperUser) {
int32_t
mndCheckCreateDbAuth
(
SUserObj
*
pOperUser
)
{
return
0
;
}
int32_t
mndCheckAlterDropCompact
Sync
DbAuth
(
SUserObj
*
pOperUser
,
SDbObj
*
pDb
)
{
int32_t
mndCheckAlterDropCompactDbAuth
(
SUserObj
*
pOperUser
,
SDbObj
*
pDb
)
{
if
(
pOperUser
->
superUser
||
strcmp
(
pOperUser
->
user
,
pDb
->
createUser
)
==
0
)
{
return
0
;
}
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
76883aa4
此差异已折叠。
点击以展开。
source/dnode/mnode/impl/src/mndInfoSchema.c
浏览文件 @
76883aa4
...
...
@@ -75,7 +75,7 @@ static const SInfosTableSchema userDBSchema[] = {
{.
name
=
"vgroups"
,
.
bytes
=
2
,
.
type
=
TSDB_DATA_TYPE_SMALLINT
},
{.
name
=
"ntables"
,
.
bytes
=
8
,
.
type
=
TSDB_DATA_TYPE_BIGINT
},
{.
name
=
"replica"
,
.
bytes
=
2
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"
quorum"
,
.
bytes
=
1
,
.
type
=
TSDB_DATA_TYPE_TINYINT
},
{.
name
=
"
strict"
,
.
bytes
=
10
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"days"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
{.
name
=
"keep"
,
.
bytes
=
24
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_VARCHAR
},
{.
name
=
"cache"
,
.
bytes
=
4
,
.
type
=
TSDB_DATA_TYPE_INT
},
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
76883aa4
...
...
@@ -205,7 +205,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
walLevel
=
pDb
->
cfg
.
walLevel
;
createReq
.
precision
=
pDb
->
cfg
.
precision
;
createReq
.
compression
=
pDb
->
cfg
.
compression
;
createReq
.
quorum
=
pDb
->
cfg
.
quorum
;
createReq
.
strict
=
pDb
->
cfg
.
strict
;
createReq
.
update
=
pDb
->
cfg
.
update
;
createReq
.
cacheLastRow
=
pDb
->
cfg
.
cacheLastRow
;
createReq
.
replica
=
pVgroup
->
replica
;
...
...
@@ -213,7 +213,7 @@ void *mndBuildCreateVnodeReq(SMnode *pMnode, SDnodeObj *pDnode, SDbObj *pDb, SVg
createReq
.
streamMode
=
pVgroup
->
streamMode
;
createReq
.
hashBegin
=
pVgroup
->
hashBegin
;
createReq
.
hashEnd
=
pVgroup
->
hashEnd
;
createReq
.
hashMethod
=
pDb
->
hashMethod
;
createReq
.
hashMethod
=
pDb
->
cfg
.
hashMethod
;
createReq
.
numOfRetensions
=
pDb
->
cfg
.
numOfRetensions
;
createReq
.
pRetensions
=
pDb
->
cfg
.
pRetensions
;
...
...
source/dnode/mnode/impl/test/db/db.cpp
浏览文件 @
76883aa4
...
...
@@ -50,7 +50,7 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
@@ -82,7 +82,7 @@ TEST_F(MndTestDb, 02_Create_Alter_Drop_Db) {
alterdbReq
.
daysToKeep2
=
500
;
alterdbReq
.
fsyncPeriod
=
4000
;
alterdbReq
.
walLevel
=
2
;
alterdbReq
.
quorum
=
2
;
alterdbReq
.
strict
=
2
;
alterdbReq
.
cacheLastRow
=
1
;
int32_t
contLen
=
tSerializeSAlterDbReq
(
NULL
,
0
,
&
alterdbReq
);
...
...
@@ -144,7 +144,7 @@ TEST_F(MndTestDb, 03_Create_Use_Restart_Use_Db) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
source/dnode/mnode/impl/test/sma/sma.cpp
浏览文件 @
76883aa4
...
...
@@ -54,7 +54,7 @@ void* MndTestSma::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
source/dnode/mnode/impl/test/stb/stb.cpp
浏览文件 @
76883aa4
...
...
@@ -55,7 +55,7 @@ void* MndTestStb::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
source/dnode/mnode/impl/test/topic/topic.cpp
浏览文件 @
76883aa4
...
...
@@ -47,7 +47,7 @@ void* MndTestTopic::BuildCreateDbReq(const char* dbname, int32_t* pContLen) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
source/dnode/mnode/impl/test/user/user.cpp
浏览文件 @
76883aa4
...
...
@@ -300,7 +300,7 @@ TEST_F(MndTestUser, 03_Alter_User) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
source/dnode/vnode/src/tsdb/tsdbMain.c
浏览文件 @
76883aa4
...
...
@@ -601,26 +601,26 @@ static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg) {
// Check minRowsPerFileBlock and maxRowsPerFileBlock
if (pCfg->minRowsPerFileBlock == -1) {
pCfg->minRowsPerFileBlock = TSDB_DEFAULT_MIN
_ROW
_FBLOCK;
pCfg->minRowsPerFileBlock = TSDB_DEFAULT_MIN
ROWS
_FBLOCK;
} else {
if (pCfg->minRowsPerFileBlock < TSDB_MIN_MIN
_ROW_FBLOCK || pCfg->minRowsPerFileBlock > TSDB_MAX_MIN_ROW
_FBLOCK) {
if (pCfg->minRowsPerFileBlock < TSDB_MIN_MIN
ROWS_FBLOCK || pCfg->minRowsPerFileBlock > TSDB_MAX_MINROWS
_FBLOCK) {
tsdbError(
"vgId:%d invalid minRowsPerFileBlock configuration! minRowsPerFileBlock %d TSDB_MIN_MIN
_ROW
_FBLOCK %d "
"TSDB_MAX_MIN
_ROW
_FBLOCK %d",
pCfg->tsdbId, pCfg->minRowsPerFileBlock, TSDB_MIN_MIN
_ROW_FBLOCK, TSDB_MAX_MIN_ROW
_FBLOCK);
"vgId:%d invalid minRowsPerFileBlock configuration! minRowsPerFileBlock %d TSDB_MIN_MIN
ROWS
_FBLOCK %d "
"TSDB_MAX_MIN
ROWS
_FBLOCK %d",
pCfg->tsdbId, pCfg->minRowsPerFileBlock, TSDB_MIN_MIN
ROWS_FBLOCK, TSDB_MAX_MINROWS
_FBLOCK);
terrno = TSDB_CODE_TDB_INVALID_CONFIG;
return -1;
}
}
if (pCfg->maxRowsPerFileBlock == -1) {
pCfg->maxRowsPerFileBlock = TSDB_DEFAULT_MAX
_ROW
_FBLOCK;
pCfg->maxRowsPerFileBlock = TSDB_DEFAULT_MAX
ROWS
_FBLOCK;
} else {
if (pCfg->maxRowsPerFileBlock < TSDB_MIN_MAX
_ROW_FBLOCK || pCfg->maxRowsPerFileBlock > TSDB_MAX_MAX_ROW
_FBLOCK) {
if (pCfg->maxRowsPerFileBlock < TSDB_MIN_MAX
ROWS_FBLOCK || pCfg->maxRowsPerFileBlock > TSDB_MAX_MAXROWS
_FBLOCK) {
tsdbError(
"vgId:%d invalid maxRowsPerFileBlock configuration! maxRowsPerFileBlock %d TSDB_MIN_MAX
_ROW
_FBLOCK %d "
"TSDB_MAX_MAX
_ROW
_FBLOCK %d",
pCfg->tsdbId, pCfg->maxRowsPerFileBlock, TSDB_MIN_MIN
_ROW_FBLOCK, TSDB_MAX_MIN_ROW
_FBLOCK);
"vgId:%d invalid maxRowsPerFileBlock configuration! maxRowsPerFileBlock %d TSDB_MIN_MAX
ROWS
_FBLOCK %d "
"TSDB_MAX_MAX
ROWS
_FBLOCK %d",
pCfg->tsdbId, pCfg->maxRowsPerFileBlock, TSDB_MIN_MIN
ROWS_FBLOCK, TSDB_MAX_MINROWS
_FBLOCK);
terrno = TSDB_CODE_TDB_INVALID_CONFIG;
return -1;
}
...
...
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
76883aa4
...
...
@@ -108,7 +108,7 @@ void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
createReq
.
precision
=
0
;
createReq
.
compression
=
2
;
createReq
.
replications
=
1
;
createReq
.
quorum
=
1
;
createReq
.
strict
=
1
;
createReq
.
update
=
0
;
createReq
.
cacheLastRow
=
0
;
createReq
.
ignoreExist
=
1
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
76883aa4
...
...
@@ -451,8 +451,8 @@ static SSDataBlock* doBlockInfoScan(SOperatorInfo* pOperator, bool* newgroup) {
STableBlockDistInfo
tableBlockDist
=
{
0
};
tableBlockDist
.
numOfTables
=
1
;
// TODO set the correct number of tables
int32_t
numRowSteps
=
TSDB_DEFAULT_MAX
_ROW
_FBLOCK
/
TSDB_BLOCK_DIST_STEP_ROWS
;
if
(
TSDB_DEFAULT_MAX
_ROW
_FBLOCK
%
TSDB_BLOCK_DIST_STEP_ROWS
!=
0
)
{
int32_t
numRowSteps
=
TSDB_DEFAULT_MAX
ROWS
_FBLOCK
/
TSDB_BLOCK_DIST_STEP_ROWS
;
if
(
TSDB_DEFAULT_MAX
ROWS
_FBLOCK
%
TSDB_BLOCK_DIST_STEP_ROWS
!=
0
)
{
++
numRowSteps
;
}
...
...
source/libs/function/src/taggfunction.c
浏览文件 @
76883aa4
...
...
@@ -4034,8 +4034,8 @@ static void mergeTableBlockDist(SResultRowEntryInfo* pResInfo, const STableBlock
pDist
->
maxRows
=
pSrc
->
maxRows
;
pDist
->
minRows
=
pSrc
->
minRows
;
int32_t
maxSteps
=
TSDB_MAX_MAX
_ROW
_FBLOCK
/
TSDB_BLOCK_DIST_STEP_ROWS
;
if
(
TSDB_MAX_MAX
_ROW
_FBLOCK
%
TSDB_BLOCK_DIST_STEP_ROWS
!=
0
)
{
int32_t
maxSteps
=
TSDB_MAX_MAX
ROWS
_FBLOCK
/
TSDB_BLOCK_DIST_STEP_ROWS
;
if
(
TSDB_MAX_MAX
ROWS
_FBLOCK
%
TSDB_BLOCK_DIST_STEP_ROWS
!=
0
)
{
++
maxSteps
;
}
pDist
->
dataBlockInfos
=
taosArrayInit
(
maxSteps
,
sizeof
(
SFileBlockInfo
));
...
...
source/libs/parser/src/parTranslater.c
浏览文件 @
76883aa4
...
...
@@ -1350,21 +1350,21 @@ static int32_t buildCreateDbReq(STranslateContext* pCxt, SCreateDatabaseStmt* pS
pReq
->
daysToKeep0
=
GET_OPTION_VAL
(
nodesListGetNode
(
pStmt
->
pOptions
->
pKeep
,
0
),
TSDB_DEFAULT_KEEP
);
pReq
->
daysToKeep1
=
GET_OPTION_VAL
(
nodesListGetNode
(
pStmt
->
pOptions
->
pKeep
,
1
),
TSDB_DEFAULT_KEEP
);
pReq
->
daysToKeep2
=
GET_OPTION_VAL
(
nodesListGetNode
(
pStmt
->
pOptions
->
pKeep
,
2
),
TSDB_DEFAULT_KEEP
);
pReq
->
minRows
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pMinRowsPerBlock
,
TSDB_DEFAULT_MIN
_ROW
_FBLOCK
);
pReq
->
maxRows
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pMaxRowsPerBlock
,
TSDB_DEFAULT_MAX
_ROW
_FBLOCK
);
pReq
->
minRows
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pMinRowsPerBlock
,
TSDB_DEFAULT_MIN
ROWS
_FBLOCK
);
pReq
->
maxRows
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pMaxRowsPerBlock
,
TSDB_DEFAULT_MAX
ROWS
_FBLOCK
);
pReq
->
commitTime
=
-
1
;
pReq
->
fsyncPeriod
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pFsyncPeriod
,
TSDB_DEFAULT_FSYNC_PERIOD
);
pReq
->
walLevel
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pWalLevel
,
TSDB_DEFAULT_WAL_LEVEL
);
pReq
->
precision
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pPrecision
,
TSDB_TIME_PRECISION_MILLI
);
pReq
->
compression
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pCompressionLevel
,
TSDB_DEFAULT_COMP_LEVEL
);
pReq
->
replications
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pReplica
,
TSDB_DEFAULT_DB_REPLICA
_OPTION
);
pReq
->
quorum
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pQuorum
,
TSDB_DEFAULT_DB_QUORUM_OPTION
);
pReq
->
replications
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pReplica
,
TSDB_DEFAULT_DB_REPLICA
);
pReq
->
strict
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pQuorum
,
TSDB_DEFAULT_DB_STRICT
);
pReq
->
update
=
-
1
;
pReq
->
cacheLastRow
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pCachelast
,
TSDB_DEFAULT_CACHE_LAST_ROW
);
pReq
->
ignoreExist
=
pStmt
->
ignoreExists
;
pReq
->
streamMode
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pStreamMode
,
TSDB_DEFAULT_DB_STREAM_MODE
_OPTION
);
pReq
->
ttl
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pTtl
,
TSDB_DEFAULT_DB_TTL
_OPTION
);
pReq
->
singleSTable
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pSingleStable
,
TSDB_DEFAULT_DB_SINGLE_STABLE
_OPTION
);
pReq
->
streamMode
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pStreamMode
,
TSDB_DEFAULT_DB_STREAM_MODE
);
pReq
->
ttl
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pTtl
,
TSDB_DEFAULT_DB_TTL
);
pReq
->
singleSTable
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pSingleStable
,
TSDB_DEFAULT_DB_SINGLE_STABLE
);
return
buildCreateDbRetentions
(
pStmt
->
pOptions
->
pRetentions
,
pReq
);
}
...
...
@@ -1431,8 +1431,8 @@ static int32_t checkTtlOption(STranslateContext* pCxt, SValueNode* pVal) {
return
pCxt
->
errCode
;
}
int64_t
val
=
pVal
->
datum
.
i
;
if
(
val
<
TSDB_MIN_DB_TTL
_OPTION
)
{
return
generateDealNodeErrMsg
(
pCxt
,
TSDB_CODE_PAR_INVALID_TTL_OPTION
,
val
,
TSDB_MIN_DB_TTL
_OPTION
);
if
(
val
<
TSDB_MIN_DB_TTL
)
{
return
generateDealNodeErrMsg
(
pCxt
,
TSDB_CODE_PAR_INVALID_TTL_OPTION
,
val
,
TSDB_MIN_DB_TTL
);
}
}
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1539,12 +1539,12 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, SDatabaseOptions* p
code
=
checkRangeOption
(
pCxt
,
"fsyncPeriod"
,
pOptions
->
pFsyncPeriod
,
TSDB_MIN_FSYNC_PERIOD
,
TSDB_MAX_FSYNC_PERIOD
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"maxRowsPerBlock"
,
pOptions
->
pMaxRowsPerBlock
,
TSDB_MIN_MAX
_ROW
_FBLOCK
,
TSDB_MAX_MAX
_ROW
_FBLOCK
);
code
=
checkRangeOption
(
pCxt
,
"maxRowsPerBlock"
,
pOptions
->
pMaxRowsPerBlock
,
TSDB_MIN_MAX
ROWS
_FBLOCK
,
TSDB_MAX_MAX
ROWS
_FBLOCK
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"minRowsPerBlock"
,
pOptions
->
pMinRowsPerBlock
,
TSDB_MIN_MIN
_ROW
_FBLOCK
,
TSDB_MAX_MIN
_ROW
_FBLOCK
);
code
=
checkRangeOption
(
pCxt
,
"minRowsPerBlock"
,
pOptions
->
pMinRowsPerBlock
,
TSDB_MIN_MIN
ROWS
_FBLOCK
,
TSDB_MAX_MIN
ROWS
_FBLOCK
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkKeepOption
(
pCxt
,
pOptions
->
pKeep
);
...
...
@@ -1553,11 +1553,10 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, SDatabaseOptions* p
code
=
checkDbPrecisionOption
(
pCxt
,
pOptions
->
pPrecision
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkRangeOption
(
pCxt
,
"quorum"
,
pOptions
->
pQuorum
,
TSDB_MIN_DB_
QUORUM_OPTION
,
TSDB_MAX_DB_QUORUM_OPTION
);
code
=
checkRangeOption
(
pCxt
,
"quorum"
,
pOptions
->
pQuorum
,
TSDB_MIN_DB_
STRICT
,
TSDB_MAX_DB_STRICT
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbEnumOption
(
pCxt
,
"replications"
,
pOptions
->
pReplica
,
TSDB_MIN_DB_REPLICA_OPTION
,
TSDB_MAX_DB_REPLICA_OPTION
);
code
=
checkDbEnumOption
(
pCxt
,
"replications"
,
pOptions
->
pReplica
,
TSDB_MIN_DB_REPLICA
,
TSDB_MAX_DB_REPLICA
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkTtlOption
(
pCxt
,
pOptions
->
pTtl
);
...
...
@@ -1569,12 +1568,12 @@ static int32_t checkDatabaseOptions(STranslateContext* pCxt, SDatabaseOptions* p
code
=
checkRangeOption
(
pCxt
,
"vgroups"
,
pOptions
->
pNumOfVgroups
,
TSDB_MIN_VNODES_PER_DB
,
TSDB_MAX_VNODES_PER_DB
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbEnumOption
(
pCxt
,
"singleStable"
,
pOptions
->
pSingleStable
,
TSDB_MIN_DB_SINGLE_STABLE
_OPTION
,
TSDB_MAX_DB_SINGLE_STABLE
_OPTION
);
code
=
checkDbEnumOption
(
pCxt
,
"singleStable"
,
pOptions
->
pSingleStable
,
TSDB_MIN_DB_SINGLE_STABLE
,
TSDB_MAX_DB_SINGLE_STABLE
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbEnumOption
(
pCxt
,
"streamMode"
,
pOptions
->
pStreamMode
,
TSDB_MIN_DB_STREAM_MODE_OPTION
,
TSDB_MAX_DB_STREAM_MODE_OPTION
);
code
=
checkDbEnumOption
(
pCxt
,
"streamMode"
,
pOptions
->
pStreamMode
,
TSDB_MIN_DB_STREAM_MODE
,
TSDB_MAX_DB_STREAM_MODE
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
checkDbRetentionsOption
(
pCxt
,
pOptions
->
pRetentions
);
...
...
@@ -1640,7 +1639,7 @@ static void buildAlterDbReq(STranslateContext* pCxt, SAlterDatabaseStmt* pStmt,
pReq
->
daysToKeep2
=
GET_OPTION_VAL
(
nodesListGetNode
(
pStmt
->
pOptions
->
pKeep
,
2
),
-
1
);
pReq
->
fsyncPeriod
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pFsyncPeriod
,
-
1
);
pReq
->
walLevel
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pWalLevel
,
-
1
);
pReq
->
quorum
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pQuorum
,
-
1
);
pReq
->
strict
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pQuorum
,
-
1
);
pReq
->
cacheLastRow
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pCachelast
,
-
1
);
pReq
->
replications
=
GET_OPTION_VAL
(
pStmt
->
pOptions
->
pReplica
,
-
1
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录