Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fd2d926b
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看板
提交
fd2d926b
编写于
10月 12, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix merge issue
上级
359b8888
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
91 deletion
+6
-91
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-0
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+4
-44
src/query/src/qUtil.c
src/query/src/qUtil.c
+0
-38
tests/examples/c/apitest.c
tests/examples/c/apitest.c
+0
-8
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
fd2d926b
...
...
@@ -47,6 +47,7 @@ typedef enum {
struct
SSqlInfo
;
typedef
void
(
*
__async_cb_func_t
)(
void
*
param
,
TAOS_RES
*
tres
,
int32_t
numOfRows
);
typedef
void
(
*
_freeSqlSupporter
)(
void
**
);
typedef
struct
SNewVgroupInfo
{
...
...
src/client/src/tscSubquery.c
浏览文件 @
fd2d926b
...
...
@@ -876,7 +876,7 @@ bool tscReparseSql(SSqlObj *sql, int32_t code){
tscDebug
(
"0x%"
PRIx64
" retry parse sql and send query, prev error: %s, retry:%d"
,
sql
->
self
,
tstrerror
(
code
),
sql
->
retry
);
tscResetSqlCmd
(
&
sql
->
cmd
,
true
);
tscResetSqlCmd
(
&
sql
->
cmd
,
true
,
sql
->
self
);
code
=
tsParseSql
(
sql
,
true
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
return
false
;
...
...
src/client/src/tscUtil.c
浏览文件 @
fd2d926b
...
...
@@ -102,22 +102,6 @@ int32_t converToStr(char *str, int type, void *buf, int32_t bufSize, int32_t *le
n
=
bufSize
+
2
;
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
n
=
sprintf
(
str
,
"%d"
,
*
(
uint8_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
n
=
sprintf
(
str
,
"%d"
,
*
(
uint16_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_UINT
:
n
=
sprintf
(
str
,
"%u"
,
*
(
uint32_t
*
)
buf
);
break
;
case
TSDB_DATA_TYPE_UBIGINT
:
n
=
sprintf
(
str
,
"%"
PRIu64
,
*
(
uint64_t
*
)
buf
);
break
;
default:
tscError
(
"unsupported type:%d"
,
type
);
return
TSDB_CODE_TSC_INVALID_VALUE
;
...
...
@@ -4028,7 +4012,9 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) {
// todo refactor
tscDebug
(
"0x%"
PRIx64
" all subquery response received, retry"
,
pParentSql
->
self
);
if
(
code
&&
!
((
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
)
&&
pParentSql
->
retry
<
pParentSql
->
maxRetry
))
{
SSqlObj
*
rootObj
=
pParentSql
->
rootObj
;
if
(
code
&&
!
((
code
==
TSDB_CODE_TDB_INVALID_TABLE_ID
||
code
==
TSDB_CODE_VND_INVALID_VGROUP_ID
)
&&
rootObj
->
retry
<
rootObj
->
maxRetry
))
{
pParentSql
->
res
.
code
=
code
;
tscAsyncResultOnError
(
pParentSql
);
...
...
@@ -4048,7 +4034,7 @@ static void tscSubqueryCompleteCallback(void* param, TAOS_RES* tres, int code) {
tstrerror
(
code
),
rootObj
->
retry
);
tscResetSqlCmd
(
&
rootObj
->
cmd
,
true
);
tscResetSqlCmd
(
&
rootObj
->
cmd
,
true
,
rootObj
->
self
);
code
=
tsParseSql
(
rootObj
,
true
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
...
...
@@ -5300,30 +5286,4 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
return
p
;
}
char
*
cloneCurrentDBName
(
SSqlObj
*
pSql
)
{
char
*
p
=
NULL
;
HttpContext
*
pCtx
=
NULL
;
pthread_mutex_lock
(
&
pSql
->
pTscObj
->
mutex
);
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
switch
(
pTscObj
->
from
)
{
case
TAOS_REQ_FROM_HTTP
:
pCtx
=
pSql
->
param
;
if
(
pCtx
&&
pCtx
->
db
[
0
]
!=
'\0'
)
{
char
db
[
TSDB_ACCT_ID_LEN
+
TSDB_DB_NAME_LEN
]
=
{
0
};
int32_t
len
=
sprintf
(
db
,
"%s%s%s"
,
pTscObj
->
acctId
,
TS_PATH_DELIMITER
,
pCtx
->
db
);
assert
(
len
<=
sizeof
(
db
));
p
=
strdup
(
db
);
}
break
;
default:
break
;
}
if
(
p
==
NULL
)
{
p
=
strdup
(
pSql
->
pTscObj
->
db
);
}
pthread_mutex_unlock
(
&
pSql
->
pTscObj
->
mutex
);
return
p
;
}
src/query/src/qUtil.c
浏览文件 @
fd2d926b
...
...
@@ -488,44 +488,6 @@ static int32_t mergeIntoGroupResultImplRv(SQueryRuntimeEnv *pRuntimeEnv, SGroupR
return
TSDB_CODE_SUCCESS
;
}
static
UNUSED_FUNC
int32_t
mergeIntoGroupResultImpl
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
SArray
*
pTableList
,
int32_t
*
rowCellInfoOffset
)
{
bool
ascQuery
=
QUERY_IS_ASC_QUERY
(
pRuntimeEnv
->
pQueryAttr
);
taosArraySort
(
pRuntimeEnv
->
pResultRowArrayList
,
fn
);
}
static
int32_t
mergeIntoGroupResultImplRv
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
uint64_t
groupId
,
int32_t
*
rowCellInfoOffset
)
{
if
(
!
pGroupResInfo
->
ordered
)
{
orderTheResultRows
(
pRuntimeEnv
);
pGroupResInfo
->
ordered
=
true
;
}
if
(
pGroupResInfo
->
pRows
==
NULL
)
{
pGroupResInfo
->
pRows
=
taosArrayInit
(
100
,
POINTER_BYTES
);
}
size_t
len
=
taosArrayGetSize
(
pRuntimeEnv
->
pResultRowArrayList
);
for
(;
pGroupResInfo
->
position
<
len
;
++
pGroupResInfo
->
position
)
{
SResultRowCell
*
pResultRowCell
=
taosArrayGet
(
pRuntimeEnv
->
pResultRowArrayList
,
pGroupResInfo
->
position
);
if
(
pResultRowCell
->
groupId
!=
groupId
)
{
break
;
}
int64_t
num
=
getNumOfResultWindowRes
(
pRuntimeEnv
,
pResultRowCell
->
pRow
,
rowCellInfoOffset
);
if
(
num
<=
0
)
{
continue
;
}
taosArrayPush
(
pGroupResInfo
->
pRows
,
&
pResultRowCell
->
pRow
);
pResultRowCell
->
pRow
->
numOfRows
=
(
uint32_t
)
num
;
}
return
TSDB_CODE_SUCCESS
;
}
int32_t
mergeIntoGroupResult
(
SGroupResInfo
*
pGroupResInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
*
offset
)
{
int64_t
st
=
taosGetTimestampUs
();
...
...
tests/examples/c/apitest.c
浏览文件 @
fd2d926b
...
...
@@ -384,14 +384,6 @@ int main(int argc, char* argv[]) {
printf
(
"*********** verify subscribe ************
\n
"
);
verify_subscribe
(
taos
);
printf
(
"************ verify prepare *************
\n
"
);
verify_prepare
(
taos
);
printf
(
"************ verify prepare2 *************
\n
"
);
verify_prepare2
(
taos
);
printf
(
"************ verify prepare3 *************
\n
"
);
verify_prepare3
(
taos
);
printf
(
"************ verify stream *************
\n
"
);
// verify_stream(taos);
printf
(
"done
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录