Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f2611d08
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看板
未验证
提交
f2611d08
编写于
7月 01, 2021
作者:
H
Haojun Liao
提交者:
GitHub
7月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6705 from taosdata/feature/query
Feature/query
上级
f5ae3389
71367b78
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
23 addition
and
8 deletion
+23
-8
cmake/platform.inc
cmake/platform.inc
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+8
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+9
-6
tests/script/general/parser/nestquery.sim
tests/script/general/parser/nestquery.sim
+2
-0
tests/script/unique/http/admin.sim
tests/script/unique/http/admin.sim
+3
-0
未找到文件。
cmake/platform.inc
浏览文件 @
f2611d08
...
@@ -157,5 +157,5 @@ ELSEIF (${OSTYPE} MATCHES "Alpine")
...
@@ -157,5 +157,5 @@ ELSEIF (${OSTYPE} MATCHES "Alpine")
MESSAGE
(
STATUS
"input osType: Alpine"
)
MESSAGE
(
STATUS
"input osType: Alpine"
)
SET
(
TD_APLHINE
TRUE
)
SET
(
TD_APLHINE
TRUE
)
ELSE
()
ELSE
()
MESSAGE
(
STATUS
"
input osType
unknown: "
$
{
OSTYPE
})
MESSAGE
(
STATUS
"
The user specified osType is
unknown: "
$
{
OSTYPE
})
ENDIF
()
ENDIF
()
src/client/src/tscSQLParser.c
浏览文件 @
f2611d08
...
@@ -73,7 +73,6 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd);
...
@@ -73,7 +73,6 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd);
static
bool
validateTagParams
(
SArray
*
pTagsList
,
SArray
*
pFieldList
,
SSqlCmd
*
pCmd
);
static
bool
validateTagParams
(
SArray
*
pTagsList
,
SArray
*
pFieldList
,
SSqlCmd
*
pCmd
);
static
int32_t
setObjFullName
(
char
*
fullName
,
const
char
*
account
,
SStrToken
*
pDB
,
SStrToken
*
tableName
,
int32_t
*
len
);
static
int32_t
setObjFullName
(
char
*
fullName
,
const
char
*
account
,
SStrToken
*
pDB
,
SStrToken
*
tableName
,
int32_t
*
len
);
static
void
getColumnName
(
tSqlExprItem
*
pItem
,
char
*
resultFieldName
,
char
*
rawName
,
int32_t
nameLength
);
static
void
getColumnName
(
tSqlExprItem
*
pItem
,
char
*
resultFieldName
,
char
*
rawName
,
int32_t
nameLength
);
static
int32_t
addExprAndResultField
(
SSqlCmd
*
pCmd
,
SQueryInfo
*
pQueryInfo
,
int32_t
colIndex
,
tSqlExprItem
*
pItem
,
bool
finalResult
);
static
int32_t
addExprAndResultField
(
SSqlCmd
*
pCmd
,
SQueryInfo
*
pQueryInfo
,
int32_t
colIndex
,
tSqlExprItem
*
pItem
,
bool
finalResult
);
...
@@ -7916,6 +7915,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
...
@@ -7916,6 +7915,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
if
(
validateSessionNode
(
pCmd
,
pQueryInfo
,
pSqlNode
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
validateSessionNode
(
pCmd
,
pQueryInfo
,
pSqlNode
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
}
if
(
isTimeWindowQuery
(
pQueryInfo
))
{
if
(
isTimeWindowQuery
(
pQueryInfo
))
{
// check if the first column of the nest query result is timestamp column
// check if the first column of the nest query result is timestamp column
SColumn
*
pCol
=
taosArrayGetP
(
pQueryInfo
->
colList
,
0
);
SColumn
*
pCol
=
taosArrayGetP
(
pQueryInfo
->
colList
,
0
);
...
@@ -7929,6 +7929,13 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
...
@@ -7929,6 +7929,13 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
}
}
}
}
// parse the having clause in the first place
int32_t
joinQuery
=
(
pSqlNode
->
from
!=
NULL
&&
taosArrayGetSize
(
pSqlNode
->
from
->
list
)
>
1
);
if
(
validateHavingClause
(
pQueryInfo
,
pSqlNode
->
pHaving
,
pCmd
,
pSqlNode
->
pSelNodeList
,
joinQuery
,
timeWindowQuery
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
// set order by info
// set order by info
if
(
validateOrderbyNode
(
pCmd
,
pQueryInfo
,
pSqlNode
,
tscGetTableSchema
(
pTableMeta
))
!=
TSDB_CODE_SUCCESS
)
{
if
(
validateOrderbyNode
(
pCmd
,
pQueryInfo
,
pSqlNode
,
tscGetTableSchema
(
pTableMeta
))
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
TSDB_CODE_TSC_INVALID_OPERATION
;
...
...
src/query/src/qExecutor.c
浏览文件 @
f2611d08
...
@@ -3847,14 +3847,17 @@ int32_t doFillTimeIntervalGapsInResults(SFillInfo* pFillInfo, SSDataBlock *pOutp
...
@@ -3847,14 +3847,17 @@ int32_t doFillTimeIntervalGapsInResults(SFillInfo* pFillInfo, SSDataBlock *pOutp
}
}
void
publishOperatorProfEvent
(
SOperatorInfo
*
operatorInfo
,
EQueryProfEventType
eventType
)
{
void
publishOperatorProfEvent
(
SOperatorInfo
*
operatorInfo
,
EQueryProfEventType
eventType
)
{
SQueryProfEvent
event
;
SQueryProfEvent
event
=
{
0
};
event
.
eventType
=
eventType
;
event
.
eventType
=
eventType
;
event
.
eventTime
=
taosGetTimestampUs
();
event
.
eventTime
=
taosGetTimestampUs
();
event
.
operatorType
=
operatorInfo
->
operatorType
;
event
.
operatorType
=
operatorInfo
->
operatorType
;
SQInfo
*
qInfo
=
operatorInfo
->
pRuntimeEnv
->
qinfo
;
if
(
operatorInfo
->
pRuntimeEnv
)
{
if
(
qInfo
->
summary
.
queryProfEvents
)
{
SQInfo
*
pQInfo
=
operatorInfo
->
pRuntimeEnv
->
qinfo
;
taosArrayPush
(
qInfo
->
summary
.
queryProfEvents
,
&
event
);
if
(
pQInfo
->
summary
.
queryProfEvents
)
{
taosArrayPush
(
pQInfo
->
summary
.
queryProfEvents
,
&
event
);
}
}
}
}
}
...
...
tests/script/general/parser/nestquery.sim
浏览文件 @
f2611d08
...
@@ -424,4 +424,6 @@ if $data01 != 1 then
...
@@ -424,4 +424,6 @@ if $data01 != 1 then
return -1
return -1
endi
endi
sql_error select last_row(*) from (select * from nest_tb0) having c1 > 0
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/http/admin.sim
浏览文件 @
f2611d08
...
@@ -34,6 +34,7 @@ print =============== step1 - login
...
@@ -34,6 +34,7 @@ print =============== step1 - login
system_content curl 127.0.0.1:7111/admin/
system_content curl 127.0.0.1:7111/admin/
print 1-> $system_content
print 1-> $system_content
if $system_content != @{"status":"error","code":4357,"desc":"no auth info input"}@ then
if $system_content != @{"status":"error","code":4357,"desc":"no auth info input"}@ then
print actual: $system_content
return -1
return -1
endi
endi
...
@@ -149,6 +150,8 @@ endi
...
@@ -149,6 +150,8 @@ endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:7111/admin/all
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select * from d1.table_admin' 127.0.0.1:7111/admin/all
print curl 127.0.0.1:7111/admin/all -----> $system_content
print curl 127.0.0.1:7111/admin/all -----> $system_content
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then
print actual: $system_content
print expect =======> {"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}
return -1
return -1
endi
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录