Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
1c253df3
T
TDengine
项目概览
慢慢CG
/
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看板
提交
1c253df3
编写于
2月 01, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2568
上级
d324102f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
56 addition
and
15 deletion
+56
-15
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+6
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+20
-7
src/common/src/tglobal.c
src/common/src/tglobal.c
+29
-6
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+1
-1
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
1c253df3
...
...
@@ -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
浏览文件 @
1c253df3
...
...
@@ -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,18 @@ static uint8_t convertOptr(SStrToken *pToken) {
}
}
static
bool
validateDebugFlag
(
int32_t
v
)
{
const
int
validFlag
[]
=
{
131
,
135
,
143
};
bool
ret
=
false
;
for
(
int
i
=
0
;
i
<
tListLen
(
validFlag
);
i
++
)
{
if
(
v
==
validFlag
[
i
])
{
ret
=
true
;
break
;
}
}
return
ret
;
}
/*
* 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 +578,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
:
{
...
...
@@ -5382,6 +5395,7 @@ 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
)
{
...
...
@@ -5396,8 +5410,7 @@ 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
;
}
...
...
src/common/src/tglobal.c
浏览文件 @
1c253df3
...
...
@@ -258,6 +258,33 @@ void taosSetAllDebugFlag() {
uInfo
(
"all debug flag are set to %d"
,
debugFlag
);
}
}
typedef
struct
{
char
*
name
;
int32_t
len
;
void
*
flag
;
}
SDynCfgLog
;
bool
taosDynCfgDebugFlag
(
const
char
*
str
,
int32_t
slen
,
int32_t
flag
)
{
const
SDynCfgLog
cfgLog
[]
=
{
{
"debugFlag"
,
9
,
NULL
},
{
"monDebugFlag"
,
12
,
&
mDebugFlag
},
{
"vDebugFlag"
,
10
,
&
vDebugFlag
},
{
"mDebugFlag"
,
10
,
&
mDebugFlag
},
{
"cDebugFlag"
,
10
,
&
cDebugFlag
},
{
"httpDebugFlag"
,
13
,
&
httpDebugFlag
},
{
"qDebugflag"
,
10
,
&
qDebugFlag
},
{
"sdbDebugFlag"
,
12
,
&
sdbDebugFlag
},
{
"uDebugFlag"
,
10
,
&
uDebugFlag
},
{
"tsdbDebugFlag"
,
13
,
&
tsdbDebugFlag
},
{
"sDebugflag"
,
10
,
&
sDebugFlag
},
{
"rpcDebugFlag"
,
12
,
&
rpcDebugFlag
},
{
"dDebugFlag"
,
10
,
&
dDebugFlag
},
{
"mqttDebugFlag"
,
13
,
&
mqttDebugFlag
},
{
"wDebugFlag"
,
10
,
&
wDebugFlag
},
{
"tmrDebugFlag"
,
12
,
&
tmrDebugFlag
},
{
"cqDebugFlag"
,
11
,
&
cqDebugFlag
},
};
for
(
int
i
=
0
;
i
<
tListLen
(
cfgLog
);
i
++
)
{
if
(
slen
==
cfgLog
[
i
].
len
&&
strncasecmp
(
cfgLog
[
i
].
name
,
str
,
slen
)
==
0
)
{
if
(
cfgLog
[
i
].
flag
==
NULL
)
{
debugFlag
=
flag
;
taosSetAllDebugFlag
();
}
else
{
*
((
int32_t
*
)(
cfgLog
[
i
].
flag
))
=
flag
;
}
return
true
;
}
}
return
false
;
}
bool
taosCfgDynamicOptions
(
char
*
msg
)
{
char
*
option
,
*
value
;
...
...
@@ -265,7 +292,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
)
...
...
@@ -309,11 +336,7 @@ bool taosCfgDynamicOptions(char *msg) {
return
true
;
}
if
(
strncasecmp
(
cfg
->
option
,
"debugFlag"
,
olen
)
==
0
)
{
taosSetAllDebugFlag
();
}
return
true
;
return
taosDynCfgDebugFlag
(
cfg
->
option
,
olen
,
vint
);
}
if
(
strncasecmp
(
option
,
"resetlog"
,
8
)
==
0
)
{
...
...
src/query/src/qExecutor.c
浏览文件 @
1c253df3
...
...
@@ -4498,7 +4498,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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录