Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
90ad66d5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
90ad66d5
编写于
3月 10, 2021
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compiler error
上级
7e91c54e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
26 addition
and
25 deletion
+26
-25
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/query/inc/qUtil.h
src/query/inc/qUtil.h
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+14
-13
src/query/src/qFill.c
src/query/src/qFill.c
+1
-1
src/query/src/qUtil.c
src/query/src/qUtil.c
+5
-5
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+3
-3
未找到文件。
src/client/src/tscLocalMerge.c
浏览文件 @
90ad66d5
...
...
@@ -970,7 +970,7 @@ static void doFillResult(SSqlObj *pSql, SLocalMerger *pLocalMerge, bool doneOutp
if
(
pQueryInfo
->
limit
.
offset
>
0
)
{
for
(
int32_t
i
=
0
;
i
<
pQueryInfo
->
fieldsInfo
.
numOfOutput
;
++
i
)
{
TAOS_FIELD
*
pField
=
tscFieldInfoGetField
(
&
pQueryInfo
->
fieldsInfo
,
i
);
memmove
(
pResPages
[
i
],
pResPages
[
i
]
+
pField
->
bytes
*
pQueryInfo
->
limit
.
offset
,
memmove
(
pResPages
[
i
],
((
char
*
)
pResPages
[
i
])
+
pField
->
bytes
*
pQueryInfo
->
limit
.
offset
,
(
size_t
)(
newRows
*
pField
->
bytes
));
}
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
90ad66d5
...
...
@@ -2408,7 +2408,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col
getResultDataInfo
(
TSDB_DATA_TYPE_INT
,
4
,
TSDB_FUNC_BLKINFO
,
0
,
&
resType
,
&
bytes
,
&
inter
,
0
,
0
);
s
.
bytes
=
bytes
;
s
.
type
=
resType
;
s
.
type
=
(
uint8_t
)
resType
;
SSqlExpr
*
pExpr
=
tscAddFuncInSelectClause
(
pQueryInfo
,
0
,
TSDB_FUNC_BLKINFO
,
&
index
,
&
s
,
TSDB_COL_TAG
);
pExpr
->
numOfParams
=
1
;
pExpr
->
param
[
0
].
i64
=
pTableMetaInfo
->
pTableMeta
->
tableInfo
.
rowSize
;
...
...
src/query/inc/qUtil.h
浏览文件 @
90ad66d5
...
...
@@ -54,7 +54,7 @@ static FORCE_INLINE SResultRow *getResultRow(SResultRowInfo *pResultRowInfo, int
static
FORCE_INLINE
char
*
getPosInResultPage
(
SQuery
*
pQuery
,
tFilePage
*
page
,
int32_t
rowOffset
,
int16_t
offset
)
{
assert
(
rowOffset
>=
0
&&
pQuery
!=
NULL
);
int32_t
numOfRows
=
GET_ROW_PARAM_FOR_MULTIOUTPUT
(
pQuery
,
pQuery
->
topBotQuery
,
pQuery
->
stableQuery
);
int32_t
numOfRows
=
(
int32_t
)
GET_ROW_PARAM_FOR_MULTIOUTPUT
(
pQuery
,
pQuery
->
topBotQuery
,
pQuery
->
stableQuery
);
return
((
char
*
)
page
->
data
)
+
rowOffset
+
offset
*
numOfRows
;
}
...
...
src/query/src/qExecutor.c
浏览文件 @
90ad66d5
...
...
@@ -232,11 +232,11 @@ static void* destroyOutputBuf(SSDataBlock* pBlock) {
return
NULL
;
}
int
64
_t
getNumOfResult
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
numOfOutput
)
{
int
32
_t
getNumOfResult
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
numOfOutput
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
bool
hasMainFunction
=
hasMainOutput
(
pQuery
);
int
64
_t
maxOutput
=
0
;
int
32
_t
maxOutput
=
0
;
for
(
int32_t
j
=
0
;
j
<
numOfOutput
;
++
j
)
{
int32_t
id
=
pCtx
[
j
].
functionId
;
...
...
@@ -1390,6 +1390,7 @@ static int32_t getGroupbyColumnIndex(SSqlGroupbyExpr *pGroupbyExpr, SSDataBlock*
}
assert
(
0
);
return
-
1
;
}
static
bool
functionNeedToExecute
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
functionId
)
{
...
...
@@ -1584,8 +1585,8 @@ static SQLFunctionCtx* createSQLFunctionCtx(SQueryRuntimeEnv* pRuntimeEnv, SExpr
}
for
(
int32_t
i
=
1
;
i
<
numOfOutput
;
++
i
)
{
(
*
rowCellInfoOffset
)[
i
]
=
(
*
rowCellInfoOffset
)[
i
-
1
]
+
sizeof
(
SResultRowCellInfo
)
+
pExpr
[
i
-
1
].
interBytes
*
GET_ROW_PARAM_FOR_MULTIOUTPUT
(
pQuery
,
pQuery
->
topBotQuery
,
pQuery
->
stableQuery
);
(
*
rowCellInfoOffset
)[
i
]
=
(
int32_t
)((
*
rowCellInfoOffset
)[
i
-
1
]
+
sizeof
(
SResultRowCellInfo
)
+
pExpr
[
i
-
1
].
interBytes
*
GET_ROW_PARAM_FOR_MULTIOUTPUT
(
pQuery
,
pQuery
->
topBotQuery
,
pQuery
->
stableQuery
)
)
;
}
setCtxTagColumnInfo
(
pFuncCtx
,
numOfOutput
);
...
...
@@ -3803,7 +3804,7 @@ static void doDestroyTableQueryInfo(STableGroupInfo* pTableqinfoGroupInfo);
static
UNUSED_FUNC
void
setTableQueryHandle
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
tableIndex
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
int32_t
numOfGroup
=
GET_NUM_OF_TABLEGROUP
(
pRuntimeEnv
);
int32_t
numOfGroup
=
(
int32_t
)
GET_NUM_OF_TABLEGROUP
(
pRuntimeEnv
);
STableQueryInfo
*
pCheckInfo
=
NULL
;
if
(
numOfGroup
==
1
)
{
...
...
@@ -3951,7 +3952,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, SArray* prevResult, void *ts
pQuery
->
stableQuery
=
isSTableQuery
;
pQuery
->
groupbyColumn
=
isGroupbyColumn
(
pQuery
->
pGroupbyExpr
);
pRuntimeEnv
->
groupResInfo
.
totalGroup
=
isSTableQuery
?
GET_NUM_OF_TABLEGROUP
(
pRuntimeEnv
)
:
0
;
pRuntimeEnv
->
groupResInfo
.
totalGroup
=
(
int32_t
)
(
isSTableQuery
?
GET_NUM_OF_TABLEGROUP
(
pRuntimeEnv
)
:
0
)
;
pRuntimeEnv
->
pQuery
=
pQuery
;
pRuntimeEnv
->
pTsBuf
=
pTsBuf
;
...
...
@@ -3986,7 +3987,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, SArray* prevResult, void *ts
}
// create runtime environment
int32_t
numOfTables
=
pQuery
->
tableGroupInfo
.
numOfTables
;
int32_t
numOfTables
=
(
int32_t
)
pQuery
->
tableGroupInfo
.
numOfTables
;
pQInfo
->
summary
.
tableInfoSize
+=
(
numOfTables
*
sizeof
(
STableQueryInfo
));
code
=
setupQueryRuntimeEnv
(
pRuntimeEnv
,
(
int32_t
)
pQuery
->
tableGroupInfo
.
numOfTables
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -4183,11 +4184,11 @@ static SSDataBlock* doBlockInfoScan(void* param) {
STableScanInfo
*
pTableScanInfo
=
pOperator
->
info
;
STableBlockDist
tableBlockDist
=
{
0
};
tableBlockDist
.
numOfTables
=
pOperator
->
pRuntimeEnv
->
tableqinfoGroupInfo
.
numOfTables
;
tableBlockDist
.
numOfTables
=
(
int32_t
)
pOperator
->
pRuntimeEnv
->
tableqinfoGroupInfo
.
numOfTables
;
tableBlockDist
.
dataBlockInfos
=
taosArrayInit
(
512
,
sizeof
(
SFileBlockInfo
));
tsdbGetFileBlocksDistInfo
(
pTableScanInfo
->
pQueryHandle
,
&
tableBlockDist
);
tableBlockDist
.
numOfRowsInMemTable
=
tsdbGetNumOfRowsInMemTable
(
pTableScanInfo
->
pQueryHandle
);
tableBlockDist
.
numOfRowsInMemTable
=
(
int32_t
)
tsdbGetNumOfRowsInMemTable
(
pTableScanInfo
->
pQueryHandle
);
SSDataBlock
*
pBlock
=
&
pTableScanInfo
->
block
;
pBlock
->
info
.
rows
=
1
;
...
...
@@ -4508,7 +4509,7 @@ static SSDataBlock* doLimit(void* param) {
}
if
(
pInfo
->
total
+
pBlock
->
info
.
rows
>=
pInfo
->
limit
)
{
pBlock
->
info
.
rows
=
(
pInfo
->
limit
-
pInfo
->
total
);
pBlock
->
info
.
rows
=
(
int32_t
)
(
pInfo
->
limit
-
pInfo
->
total
);
pInfo
->
total
=
pInfo
->
limit
;
...
...
@@ -4543,7 +4544,7 @@ static SSDataBlock* doOffset(void* param) {
}
else
if
(
pRuntimeEnv
->
currentOffset
>
pBlock
->
info
.
rows
)
{
pRuntimeEnv
->
currentOffset
-=
pBlock
->
info
.
rows
;
}
else
{
int32_t
remain
=
pBlock
->
info
.
rows
-
pRuntimeEnv
->
currentOffset
;
int32_t
remain
=
(
int32_t
)(
pBlock
->
info
.
rows
-
pRuntimeEnv
->
currentOffset
)
;
pBlock
->
info
.
rows
=
remain
;
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
...
...
@@ -4733,7 +4734,7 @@ static SSDataBlock* doFill(void* param) {
SQueryRuntimeEnv
*
pRuntimeEnv
=
pOperator
->
pRuntimeEnv
;
if
(
taosFillHasMoreResults
(
pInfo
->
pFillInfo
))
{
doFillTimeIntervalGapsInResults
(
pInfo
->
pFillInfo
,
pInfo
->
pRes
,
pRuntimeEnv
->
resultInfo
.
capacity
);
doFillTimeIntervalGapsInResults
(
pInfo
->
pFillInfo
,
pInfo
->
pRes
,
(
int32_t
)
pRuntimeEnv
->
resultInfo
.
capacity
);
return
pInfo
->
pRes
;
}
...
...
@@ -4860,7 +4861,7 @@ SOperatorInfo* createMultiTableAggOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SO
pInfo
->
binfo
.
pRes
=
createOutputBuf
(
pExpr
,
numOfOutput
,
(
int32_t
)
tableGroup
);
pInfo
->
binfo
.
pCtx
=
createSQLFunctionCtx
(
pRuntimeEnv
,
pExpr
,
numOfOutput
,
&
pInfo
->
binfo
.
rowCellInfoOffset
);
initResultRowInfo
(
&
pInfo
->
binfo
.
resultRowInfo
,
tableGroup
,
TSDB_DATA_TYPE_INT
);
initResultRowInfo
(
&
pInfo
->
binfo
.
resultRowInfo
,
(
int32_t
)
tableGroup
,
TSDB_DATA_TYPE_INT
);
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
pOperator
->
name
=
"MultiTableAggregate"
;
...
...
src/query/src/qFill.c
浏览文件 @
90ad66d5
...
...
@@ -451,7 +451,7 @@ void taosFillCopyInputDataFromOneFilePage(SFillInfo* pFillInfo, const tFilePage*
assert
(
t
!=
NULL
);
pFillInfo
->
pData
[
i
]
=
t
;
pFillInfo
->
alloc
=
pInput
->
num
;
pFillInfo
->
alloc
=
(
int32_t
)
pInput
->
num
;
}
memcpy
(
pFillInfo
->
pData
[
i
],
data
,
pCol
->
col
.
bytes
*
pInput
->
num
);
...
...
src/query/src/qUtil.c
浏览文件 @
90ad66d5
...
...
@@ -140,7 +140,7 @@ void clearResultRow(SQueryRuntimeEnv *pRuntimeEnv, SResultRow *pResultRow, int16
for
(
int32_t
i
=
0
;
i
<
pRuntimeEnv
->
pQuery
->
numOfOutput
;
++
i
)
{
SResultRowCellInfo
*
pResultInfo
=
&
pResultRow
->
pCellInfo
[
i
];
size
_t
size
=
pRuntimeEnv
->
pQuery
->
pExpr1
[
i
].
bytes
;
int16
_t
size
=
pRuntimeEnv
->
pQuery
->
pExpr1
[
i
].
bytes
;
char
*
s
=
getPosInResultPage
(
pRuntimeEnv
->
pQuery
,
page
,
pResultRow
->
offset
,
offset
);
memset
(
s
,
0
,
size
);
...
...
@@ -596,10 +596,10 @@ void blockDistInfoToBinary(STableBlockDist* pDist, struct SBufferWriter* bw) {
char
*
tmp
=
malloc
(
x
+
2
);
bool
comp
=
false
;
int32_t
len
=
tsCompressString
(
p
,
x
,
1
,
tmp
,
x
,
ONE_STAGE_COMP
,
NULL
,
0
);
int32_t
len
=
tsCompressString
(
p
,
(
int32_t
)
x
,
1
,
tmp
,
(
int32_t
)
x
,
ONE_STAGE_COMP
,
NULL
,
0
);
if
(
len
==
-
1
||
len
>=
x
)
{
// compress failed, do not compress this binary data
comp
=
false
;
len
=
x
;
len
=
(
int32_t
)
x
;
}
else
{
comp
=
true
;
}
...
...
@@ -621,7 +621,7 @@ void blockDistInfoFromBinary(const char* data, int32_t len, STableBlockDist* pDi
pDist
->
numOfFiles
=
tbufReadUint16
(
&
br
);
pDist
->
totalSize
=
tbufReadUint64
(
&
br
);
pDist
->
numOfRowsInMemTable
=
tbufReadUint32
(
&
br
);
int
32
_t
numOfBlocks
=
tbufReadUint64
(
&
br
);
int
64
_t
numOfBlocks
=
tbufReadUint64
(
&
br
);
bool
comp
=
tbufReadUint8
(
&
br
);
uint32_t
compLen
=
tbufReadUint32
(
&
br
);
...
...
@@ -636,7 +636,7 @@ void blockDistInfoFromBinary(const char* data, int32_t len, STableBlockDist* pDi
const
char
*
compStr
=
tbufReadBinary
(
&
br
,
&
actualLen
);
int32_t
orignalLen
=
tsDecompressString
(
compStr
,
compLen
,
1
,
outputBuf
,
originalLen
,
ONE_STAGE_COMP
,
NULL
,
0
);
(
int32_t
)
originalLen
,
ONE_STAGE_COMP
,
NULL
,
0
);
assert
(
orignalLen
==
numOfBlocks
*
sizeof
(
SFileBlockInfo
));
}
else
{
outputBuf
=
(
char
*
)
tbufReadBinary
(
&
br
,
&
originalLen
);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
90ad66d5
...
...
@@ -3201,7 +3201,7 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
goto
_error
;
}
pGroupInfo
->
numOfTables
=
taosArrayGetSize
(
res
);
pGroupInfo
->
numOfTables
=
(
uint32_t
)
taosArrayGetSize
(
res
);
pGroupInfo
->
pGroupList
=
createTableGroup
(
res
,
pTagSchema
,
pColIndex
,
numOfCols
,
skey
);
tsdbDebug
(
"%p no table name/tag condition, all tables belong to one group, numOfTables:%u"
,
tsdb
,
pGroupInfo
->
numOfTables
);
...
...
@@ -3246,7 +3246,7 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
}
END_TRY
doQueryTableList
(
pTable
,
res
,
expr
);
pGroupInfo
->
numOfTables
=
taosArrayGetSize
(
res
);
pGroupInfo
->
numOfTables
=
(
uint32_t
)
taosArrayGetSize
(
res
);
pGroupInfo
->
pGroupList
=
createTableGroup
(
res
,
pTagSchema
,
pColIndex
,
numOfCols
,
skey
);
tsdbDebug
(
"%p stable tid:%d, uid:%"
PRIu64
" query, numOfTables:%u, belong to %"
PRIzu
" groups"
,
tsdb
,
pTable
->
tableId
.
tid
,
...
...
@@ -3326,7 +3326,7 @@ int32_t tsdbGetTableGroupFromIdList(STsdbRepo* tsdb, SArray* pTableIdList, STabl
return
terrno
;
}
pGroupInfo
->
numOfTables
=
taosArrayGetSize
(
group
);
pGroupInfo
->
numOfTables
=
(
uint32_t
)
taosArrayGetSize
(
group
);
if
(
pGroupInfo
->
numOfTables
>
0
)
{
taosArrayPush
(
pGroupInfo
->
pGroupList
,
&
group
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录