Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3cc8eb09
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看板
提交
3cc8eb09
编写于
1月 08, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add the union support in sql parser: refactor some codes. #1032. [TBASE-1140]
上级
82706e1b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
21 deletion
+16
-21
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+0
-1
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+5
-11
src/client/src/tscSql.c
src/client/src/tscSql.c
+6
-7
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+4
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
3cc8eb09
...
...
@@ -252,7 +252,6 @@ typedef struct {
uint32_t
allocSize
;
char
*
payload
;
int
payloadLen
;
int64_t
globalLimit
;
SQueryInfo
**
pQueryInfo
;
int32_t
numOfClause
;
...
...
src/client/src/tscAsync.c
浏览文件 @
3cc8eb09
...
...
@@ -133,7 +133,7 @@ static void tscProcessAsyncFetchRowsProxy(void *param, TAOS_RES *tres, int numOf
// local reducer has handle this situation during super table non-projection query.
if
(
pCmd
->
command
!=
TSDB_SQL_RETRIEVE_METRIC
)
{
pRes
->
numOfTotal
+=
pRes
->
numOfRows
;
pRes
->
numOfTotal
InCurrentClause
+=
pRes
->
numOfRows
;
}
(
*
pSql
->
fetchFp
)(
param
,
tres
,
numOfRows
);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
3cc8eb09
...
...
@@ -521,18 +521,12 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
pCmd
->
command
=
pQueryInfo1
->
command
;
// if there is only one element, the limit of clause is the limit of global result.
if
(
pCmd
->
numOfClause
==
1
)
{
pCmd
->
globalLimit
=
pQueryInfo1
->
clauseLimit
;
}
else
{
// check the output fields information, column name and column type
pCmd
->
globalLimit
=
-
1
;
for
(
int32_t
i
=
1
;
i
<
pCmd
->
numOfClause
;
++
i
)
{
SQueryInfo
*
pQueryInfo2
=
tscGetQueryInfoDetail
(
pCmd
,
i
);
for
(
int32_t
i
=
1
;
i
<
pCmd
->
numOfClause
;
++
i
)
{
SQueryInfo
*
pQueryInfo2
=
tscGetQueryInfoDetail
(
pCmd
,
i
);
int32_t
ret
=
tscFieldInfoCompare
(
&
pQueryInfo1
->
fieldsInfo
,
&
pQueryInfo2
->
fieldsInfo
);
if
(
ret
!=
0
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
int32_t
ret
=
tscFieldInfoCompare
(
&
pQueryInfo1
->
fieldsInfo
,
&
pQueryInfo2
->
fieldsInfo
);
if
(
ret
!=
0
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg1
);
}
}
...
...
src/client/src/tscSql.c
浏览文件 @
3cc8eb09
...
...
@@ -543,12 +543,12 @@ static void **tscBuildResFromSubqueries(SSqlObj *pSql) {
pRes
->
numOfTotalInCurrentClause
++
;
break
;
}
else
{
// continue retrieve data from vnode
if
(
!
tscHashRemainDataInSubqueryResultSet
(
pSql
))
{
// free all sub sqlobj
}
else
{
// continue retrieve data from vnode
if
(
!
tscHashRemainDataInSubqueryResultSet
(
pSql
))
{
tscTrace
(
"%p at least one subquery exhausted, free all other %d subqueries"
,
pSql
,
pSql
->
numOfSubs
-
1
);
SSubqueryState
*
pState
=
NULL
;
// free all sub sqlobj
for
(
int32_t
i
=
0
;
i
<
pSql
->
numOfSubs
;
++
i
)
{
SSqlObj
*
pChildObj
=
pSql
->
pSubs
[
i
];
if
(
pChildObj
==
NULL
)
{
...
...
@@ -716,7 +716,7 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
}
int
taos_select_db
(
TAOS
*
taos
,
const
char
*
db
)
{
char
sql
[
64
]
;
char
sql
[
256
]
=
{
0
}
;
STscObj
*
pObj
=
(
STscObj
*
)
taos
;
if
(
pObj
==
NULL
||
pObj
->
signature
!=
pObj
)
{
...
...
@@ -724,8 +724,7 @@ int taos_select_db(TAOS *taos, const char *db) {
return
TSDB_CODE_DISCONNECTED
;
}
sprintf
(
sql
,
"use %s"
,
db
);
snprintf
(
sql
,
tListLen
(
sql
),
"use %s"
,
db
);
return
taos_query
(
taos
,
sql
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
3cc8eb09
...
...
@@ -2057,12 +2057,15 @@ void tscTryQueryNextVnode(SSqlObj *pSql, __async_cb_func_t fp) {
// in case of async query, set the callback function
void
*
fp1
=
pSql
->
fp
;
pSql
->
fp
=
fp
;
if
(
fp1
!=
NULL
)
{
assert
(
fp
!=
NULL
);
pSql
->
fp
=
fp
;
}
int32_t
ret
=
tscProcessSql
(
pSql
);
// todo check for failure
// in case of async query, return now
if
(
fp
!=
NULL
)
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录