Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小楼昨夜-听风雨
TDengine
提交
155cbc68
T
TDengine
项目概览
小楼昨夜-听风雨
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
155cbc68
编写于
2月 04, 2021
作者:
H
haojun Liao
提交者:
GitHub
2月 04, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5136 from taosdata/feature/TD-2568
Feature/td 2568
上级
aa09e119
dabf6f95
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
16 deletion
+31
-16
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+6
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+22
-10
src/common/src/tglobal.c
src/common/src/tglobal.c
+2
-4
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+1
-1
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
155cbc68
...
...
@@ -892,7 +892,12 @@ int tscProcessLocalCmd(SSqlObj *pSql) {
SSqlRes
*
pRes
=
&
pSql
->
res
;
if
(
pCmd
->
command
==
TSDB_SQL_CFG_LOCAL
)
{
pRes
->
code
=
(
uint8_t
)
taosCfgDynamicOptions
(
pCmd
->
payload
);
if
(
taosCfgDynamicOptions
(
pCmd
->
payload
))
{
pRes
->
code
=
TSDB_CODE_SUCCESS
;
}
else
{
pRes
->
code
=
TSDB_CODE_COM_INVALID_CFG_MSG
;
}
pRes
->
numOfRows
=
0
;
}
else
if
(
pCmd
->
command
==
TSDB_SQL_DESCRIBE_TABLE
)
{
pRes
->
code
=
(
uint8_t
)
tscProcessDescribeTable
(
pSql
);
}
else
if
(
pCmd
->
command
==
TSDB_SQL_RETRIEVE_EMPTY_RESULT
)
{
...
...
src/client/src/tscSQLParser.c
浏览文件 @
155cbc68
...
...
@@ -129,6 +129,7 @@ static int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo);
static
int32_t
doCheckForStream
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
);
static
int32_t
doCheckForQuery
(
SSqlObj
*
pSql
,
SQuerySQL
*
pQuerySql
,
int32_t
index
);
static
int32_t
exprTreeFromSqlExpr
(
SSqlCmd
*
pCmd
,
tExprNode
**
pExpr
,
const
tSQLExpr
*
pSqlExpr
,
SQueryInfo
*
pQueryInfo
,
SArray
*
pCols
,
int64_t
*
uid
);
static
bool
validateDebugFlag
(
int32_t
flag
);
int16_t
getNewResColId
(
SQueryInfo
*
pQueryInfo
)
{
return
pQueryInfo
->
resColumnId
--
;
...
...
@@ -173,6 +174,16 @@ static uint8_t convertOptr(SStrToken *pToken) {
}
}
static
bool
validateDebugFlag
(
int32_t
v
)
{
const
static
int
validFlag
[]
=
{
131
,
135
,
143
};
for
(
int
i
=
0
;
i
<
tListLen
(
validFlag
);
i
++
)
{
if
(
v
==
validFlag
[
i
])
{
return
true
;
}
}
return
false
;
}
/*
* Used during parsing query sql. Since the query sql usually small in length, error position
* is not needed in the final error message.
...
...
@@ -565,16 +576,16 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
int32_t
numOfToken
=
(
int32_t
)
taosArrayGetSize
(
pMiscInfo
->
a
);
SStrToken
*
t
=
taosArrayGet
(
pMiscInfo
->
a
,
0
);
SStrToken
*
t1
=
taosArrayGet
(
pMiscInfo
->
a
,
1
);
assert
(
numOfToken
>=
1
&&
numOfToken
<=
2
);
SStrToken
*
t
=
taosArrayGet
(
pMiscInfo
->
a
,
0
);
strncpy
(
pCmd
->
payload
,
t
->
z
,
t
->
n
);
if
(
numOfToken
==
2
)
{
SStrToken
*
t1
=
taosArrayGet
(
pMiscInfo
->
a
,
1
);
pCmd
->
payload
[
t
->
n
]
=
' '
;
// add sep
strncpy
(
&
pCmd
->
payload
[
t
->
n
+
1
],
t1
->
z
,
t1
->
n
);
}
break
;
}
return
TSDB_CODE_SUCCESS
;
}
case
TSDB_SQL_CREATE_TABLE
:
{
...
...
@@ -5357,13 +5368,15 @@ int32_t validateLocalConfig(SMiscInfo* pOptions) {
SDNodeDynConfOption
LOCAL_DYNAMIC_CFG_OPTIONS
[
6
]
=
{{
"resetLog"
,
8
},
{
"rpcDebugFlag"
,
12
},
{
"tmrDebugFlag"
,
12
},
{
"cDebugFlag"
,
10
},
{
"uDebugFlag"
,
10
},
{
"debugFlag"
,
9
}};
SStrToken
*
pOptionToken
=
taosArrayGet
(
pOptions
->
a
,
0
);
if
(
numOfToken
==
1
)
{
// reset log does not need value
for
(
int32_t
i
=
0
;
i
<
1
;
++
i
)
{
SDNodeDynConfOption
*
pOption
=
&
LOCAL_DYNAMIC_CFG_OPTIONS
[
i
];
if
((
strncasecmp
(
pOption
->
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
pOption
->
len
==
pOptionToken
->
n
))
{
if
((
pOption
->
len
==
pOptionToken
->
n
)
&&
(
strncasecmp
(
pOption
->
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
))
{
return
TSDB_CODE_SUCCESS
;
}
}
...
...
@@ -5371,15 +5384,14 @@ int32_t validateLocalConfig(SMiscInfo* pOptions) {
SStrToken
*
pValToken
=
taosArrayGet
(
pOptions
->
a
,
1
);
int32_t
val
=
strtol
(
pValToken
->
z
,
NULL
,
10
);
if
(
val
<
131
||
val
>
199
)
{
// options value is out of valid range
if
(
!
validateDebugFlag
(
val
))
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
for
(
int32_t
i
=
1
;
i
<
tListLen
(
LOCAL_DYNAMIC_CFG_OPTIONS
);
++
i
)
{
SDNodeDynConfOption
*
pOption
=
&
LOCAL_DYNAMIC_CFG_OPTIONS
[
i
];
if
((
strncasecmp
(
pOption
->
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
)
&&
(
pOption
->
len
==
pOptionToken
->
n
))
{
// options is valid
if
((
pOption
->
len
==
pOptionToken
->
n
)
&&
(
strncasecmp
(
pOption
->
name
,
pOptionToken
->
z
,
pOptionToken
->
n
)
==
0
))
{
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/common/src/tglobal.c
浏览文件 @
155cbc68
...
...
@@ -273,7 +273,7 @@ bool taosCfgDynamicOptions(char *msg) {
int32_t
vint
=
0
;
paGetToken
(
msg
,
&
option
,
&
olen
);
if
(
olen
==
0
)
return
TSDB_CODE_COM_INVALID_CFG_MSG
;
if
(
olen
==
0
)
return
false
;
;
paGetToken
(
option
+
olen
+
1
,
&
value
,
&
vlen
);
if
(
vlen
==
0
)
...
...
@@ -316,11 +316,9 @@ bool taosCfgDynamicOptions(char *msg) {
}
return
true
;
}
if
(
strncasecmp
(
cfg
->
option
,
"debugFlag"
,
olen
)
==
0
)
{
taosSetAllDebugFlag
();
taosSetAllDebugFlag
();
}
return
true
;
}
...
...
src/query/src/qExecutor.c
浏览文件 @
155cbc68
...
...
@@ -4571,7 +4571,7 @@ static void generateBlockDistResult(STableBlockDist *pTableBlockDist) {
if
(
pTableBlockDist
==
NULL
)
{
return
;
}
int64_t
min
=
INT64_MAX
,
max
=
INT64_MIN
,
avg
=
0
;
int64_t
min
=
0
,
max
=
0
,
avg
=
0
;
SArray
*
blockInfos
=
pTableBlockDist
->
dataBlockInfos
;
int64_t
totalRows
=
0
,
totalBlocks
=
taosArrayGetSize
(
blockInfos
);
for
(
size_t
i
=
0
;
i
<
taosArrayGetSize
(
blockInfos
);
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录