Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
79646fff
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,发现更多精彩内容 >>
未验证
提交
79646fff
编写于
7月 31, 2023
作者:
W
wade zhang
提交者:
GitHub
7月 31, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22246 from taosdata/szhou/fix-ts3744
fix: increase condition size
上级
c7fa5ed6
6151b790
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
10 deletion
+18
-10
include/util/tdef.h
include/util/tdef.h
+1
-1
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+17
-9
未找到文件。
include/util/tdef.h
浏览文件 @
79646fff
...
...
@@ -200,7 +200,7 @@ typedef enum ELogicConditionType {
#define TSDB_STREAM_NAME_LEN 193 // it is a null-terminated string
#define TSDB_DB_NAME_LEN 65
#define TSDB_DB_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_DB_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
#define TSDB_PRIVILEDGE_CONDITION_LEN
200
#define TSDB_PRIVILEDGE_CONDITION_LEN
48*1024
#define TSDB_FUNC_NAME_LEN 65
#define TSDB_FUNC_COMMENT_LEN 1024 * 1024
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
79646fff
...
...
@@ -1174,26 +1174,30 @@ static void mndLoopHash(SHashObj *hash, char *priType, SSDataBlock *pBlock, int3
if
(
strcmp
(
"t"
,
value
)
!=
0
)
{
SNode
*
pAst
=
NULL
;
int32_t
sqlLen
=
0
;
char
sql
[
TSDB_EXPLAIN_RESULT_ROW_SIZE
]
=
{
0
};
size_t
bufSz
=
strlen
(
value
)
+
1
;
char
*
sql
=
taosMemoryMalloc
(
bufSz
+
1
);
char
*
obj
=
taosMemoryMalloc
(
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
);
if
(
nodesStringToNode
(
value
,
&
pAst
)
==
0
)
{
nodesNodeToSQL
(
pAst
,
sql
,
TSDB_EXPLAIN_RESULT_ROW_SIZE
,
&
sqlLen
);
if
(
sql
!=
NULL
&&
obj
!=
NULL
&&
nodesStringToNode
(
value
,
&
pAst
)
==
0
)
{
nodesNodeToSQL
(
pAst
,
sql
,
bufSz
,
&
sqlLen
);
nodesDestroyNode
(
pAst
);
}
else
{
sqlLen
=
5
;
sprintf
(
sql
,
"error"
);
}
char
obj
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
obj
,
sql
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
*
numOfRows
,
(
const
char
*
)
obj
,
false
);
taosMemoryFree
(
obj
);
taosMemoryFree
(
sql
);
}
else
{
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
condition
=
taosMemoryMalloc
(
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
)
;
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
*
numOfRows
,
(
const
char
*
)
condition
,
false
);
taosMemoryFree
(
condition
);
}
(
*
numOfRows
)
++
;
...
...
@@ -1242,10 +1246,11 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
condition
=
taosMemoryMalloc
(
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
)
;
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
taosMemoryFree
(
condition
);
numOfRows
++
;
}
...
...
@@ -1276,10 +1281,11 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
condition
=
taosMemoryMalloc
(
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
)
;
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
taosMemoryFree
(
condition
);
numOfRows
++
;
db
=
taosHashIterate
(
pUser
->
readDbs
,
db
);
...
...
@@ -1311,10 +1317,11 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
condition
=
taosMemoryMalloc
(
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
)
;
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
taosMemoryFree
(
condition
);
numOfRows
++
;
db
=
taosHashIterate
(
pUser
->
writeDbs
,
db
);
...
...
@@ -1348,10 +1355,11 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
tableName
,
false
);
char
condition
[
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
}
;
char
*
condition
=
taosMemoryMalloc
(
TSDB_PRIVILEDGE_CONDITION_LEN
+
VARSTR_HEADER_SIZE
)
;
STR_WITH_MAXSIZE_TO_VARSTR
(
condition
,
""
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataSetVal
(
pColInfo
,
numOfRows
,
(
const
char
*
)
condition
,
false
);
taosMemoryFree
(
condition
);
numOfRows
++
;
topic
=
taosHashIterate
(
pUser
->
topics
,
topic
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录