Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1de90208
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看板
提交
1de90208
编写于
5月 18, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: test case for alter dnode active code
上级
0e891c5c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
5 deletion
+47
-5
include/util/tdef.h
include/util/tdef.h
+2
-2
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+2
-2
tests/system-test/0-others/information_schema.py
tests/system-test/0-others/information_schema.py
+43
-1
未找到文件。
include/util/tdef.h
浏览文件 @
1de90208
...
...
@@ -267,8 +267,8 @@ typedef enum ELogicConditionType {
#define TSDB_DNODE_CONFIG_LEN 128
#define TSDB_DNODE_VALUE_LEN 256
#define TSDB_ACTIVE_KEY_LEN 109
// history 109:?
#define TSDB_CONN_ACTIVE_KEY_LEN 25
7 // history 257:?
#define TSDB_ACTIVE_KEY_LEN 109
#define TSDB_CONN_ACTIVE_KEY_LEN 25
5
#define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
1de90208
...
...
@@ -1055,8 +1055,8 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
int32_t
vlen
=
strlen
(
cfgReq
.
value
);
if
(
vlen
>
0
&&
((
idx
==
10
&&
vlen
!=
(
TSDB_ACTIVE_KEY_LEN
-
1
))
||
(
idx
==
11
&&
(
vlen
>
(
TSDB_CONN_ACTIVE_KEY_LEN
-
1
)
||
vlen
<
(
TSDB_ACTIVE_KEY_LEN
-
1
)))))
{
mError
(
"dnode:%d, failed to config activeCode since invalid vlen
. conf:%s, val:%s"
,
cfgReq
.
dnodeId
,
cfgReq
.
config
,
cfgReq
.
value
);
mError
(
"dnode:%d, failed to config activeCode since invalid vlen
:%d. conf:%s, val:%s"
,
cfgReq
.
dnodeId
,
vlen
,
cfgReq
.
config
,
cfgReq
.
value
);
terrno
=
TSDB_CODE_INVALID_OPTION
;
return
-
1
;
}
...
...
tests/system-test/0-others/information_schema.py
浏览文件 @
1de90208
...
...
@@ -162,7 +162,48 @@ class TDTestCase:
for
t
in
range
(
2
):
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="NORMAL_TABLE"'
)
tdSql
.
checkEqual
(
20470
,
len
(
tdSql
.
queryResult
))
def
ins_dnodes_check
(
self
):
tdSql
.
execute
(
'drop database if exists db2'
)
tdSql
.
execute
(
'create database if not exists db2 vgroups 1 replica 1'
)
tdSql
.
query
(
f
'select * from information_schema.ins_dnodes'
)
result
=
tdSql
.
queryResult
tdSql
.
checkEqual
(
result
[
0
][
0
],
1
)
tdSql
.
checkEqual
(
result
[
0
][
8
],
""
)
tdSql
.
checkEqual
(
result
[
0
][
9
],
""
)
self
.
str107
=
'Hc7VCc+'
for
t
in
range
(
10
):
self
.
str107
+=
'tP+2soIXpP'
self
.
str108
=
self
.
str107
+
'='
self
.
str109
=
self
.
str108
+
'+'
self
.
str254
=
self
.
str108
+
self
.
str108
+
'0123456789001234567890012345678901234567'
self
.
str255
=
self
.
str254
+
'='
self
.
str510
=
self
.
str255
+
self
.
str255
tdSql
.
error
(
'alter dnode 1 "activeCode" "a"'
)
tdSql
.
error
(
'alter dnode 1 "activeCode" "'
+
self
.
str107
+
'"'
)
tdSql
.
execute
(
'alter all dnodes "activeCode" "'
+
self
.
str108
+
'"'
)
tdSql
.
error
(
'alter dnode 1 "activeCode" "'
+
self
.
str109
+
'"'
)
tdSql
.
error
(
'alter all dnodes "activeCode" "'
+
self
.
str510
+
'"'
)
tdSql
.
query
(
f
'select * from information_schema.ins_dnodes'
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
8
],
self
.
str108
)
tdSql
.
execute
(
'alter dnode 1 "activeCode" ""'
)
tdSql
.
query
(
f
'select active_code,c_active_code from information_schema.ins_dnodes'
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
0
],
""
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
1
],
''
)
tdSql
.
error
(
'alter dnode 1 "cActiveCode" "a"'
)
tdSql
.
error
(
'alter dnode 1 "cActiveCode" "'
+
self
.
str107
+
'"'
)
tdSql
.
execute
(
'alter dnode 1 "cActiveCode" "'
+
self
.
str254
+
'"'
)
tdSql
.
error
(
'alter all dnodes "cActiveCode" "'
+
self
.
str255
+
'"'
)
tdSql
.
error
(
'alter dnode 1 "cActiveCode" "'
+
self
.
str510
+
'"'
)
tdSql
.
query
(
f
'select active_code,c_active_code from information_schema.ins_dnodes'
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
0
],
""
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
1
],
self
.
str254
)
tdSql
.
execute
(
'alter dnode 1 "cActiveCode" "'
+
self
.
str109
+
'"'
)
tdSql
.
query
(
f
'show dnodes'
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
0
],
self
.
str109
)
tdSql
.
execute
(
'alter all dnodes "activeCode" ""'
)
tdSql
.
query
(
f
'select c_active_code from information_schema.ins_dnodes'
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
0
],
''
)
def
run
(
self
):
self
.
prepare_data
()
...
...
@@ -170,6 +211,7 @@ class TDTestCase:
self
.
ins_columns_check
()
# self.ins_col_check_4096()
self
.
ins_stable_check
()
self
.
ins_dnodes_check
()
def
stop
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录