Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8a45eedd
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
8a45eedd
编写于
3月 09, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-2895] merge develop.
上级
66163f96
变更
63
隐藏空白更改
内联
并排
Showing
63 changed file
with
459 addition
and
6185 deletion
+459
-6185
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+0
-24
src/inc/taoserror.h
src/inc/taoserror.h
+1
-1
src/inc/tsdb.h
src/inc/tsdb.h
+7
-12
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+0
-5731
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+43
-96
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+267
-180
tests/script/general/parser/alter.sim
tests/script/general/parser/alter.sim
+1
-1
tests/script/general/parser/alter1.sim
tests/script/general/parser/alter1.sim
+1
-1
tests/script/general/parser/alter_stable.sim
tests/script/general/parser/alter_stable.sim
+1
-1
tests/script/general/parser/auto_create_tb.sim
tests/script/general/parser/auto_create_tb.sim
+1
-1
tests/script/general/parser/between_and.sim
tests/script/general/parser/between_and.sim
+1
-1
tests/script/general/parser/binary_escapeCharacter.sim
tests/script/general/parser/binary_escapeCharacter.sim
+1
-1
tests/script/general/parser/col_arithmetic_operation.sim
tests/script/general/parser/col_arithmetic_operation.sim
+1
-1
tests/script/general/parser/columnValue.sim
tests/script/general/parser/columnValue.sim
+1
-1
tests/script/general/parser/commit.sim
tests/script/general/parser/commit.sim
+1
-1
tests/script/general/parser/create_db.sim
tests/script/general/parser/create_db.sim
+1
-1
tests/script/general/parser/create_mt.sim
tests/script/general/parser/create_mt.sim
+1
-1
tests/script/general/parser/create_tb.sim
tests/script/general/parser/create_tb.sim
+1
-1
tests/script/general/parser/create_tb_with_tag_name.sim
tests/script/general/parser/create_tb_with_tag_name.sim
+1
-1
tests/script/general/parser/dbtbnameValidate.sim
tests/script/general/parser/dbtbnameValidate.sim
+1
-1
tests/script/general/parser/fill.sim
tests/script/general/parser/fill.sim
+1
-1
tests/script/general/parser/fill_stb.sim
tests/script/general/parser/fill_stb.sim
+1
-1
tests/script/general/parser/fill_us.sim
tests/script/general/parser/fill_us.sim
+1
-1
tests/script/general/parser/first_last.sim
tests/script/general/parser/first_last.sim
+1
-1
tests/script/general/parser/function.sim
tests/script/general/parser/function.sim
+1
-1
tests/script/general/parser/groupby.sim
tests/script/general/parser/groupby.sim
+1
-1
tests/script/general/parser/import.sim
tests/script/general/parser/import.sim
+1
-1
tests/script/general/parser/import_file.sim
tests/script/general/parser/import_file.sim
+1
-1
tests/script/general/parser/insert_multiTbl.sim
tests/script/general/parser/insert_multiTbl.sim
+1
-1
tests/script/general/parser/insert_tb.sim
tests/script/general/parser/insert_tb.sim
+1
-1
tests/script/general/parser/interp.sim
tests/script/general/parser/interp.sim
+1
-1
tests/script/general/parser/interp_test.sim
tests/script/general/parser/interp_test.sim
+1
-1
tests/script/general/parser/join.sim
tests/script/general/parser/join.sim
+1
-1
tests/script/general/parser/join_multivnode.sim
tests/script/general/parser/join_multivnode.sim
+1
-1
tests/script/general/parser/lastrow.sim
tests/script/general/parser/lastrow.sim
+1
-1
tests/script/general/parser/limit.sim
tests/script/general/parser/limit.sim
+1
-1
tests/script/general/parser/limit1.sim
tests/script/general/parser/limit1.sim
+1
-1
tests/script/general/parser/limit1_tblocks100.sim
tests/script/general/parser/limit1_tblocks100.sim
+1
-1
tests/script/general/parser/limit2.sim
tests/script/general/parser/limit2.sim
+1
-1
tests/script/general/parser/limit2_tblocks100.sim
tests/script/general/parser/limit2_tblocks100.sim
+1
-1
tests/script/general/parser/mixed_blocks.sim
tests/script/general/parser/mixed_blocks.sim
+1
-1
tests/script/general/parser/nchar.sim
tests/script/general/parser/nchar.sim
+1
-1
tests/script/general/parser/null_char.sim
tests/script/general/parser/null_char.sim
+1
-1
tests/script/general/parser/projection_limit_offset.sim
tests/script/general/parser/projection_limit_offset.sim
+1
-1
tests/script/general/parser/selectResNum.sim
tests/script/general/parser/selectResNum.sim
+1
-1
tests/script/general/parser/select_across_vnodes.sim
tests/script/general/parser/select_across_vnodes.sim
+1
-1
tests/script/general/parser/select_distinct_tag.sim
tests/script/general/parser/select_distinct_tag.sim
+1
-1
tests/script/general/parser/select_from_cache_disk.sim
tests/script/general/parser/select_from_cache_disk.sim
+1
-1
tests/script/general/parser/select_with_tags.sim
tests/script/general/parser/select_with_tags.sim
+1
-1
tests/script/general/parser/set_tag_vals.sim
tests/script/general/parser/set_tag_vals.sim
+1
-1
tests/script/general/parser/single_row_in_tb.sim
tests/script/general/parser/single_row_in_tb.sim
+1
-1
tests/script/general/parser/slimit.sim
tests/script/general/parser/slimit.sim
+1
-1
tests/script/general/parser/slimit1.sim
tests/script/general/parser/slimit1.sim
+1
-1
tests/script/general/parser/slimit_alter_tags.sim
tests/script/general/parser/slimit_alter_tags.sim
+1
-1
tests/script/general/parser/stableOp.sim
tests/script/general/parser/stableOp.sim
+1
-1
tests/script/general/parser/tags_dynamically_specifiy.sim
tests/script/general/parser/tags_dynamically_specifiy.sim
+1
-1
tests/script/general/parser/tags_filter.sim
tests/script/general/parser/tags_filter.sim
+1
-1
tests/script/general/parser/tbnameIn.sim
tests/script/general/parser/tbnameIn.sim
+1
-1
tests/script/general/parser/testSuite.sim
tests/script/general/parser/testSuite.sim
+85
-85
tests/script/general/parser/timestamp.sim
tests/script/general/parser/timestamp.sim
+1
-1
tests/script/general/parser/topbot.sim
tests/script/general/parser/topbot.sim
+1
-1
tests/script/general/parser/union.sim
tests/script/general/parser/union.sim
+1
-1
tests/script/general/parser/where.sim
tests/script/general/parser/where.sim
+1
-1
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
8a45eedd
...
...
@@ -3106,30 +3106,6 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
}
}
static
UNUSED_FUNC
void
transferNcharData
(
SSqlObj
*
pSql
,
int32_t
columnIndex
,
TAOS_FIELD
*
pField
)
{
SSqlRes
*
pRes
=
&
pSql
->
res
;
if
(
pRes
->
tsrow
[
columnIndex
]
!=
NULL
&&
pField
->
type
==
TSDB_DATA_TYPE_NCHAR
)
{
// convert unicode to native code in a temporary buffer extra one byte for terminated symbol
if
(
pRes
->
buffer
[
columnIndex
]
==
NULL
)
{
pRes
->
buffer
[
columnIndex
]
=
malloc
(
pField
->
bytes
+
TSDB_NCHAR_SIZE
);
}
/* string terminated char for binary data*/
memset
(
pRes
->
buffer
[
columnIndex
],
0
,
pField
->
bytes
+
TSDB_NCHAR_SIZE
);
int32_t
length
=
taosUcs4ToMbs
(
pRes
->
tsrow
[
columnIndex
],
pRes
->
length
[
columnIndex
],
pRes
->
buffer
[
columnIndex
]);
if
(
length
>=
0
)
{
pRes
->
tsrow
[
columnIndex
]
=
(
unsigned
char
*
)
pRes
->
buffer
[
columnIndex
];
pRes
->
length
[
columnIndex
]
=
length
;
}
else
{
tscError
(
"%p charset:%s to %s. val:%s convert failed."
,
pSql
,
DEFAULT_UNICODE_ENCODEC
,
tsCharset
,
(
char
*
)
pRes
->
tsrow
[
columnIndex
]);
pRes
->
tsrow
[
columnIndex
]
=
NULL
;
pRes
->
length
[
columnIndex
]
=
0
;
}
}
}
char
*
getArithmeticInputSrc
(
void
*
param
,
const
char
*
name
,
int32_t
colId
)
{
SArithmeticSupport
*
pSupport
=
(
SArithmeticSupport
*
)
param
;
...
...
src/inc/taoserror.h
浏览文件 @
8a45eedd
...
...
@@ -249,7 +249,7 @@ int32_t* taosGetErrno();
#define TSDB_CODE_QRY_IN_EXEC TAOS_DEF_ERROR_CODE(0, 0x0709) //"Multiple retrieval of this query")
#define TSDB_CODE_QRY_TOO_MANY_TIMEWINDOW TAOS_DEF_ERROR_CODE(0, 0x070A) //"Too many time window in query")
#define TSDB_CODE_QRY_NOT_ENOUGH_BUFFER TAOS_DEF_ERROR_CODE(0, 0x070B) //"Query buffer limit has reached")
#define TSDB_CODE_QRY_INCONSISTAN TAOS_DEF_ERROR_CODE(0, 0x070C) //"File inconsist
ance
in replica")
#define TSDB_CODE_QRY_INCONSISTAN TAOS_DEF_ERROR_CODE(0, 0x070C) //"File inconsist
ency
in replica")
// grant
...
...
src/inc/tsdb.h
浏览文件 @
8a45eedd
...
...
@@ -158,13 +158,18 @@ int32_t tsdbInsertData(STsdbRepo *repo, SSubmitMsg *pMsg, SShellSubmitRspMsg *pR
typedef
void
*
TsdbQueryHandleT
;
// Use void to hide implementation details
// query condition to build vnode iterator
#define BLOCK_LOAD_OFFSET_SEQ_ORDER 1
#define BLOCK_LOAD_TABLE_SEQ_ORDER 2
#define BLOCK_LOAD_TABLE_RR_ORDER 3
// query condition to build multi-table data block iterator
typedef
struct
STsdbQueryCond
{
STimeWindow
twindow
;
int32_t
order
;
// desc|asc order to iterate the data block
int32_t
numOfCols
;
SColumnInfo
*
colList
;
bool
loadExternalRows
;
// load external rows or not
int32_t
type
;
// data block load type:
}
STsdbQueryCond
;
typedef
struct
SMemRef
{
...
...
@@ -266,17 +271,7 @@ int64_t tsdbGetNumOfRowsInMemTable(TsdbQueryHandleT* pHandle);
* @param pQueryHandle
* @return
*/
bool
tsdbNextDataBlock
(
TsdbQueryHandleT
*
pQueryHandle
);
/**
* move to next block if exists but not merge data in memtable
*
* @param pQueryHandle
* @return
*/
bool
tsdbNextDataBlockWithoutMerge
(
TsdbQueryHandleT
*
pQueryHandle
);
SArray
*
tsdbGetExternalRow
(
TsdbQueryHandleT
*
pHandle
,
SDataBlockInfo
*
blockInfo
);
bool
tsdbNextDataBlock
(
TsdbQueryHandleT
pQueryHandle
);
/**
* Get current data block information
...
...
src/kit/taosdemo/taosdemo.c
已删除
100644 → 0
浏览文件 @
66163f96
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
src/query/src/qExecutor.c
浏览文件 @
8a45eedd
...
...
@@ -161,7 +161,7 @@ static bool isFixedOutputQuery(SQuery* pQuery);
static
SOperatorInfo
*
createDataBlocksOptScanInfo
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
repeatTime
,
int32_t
reverseTime
);
static
SOperatorInfo
*
createTableScanOperator
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
repeatTime
);
static
SOperatorInfo
*
createTableSeqScanOperator
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
bool
loadExternalRows
);
static
SOperatorInfo
*
createTableSeqScanOperator
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
);
static
SOperatorInfo
*
createAggregateOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
static
SOperatorInfo
*
createArithOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
...
...
@@ -227,47 +227,6 @@ static void* destroyOutputBuf(SSDataBlock* pBlock) {
return
NULL
;
}
bool
doFilterData
(
SQuery
*
pQuery
,
int32_t
elemPos
)
{
for
(
int32_t
k
=
0
;
k
<
pQuery
->
numOfFilterCols
;
++
k
)
{
SSingleColumnFilterInfo
*
pFilterInfo
=
&
pQuery
->
pFilterInfo
[
k
];
char
*
pElem
=
(
char
*
)
pFilterInfo
->
pData
+
pFilterInfo
->
info
.
bytes
*
elemPos
;
bool
qualified
=
false
;
for
(
int32_t
j
=
0
;
j
<
pFilterInfo
->
numOfFilters
;
++
j
)
{
SColumnFilterElem
*
pFilterElem
=
&
pFilterInfo
->
pFilters
[
j
];
bool
isnull
=
isNull
(
pElem
,
pFilterInfo
->
info
.
type
);
if
(
isnull
)
{
if
(
pFilterElem
->
fp
==
isNullOperator
)
{
qualified
=
true
;
break
;
}
else
{
continue
;
}
}
else
{
if
(
pFilterElem
->
fp
==
notNullOperator
)
{
qualified
=
true
;
break
;
}
else
if
(
pFilterElem
->
fp
==
isNullOperator
)
{
continue
;
}
}
if
(
pFilterElem
->
fp
(
pFilterElem
,
pElem
,
pElem
,
pFilterInfo
->
info
.
type
))
{
qualified
=
true
;
break
;
}
}
if
(
!
qualified
)
{
return
false
;
}
}
return
true
;
}
int64_t
getNumOfResult
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SQLFunctionCtx
*
pCtx
,
int32_t
numOfOutput
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
bool
hasMainFunction
=
hasMainOutput
(
pQuery
);
...
...
@@ -2448,21 +2407,23 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa
SQInfo
*
pQInfo
=
pRuntimeEnv
->
qinfo
;
SQueryCostInfo
*
pCost
=
&
pQInfo
->
summary
;
if
(
pRuntimeEnv
->
pTsBuf
!=
NULL
&&
pQuery
->
stableQuery
)
{
SExprInfo
*
pExprInfo
=
&
pTableScanInfo
->
pExpr
[
0
];
int16_t
tagId
=
(
int16_t
)
pExprInfo
->
base
.
arg
->
argValue
.
i64
;
SColumnInfo
*
pColInfo
=
doGetTagColumnInfoById
(
pQuery
->
tagColList
,
pQuery
->
numOfTags
,
tagId
);
// compare tag first
tVariant
t
=
{
0
};
doSetTagValueInParam
(
pQuery
->
current
->
pTable
,
tagId
,
&
t
,
pColInfo
->
type
,
pColInfo
->
bytes
);
if
(
pRuntimeEnv
->
pTsBuf
!=
NULL
)
{
*
status
=
BLK_DATA_ALL_NEEDED
;
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pTsBuf
);
if
(
tsBufIsValidElem
(
&
elem
)
&&
tVariantCompare
(
&
t
,
elem
.
tag
)
==
0
)
{
*
status
=
BLK_DATA_ALL_NEEDED
;
}
else
{
(
*
status
)
=
BLK_DATA_DISCARD
;
return
TSDB_CODE_SUCCESS
;
if
(
pQuery
->
stableQuery
)
{
SExprInfo
*
pExprInfo
=
&
pTableScanInfo
->
pExpr
[
0
];
int16_t
tagId
=
(
int16_t
)
pExprInfo
->
base
.
arg
->
argValue
.
i64
;
SColumnInfo
*
pColInfo
=
doGetTagColumnInfoById
(
pQuery
->
tagColList
,
pQuery
->
numOfTags
,
tagId
);
// compare tag first
tVariant
t
=
{
0
};
doSetTagValueInParam
(
pQuery
->
current
->
pTable
,
tagId
,
&
t
,
pColInfo
->
type
,
pColInfo
->
bytes
);
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pTsBuf
);
if
(
!
tsBufIsValidElem
(
&
elem
)
||
(
tsBufIsValidElem
(
&
elem
)
&&
(
tVariantCompare
(
&
t
,
elem
.
tag
)
!=
0
)))
{
(
*
status
)
=
BLK_DATA_DISCARD
;
return
TSDB_CODE_SUCCESS
;
}
}
}
...
...
@@ -3870,7 +3831,7 @@ static int compareBlockInfo(const void *pLeft, const void *pRight) {
static
void
doDestroyTableQueryInfo
(
STableGroupInfo
*
pTableqinfoGroupInfo
);
static
void
setTableQueryHandle
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
tableIndex
)
{
static
UNUSED_FUNC
void
setTableQueryHandle
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
tableIndex
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
int32_t
numOfGroup
=
GET_NUM_OF_TABLEGROUP
(
pRuntimeEnv
);
...
...
@@ -3920,12 +3881,15 @@ static int32_t setupQueryHandle(void* tsdb, SQInfo* pQInfo, bool isSTableQuery)
// TODO set the tags scan handle
if
(
onlyQueryTags
(
pQuery
))
{
return
TSDB_CODE_SUCCESS
;
}
else
if
(
isTsCompQuery
(
pQuery
))
{
setTableQueryHandle
(
pRuntimeEnv
,
0
);
return
terrno
;
//
} else if (isTsCompQuery(pQuery)) {
//
setTableQueryHandle(pRuntimeEnv, 0);
//
return terrno;
}
STsdbQueryCond
cond
=
createTsdbQueryCond
(
pQuery
,
&
pQuery
->
window
);
if
(
isTsCompQuery
(
pQuery
)
||
isPointInterpoQuery
(
pQuery
))
{
cond
.
type
=
BLOCK_LOAD_TABLE_SEQ_ORDER
;
}
if
(
!
isSTableQuery
&&
(
pRuntimeEnv
->
tableqinfoGroupInfo
.
numOfTables
==
1
)
...
...
@@ -4034,7 +3998,7 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, SArray* prevResult, void *ts
}
else
if
(
pQuery
->
queryBlockDist
)
{
pRuntimeEnv
->
pTableScanner
=
createTableBlockInfoScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
);
}
else
if
(
isTsCompQuery
(
pQuery
)
||
isPointInterpoQuery
(
pQuery
))
{
pRuntimeEnv
->
pTableScanner
=
createTableSeqScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
,
isPointInterpoQuery
(
pQuery
)
);
pRuntimeEnv
->
pTableScanner
=
createTableSeqScanOperator
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
);
}
else
if
(
needReverseScan
(
pQuery
))
{
pRuntimeEnv
->
pTableScanner
=
createDataBlocksOptScanInfo
(
pRuntimeEnv
->
pQueryHandle
,
pRuntimeEnv
,
getNumOfScanTimes
(
pQuery
),
1
);
}
else
{
...
...
@@ -4095,6 +4059,7 @@ STsdbQueryCond createTsdbQueryCond(SQuery* pQuery, STimeWindow* win) {
.
colList
=
pQuery
->
colList
,
.
order
=
pQuery
->
order
.
order
,
.
numOfCols
=
pQuery
->
numOfCols
,
.
type
=
BLOCK_LOAD_OFFSET_SEQ_ORDER
,
.
loadExternalRows
=
false
,
};
...
...
@@ -4173,27 +4138,9 @@ static SSDataBlock* doTableScanImpl(STableScanInfo *pTableScanInfo) {
continue
;
}
if
(
pTableScanInfo
->
loadExternalRows
)
{
pTableScanInfo
->
externalLoaded
=
true
;
}
return
pBlock
;
}
if
(
pTableScanInfo
->
loadExternalRows
&&
(
!
pTableScanInfo
->
externalLoaded
))
{
pBlock
->
pDataBlock
=
tsdbGetExternalRow
(
pTableScanInfo
->
pQueryHandle
,
&
pBlock
->
info
);
pTableScanInfo
->
externalLoaded
=
true
;
if
(
pBlock
->
pDataBlock
!=
NULL
)
{
STableQueryInfo
**
pTableQueryInfo
=
(
STableQueryInfo
**
)
taosHashGet
(
pTableGroupInfo
->
map
,
&
pBlock
->
info
.
tid
,
sizeof
(
pBlock
->
info
.
tid
));
assert
(
*
pTableQueryInfo
!=
NULL
);
pQuery
->
current
=
*
pTableQueryInfo
;
}
return
(
pBlock
->
pDataBlock
!=
NULL
)
?
pBlock
:
NULL
;
}
return
NULL
;
}
...
...
@@ -4273,25 +4220,26 @@ static SSDataBlock* doSeqTableBlocksScan(void* param) {
SOperatorInfo
*
pOperator
=
(
SOperatorInfo
*
)
param
;
STableScanInfo
*
pTableScanInfo
=
pOperator
->
info
;
SQueryRuntimeEnv
*
pRuntimeEnv
=
pTableScanInfo
->
pRuntimeEnv
;
//
SQueryRuntimeEnv *pRuntimeEnv = pTableScanInfo->pRuntimeEnv;
int32_t
totalTables
=
pRuntimeEnv
->
tableqinfoGroupInfo
.
numOfTables
;
//
int32_t totalTables = pRuntimeEnv->tableqinfoGroupInfo.numOfTables;
while
(
1
)
{
SSDataBlock
*
p
=
doTableScanImpl
(
pTableScanInfo
);
if
(
p
!=
NULL
)
{
return
p
;
}
// while (1) {
return
doTableScanImpl
(
pTableScanInfo
);
// SSDataBlock* p = doTableScanImpl(pTableScanInfo);
// if (p != NULL) {
// return p;
// }
// try the next table
if
(
++
pTableScanInfo
->
tableIndex
>=
totalTables
)
{
return
NULL
;
}
setTableQueryHandle
(
pRuntimeEnv
,
pTableScanInfo
->
tableIndex
);
pTableScanInfo
->
pQueryHandle
=
pRuntimeEnv
->
pQueryHandle
;
pTableScanInfo
->
externalLoaded
=
false
;
}
//
if (++pTableScanInfo->tableIndex >= totalTables) {
//
return NULL;
//
}
//
//
setTableQueryHandle(pRuntimeEnv, pTableScanInfo->tableIndex);
//
pTableScanInfo->pQueryHandle = pRuntimeEnv->pQueryHandle;
//
pTableScanInfo->externalLoaded = false;
//
}
}
static
SSDataBlock
*
doBlockInfoScan
(
void
*
param
)
{
...
...
@@ -4354,7 +4302,7 @@ SOperatorInfo* createTableScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv*
return
pOperator
;
}
SOperatorInfo
*
createTableSeqScanOperator
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
bool
loadExternalRows
)
{
SOperatorInfo
*
createTableSeqScanOperator
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
)
{
STableScanInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
STableScanInfo
));
pInfo
->
pQueryHandle
=
pTsdbQueryHandle
;
...
...
@@ -4363,7 +4311,6 @@ SOperatorInfo* createTableSeqScanOperator(void* pTsdbQueryHandle, SQueryRuntimeE
pInfo
->
order
=
pRuntimeEnv
->
pQuery
->
order
.
order
;
pInfo
->
current
=
0
;
pInfo
->
pRuntimeEnv
=
pRuntimeEnv
;
pInfo
->
loadExternalRows
=
loadExternalRows
;
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
pOperator
->
name
=
"TableSeqScanOperator"
;
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
8a45eedd
...
...
@@ -34,11 +34,9 @@
.tid = (_checkInfo)->tableId.tid, \
.uid = (_checkInfo)->tableId.uid})
enum
{
TSDB_QUERY_TYPE_ALL
=
1
,
TSDB_QUERY_TYPE_LAST
=
2
,
TSDB_QUERY_TYPE_EXTERNAL
=
3
,
};
typedef
struct
SQueryFilePos
{
...
...
@@ -68,7 +66,7 @@ typedef struct STableCheckInfo {
STableId
tableId
;
TSKEY
lastKey
;
STable
*
pTableObj
;
SBlockInfo
*
pCompInfo
;
SBlockInfo
*
pCompInfo
;
int32_t
compSize
;
int32_t
numOfBlocks
:
29
;
// number of qualified data blocks not the original blocks
int8_t
chosen
:
2
;
// indicate which iterator should move forward
...
...
@@ -111,6 +109,8 @@ typedef struct STsdbQueryHandle {
bool
checkFiles
;
// check file stage
bool
cachelastrow
;
// check if last row cached
bool
loadExternalRow
;
// load time window external data rows
bool
currentLoadExternalRows
;
// current load external rows
int32_t
loadType
;
// block load type
void
*
qinfo
;
// query info handle, for debug purpose
int32_t
type
;
// query type: retrieve all data blocks, 2. retrieve only last row, 3. retrieve direct prev|next rows
SDFileSet
*
pFileGroup
;
...
...
@@ -147,6 +147,8 @@ static int32_t tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey,
static
int32_t
tsdbCheckInfoCompar
(
const
void
*
key1
,
const
void
*
key2
);
static
int32_t
doGetExternalRow
(
STsdbQueryHandle
*
pQueryHandle
,
int16_t
type
,
SMemRef
*
pMemRef
);
static
void
*
doFreeColumnInfoData
(
SArray
*
pColumnInfoData
);
static
void
*
destroyTableCheckInfo
(
SArray
*
pTableCheckInfo
);
static
bool
tsdbGetExternalRow
(
TsdbQueryHandleT
pHandle
);
static
void
tsdbInitDataBlockLoadInfo
(
SDataBlockLoadInfo
*
pBlockLoadInfo
)
{
pBlockLoadInfo
->
slot
=
-
1
;
...
...
@@ -297,12 +299,10 @@ static SArray* createCheckInfoFromTableGroup(STsdbQueryHandle* pQueryHandle, STa
for
(
int32_t
i
=
0
;
i
<
gsize
;
++
i
)
{
STableCheckInfo
*
pInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pTableCheckInfo
,
i
);
taosArrayPush
(
pTable
,
&
pInfo
->
pTableObj
);
}
*
psTable
=
pTable
;
return
pTableCheckInfo
;
}
...
...
@@ -326,28 +326,18 @@ static void resetCheckInfo(STsdbQueryHandle* pQueryHandle) {
}
}
static
SArray
*
createCheckInfoFromCheckInfo
(
SArray
*
pTableCheckInfo
,
TSKEY
skey
,
SArray
**
psTable
)
{
size_t
si
=
taosArrayGetSize
(
pTableCheckInfo
);
SArray
*
pNew
=
taosArrayInit
(
si
,
sizeof
(
STableCheckInfo
));
if
(
pNew
==
NULL
)
{
return
NULL
;
}
SArray
*
pTable
=
taosArrayInit
(
si
,
sizeof
(
STable
*
));
// only one table, not need to sort again
static
SArray
*
createCheckInfoFromCheckInfo
(
STableCheckInfo
*
pCheckInfo
,
TSKEY
skey
,
SArray
**
psTable
)
{
SArray
*
pNew
=
taosArrayInit
(
1
,
sizeof
(
STableCheckInfo
));
SArray
*
pTable
=
taosArrayInit
(
1
,
sizeof
(
STable
*
));
for
(
int32_t
j
=
0
;
j
<
si
;
++
j
)
{
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pTableCheckInfo
,
j
);
STableCheckInfo
info
=
{
.
lastKey
=
skey
,
.
pTableObj
=
pCheckInfo
->
pTableObj
};
STableCheckInfo
info
=
{
.
lastKey
=
skey
,
.
pTableObj
=
pCheckInfo
->
pTableObj
};
info
.
tableId
=
pCheckInfo
->
tableId
;
taosArrayPush
(
pNew
,
&
info
);
taosArrayPush
(
pTable
,
&
pCheckInfo
->
pTableObj
);
}
info
.
tableId
=
pCheckInfo
->
tableId
;
taosArrayPush
(
pNew
,
&
info
);
taosArrayPush
(
pTable
,
&
pCheckInfo
->
pTableObj
);
*
psTable
=
pTable
;
// it is ordered already, no need to sort again.
taosArraySort
(
pNew
,
tsdbCheckInfoCompar
);
return
pNew
;
}
...
...
@@ -371,14 +361,15 @@ static STsdbQueryHandle* tsdbQueryTablesImpl(STsdbRepo* tsdb, STsdbQueryCond* pC
pQueryHandle
->
locateStart
=
false
;
pQueryHandle
->
pMemRef
=
pMemRef
;
pQueryHandle
->
loadExternalRow
=
pCond
->
loadExternalRows
;
pQueryHandle
->
currentLoadExternalRows
=
pCond
->
loadExternalRows
;
pQueryHandle
->
loadType
=
pCond
->
type
;
if
(
tsdbInitReadH
(
&
pQueryHandle
->
rhelper
,
(
STsdbRepo
*
)
tsdb
)
!=
0
)
{
goto
out_of_memory
;
}
//tsdbMayTakeMemSnapshot(pQueryHandle);
assert
(
pCond
!=
NULL
&&
pCond
->
numOfCols
>
0
&&
pMemRef
!=
NULL
);
if
(
ASCENDING_TRAVERSE
(
pCond
->
order
))
{
assert
(
pQueryHandle
->
window
.
skey
<=
pQueryHandle
->
window
.
ekey
);
}
else
{
...
...
@@ -510,6 +501,9 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon
SArray
*
pTable
=
NULL
;
STsdbMeta
*
pMeta
=
tsdbGetMeta
(
pQueryHandle
->
pTsdb
);
pQueryHandle
->
pTableCheckInfo
=
destroyTableCheckInfo
(
pQueryHandle
->
pTableCheckInfo
);
pQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromTableGroup
(
pQueryHandle
,
groupList
,
pMeta
,
&
pTable
);
if
(
pQueryHandle
->
pTableCheckInfo
==
NULL
)
{
tsdbCleanupQueryHandle
(
pQueryHandle
);
...
...
@@ -556,12 +550,45 @@ SArray* tsdbGetQueriedTableList(TsdbQueryHandleT *pHandle) {
return
res
;
}
// leave only one table for each group
static
STableGroupInfo
*
trimTableGroup
(
STimeWindow
*
window
,
STableGroupInfo
*
pGroupList
)
{
assert
(
pGroupList
);
size_t
numOfGroup
=
taosArrayGetSize
(
pGroupList
->
pGroupList
);
STableGroupInfo
*
pNew
=
calloc
(
1
,
sizeof
(
STableGroupInfo
));
pNew
->
pGroupList
=
taosArrayInit
(
numOfGroup
,
sizeof
(
SArray
));
for
(
int32_t
i
=
0
;
i
<
numOfGroup
;
++
i
)
{
SArray
*
oneGroup
=
taosArrayGetP
(
pGroupList
->
pGroupList
,
i
);
size_t
numOfTables
=
taosArrayGetSize
(
oneGroup
);
SArray
*
px
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
for
(
int32_t
j
=
0
;
j
<
numOfTables
;
++
j
)
{
STableKeyInfo
*
pInfo
=
(
STableKeyInfo
*
)
taosArrayGet
(
oneGroup
,
j
);
if
(
window
->
skey
<=
pInfo
->
lastKey
&&
((
STable
*
)
pInfo
->
pTable
)
->
lastKey
!=
TSKEY_INITIAL_VAL
)
{
taosArrayPush
(
px
,
pInfo
);
pNew
->
numOfTables
+=
1
;
break
;
}
}
// there are no data in this group
if
(
taosArrayGetSize
(
px
)
==
0
)
{
taosArrayDestroy
(
px
);
}
else
{
taosArrayPush
(
pNew
->
pGroupList
,
&
px
);
}
}
return
pNew
;
}
TsdbQueryHandleT
tsdbQueryRowsInExternalWindow
(
STsdbRepo
*
tsdb
,
STsdbQueryCond
*
pCond
,
STableGroupInfo
*
groupList
,
void
*
qinfo
,
SMemRef
*
pRef
)
{
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
tsdbQueryTables
(
tsdb
,
pCond
,
groupList
,
qinfo
,
pRef
);
STableGroupInfo
*
pNew
=
trimTableGroup
(
&
pCond
->
twindow
,
groupList
);
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
tsdbQueryTables
(
tsdb
,
pCond
,
pNew
,
qinfo
,
pRef
);
pQueryHandle
->
loadExternalRow
=
true
;
if
(
pQueryHandle
!=
NULL
)
{
changeQueryHandleForInterpQuery
(
pQueryHandle
);
}
pQueryHandle
->
currentLoadExternalRows
=
true
;
return
pQueryHandle
;
}
...
...
@@ -856,77 +883,94 @@ static int32_t binarySearchForBlock(SBlock* pBlock, int32_t numOfBlocks, TSKEY s
return
midSlot
;
}
static
int32_t
getFileCompInfo
(
STsdbQueryHandle
*
pQueryHandle
,
int32_t
*
numOfBlocks
)
{
// load all the comp offset value for all tables in this file
int32_t
code
=
TSDB_CODE_SUCCESS
;
static
int32_t
loadBlockInfo
(
STsdbQueryHandle
*
pQueryHandle
,
int32_t
index
,
int32_t
*
numOfBlocks
)
{
int32_t
code
=
0
;
*
numOfBlocks
=
0
;
size_t
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
)
;
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
index
)
;
pCheckInfo
->
numOfBlocks
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfTables
;
++
i
)
{
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
i
);
pCheckInfo
->
numOfBlocks
=
0
;
if
(
tsdbSetReadTable
(
&
pQueryHandle
->
rhelper
,
pCheckInfo
->
pTableObj
)
!=
TSDB_CODE_SUCCESS
)
{
code
=
terrno
;
return
code
;
}
if
(
tsdbSetReadTable
(
&
pQueryHandle
->
rhelper
,
pCheckInfo
->
pTableObj
)
!=
TSDB_CODE_SUCCESS
)
{
code
=
terrno
;
break
;
}
SBlockIdx
*
compIndex
=
pQueryHandle
->
rhelper
.
pBlkIdx
;
SBlockIdx
*
compIndex
=
pQueryHandle
->
rhelper
.
pBlkIdx
;
// no data block in this file, try next file
if
(
compIndex
==
NULL
||
compIndex
->
uid
!=
pCheckInfo
->
tableId
.
uid
)
{
return
0
;
// no data blocks in the file belongs to pCheckInfo->pTable
}
if
(
pCheckInfo
->
compSize
<
(
int32_t
)
compIndex
->
len
)
{
assert
(
compIndex
->
len
>
0
);
// no data block in this file, try next file
if
(
compIndex
==
NULL
||
compIndex
->
uid
!=
pCheckInfo
->
tableId
.
uid
)
{
continue
;
// no data blocks in the file belongs to pCheckInfo->pTable
char
*
t
=
realloc
(
pCheckInfo
->
pCompInfo
,
compIndex
->
len
);
if
(
t
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
code
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
code
;
}
if
(
pCheckInfo
->
compSize
<
(
int32_t
)
compIndex
->
len
)
{
assert
(
compIndex
->
len
>
0
);
pCheckInfo
->
pCompInfo
=
(
SBlockInfo
*
)
t
;
pCheckInfo
->
compSize
=
compIndex
->
len
;
}
char
*
t
=
realloc
(
pCheckInfo
->
pCompInfo
,
compIndex
->
len
);
if
(
t
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
code
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
break
;
}
tsdbLoadBlockInfo
(
&
(
pQueryHandle
->
rhelper
),
(
void
*
)(
pCheckInfo
->
pCompInfo
));
SBlockInfo
*
pCompInfo
=
pCheckInfo
->
pCompInfo
;
pCheckInfo
->
pCompInfo
=
(
SBlockInfo
*
)
t
;
pCheckInfo
->
compSize
=
compIndex
->
len
;
}
TSKEY
s
=
TSKEY_INITIAL_VAL
,
e
=
TSKEY_INITIAL_VAL
;
tsdbLoadBlockInfo
(
&
(
pQueryHandle
->
rhelper
),
(
void
*
)(
pCheckInfo
->
pCompInfo
));
SBlockInfo
*
pCompInfo
=
pCheckInfo
->
pCompInfo
;
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
assert
(
pCheckInfo
->
lastKey
<=
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
window
.
skey
<=
pQueryHandle
->
window
.
ekey
);
}
else
{
assert
(
pCheckInfo
->
lastKey
>=
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
window
.
skey
>=
pQueryHandle
->
window
.
ekey
);
}
TSKEY
s
=
TSKEY_INITIAL_VAL
,
e
=
TSKEY_INITIAL_VAL
;
s
=
MIN
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
e
=
MAX
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
assert
(
pCheckInfo
->
lastKey
<=
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
window
.
skey
<=
pQueryHandle
->
window
.
ekey
);
}
else
{
assert
(
pCheckInfo
->
lastKey
>=
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
window
.
skey
>=
pQueryHandle
->
window
.
ekey
);
}
// discard the unqualified data block based on the query time window
int32_t
start
=
binarySearchForBlock
(
pCompInfo
->
blocks
,
compIndex
->
numOfBlocks
,
s
,
TSDB_ORDER_ASC
);
int32_t
end
=
start
;
s
=
MIN
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
e
=
MAX
(
pCheckInfo
->
lastKey
,
pQueryHandle
->
window
.
ekey
);
if
(
s
>
pCompInfo
->
blocks
[
start
].
keyLast
)
{
return
0
;
}
// discard the unqualified data block based on the query time window
int32_t
start
=
binarySearchForBlock
(
pCompInfo
->
blocks
,
compIndex
->
numOfBlocks
,
s
,
TSDB_ORDER_ASC
);
int32_t
end
=
start
;
// todo speedup the procedure of located end block
while
(
end
<
(
int32_t
)
compIndex
->
numOfBlocks
&&
(
pCompInfo
->
blocks
[
end
].
keyFirst
<=
e
))
{
end
+=
1
;
}
if
(
s
>
pCompInfo
->
blocks
[
start
].
keyLast
)
{
continue
;
}
pCheckInfo
->
numOfBlocks
=
(
end
-
start
);
// todo speedup the procedure of located end block
while
(
end
<
(
int32_t
)
compIndex
->
numOfBlocks
&&
(
pCompInfo
->
blocks
[
end
].
keyFirst
<=
e
))
{
end
+=
1
;
}
if
(
start
>
0
)
{
memmove
(
pCompInfo
->
blocks
,
&
pCompInfo
->
blocks
[
start
],
pCheckInfo
->
numOfBlocks
*
sizeof
(
SBlock
));
}
pCheckInfo
->
numOfBlocks
=
(
end
-
start
);
(
*
numOfBlocks
)
+=
pCheckInfo
->
numOfBlocks
;
return
0
;
}
if
(
start
>
0
)
{
memmove
(
pCompInfo
->
blocks
,
&
pCompInfo
->
blocks
[
start
],
pCheckInfo
->
numOfBlocks
*
sizeof
(
SBlock
));
}
static
int32_t
getFileCompInfo
(
STsdbQueryHandle
*
pQueryHandle
,
int32_t
*
numOfBlocks
)
{
// load all the comp offset value for all tables in this file
int32_t
code
=
TSDB_CODE_SUCCESS
;
*
numOfBlocks
=
0
;
(
*
numOfBlocks
)
+=
pCheckInfo
->
numOfBlocks
;
size_t
numOfTables
=
0
;
if
(
pQueryHandle
->
loadType
==
BLOCK_LOAD_TABLE_SEQ_ORDER
)
{
code
=
loadBlockInfo
(
pQueryHandle
,
pQueryHandle
->
activeIndex
,
numOfBlocks
);
}
else
if
(
pQueryHandle
->
loadType
==
BLOCK_LOAD_OFFSET_SEQ_ORDER
)
{
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
for
(
int32_t
i
=
0
;
i
<
numOfTables
;
++
i
)
{
code
=
loadBlockInfo
(
pQueryHandle
,
i
,
numOfBlocks
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
}
else
{
assert
(
0
);
}
return
code
;
...
...
@@ -1817,6 +1861,7 @@ static int32_t createDataBlocksInfo(STsdbQueryHandle* pQueryHandle, int32_t numO
memset
(
pQueryHandle
->
pDataBlockInfo
,
0
,
size
);
*
numOfAllocBlocks
=
numOfBlocks
;
// access data blocks according to the offset of each block in asc/desc order.
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
SBlockOrderSupporter
sup
=
{
0
};
...
...
@@ -2189,12 +2234,6 @@ static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
pQueryHandle
->
activeIndex
+=
1
;
}
if
(
pQueryHandle
->
loadExternalRow
&&
pQueryHandle
->
window
.
skey
==
pQueryHandle
->
window
.
ekey
)
{
SMemRef
*
pMemRef
=
pQueryHandle
->
pMemRef
;
doGetExternalRow
(
pQueryHandle
,
TSDB_PREV_ROW
,
pMemRef
);
doGetExternalRow
(
pQueryHandle
,
TSDB_NEXT_ROW
,
pMemRef
);
}
// no data in memtable or imemtable, decrease the memory reference.
// TODO !!
// tsdbMayUnTakeMemSnapshot(pQueryHandle);
...
...
@@ -2202,7 +2241,7 @@ static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
}
//todo not unref yet, since it is not support multi-group interpolation query
static
void
changeQueryHandleForInterpQuery
(
TsdbQueryHandleT
pHandle
)
{
static
UNUSED_FUNC
void
changeQueryHandleForInterpQuery
(
TsdbQueryHandleT
pHandle
)
{
// filter the queried time stamp in the first place
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
pHandle
;
...
...
@@ -2325,114 +2364,164 @@ static void destroyHelper(void* param) {
free
(
param
);
}
// handle data in cache situation
bool
tsdbNextDataBlock
(
TsdbQueryHandleT
*
pHandle
)
{
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
pHandle
;
int64_t
stime
=
taosGetTimestampUs
();
int64_t
elapsedTime
=
stime
;
static
bool
loadBlockOfActiveTable
(
STsdbQueryHandle
*
pQueryHandle
)
{
if
(
pQueryHandle
->
checkFiles
)
{
// check if the query range overlaps with the file data block
bool
exists
=
true
;
size_t
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
assert
(
numOfTables
>
0
);
int32_t
code
=
getDataBlocksInFiles
(
pQueryHandle
,
&
exists
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pQueryHandle
->
checkFiles
=
false
;
return
false
;
}
if
(
pQueryHandle
->
type
==
TSDB_QUERY_TYPE_LAST
&&
pQueryHandle
->
cachelastrow
)
{
// the last row is cached in buffer, return it directly.
// here note that the pQueryHandle->window must be the TS_INITIALIZER
int32_t
numOfCols
=
(
int32_t
)(
QH_GET_NUM_OF_COLS
(
pQueryHandle
));
SQueryFilePos
*
cur
=
&
pQueryHandle
->
cur
;
SDataRow
pRow
=
NULL
;
TSKEY
key
=
TSKEY_INITIAL_VAL
;
int32_t
step
=
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
?
1
:-
1
;
if
(
++
pQueryHandle
->
activeIndex
<
numOfTables
)
{
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
pQueryHandle
->
activeIndex
);
int32_t
ret
=
tsdbGetCachedLastRow
(
pCheckInfo
->
pTableObj
,
&
pRow
,
&
key
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
false
;
if
(
exists
)
{
if
(
pQueryHandle
->
currentLoadExternalRows
&&
pQueryHandle
->
window
.
skey
==
pQueryHandle
->
window
.
ekey
)
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
0
);
assert
(
*
(
int64_t
*
)
pColInfo
->
pData
==
pQueryHandle
->
window
.
skey
);
}
copyOneRowFromMem
(
pQueryHandle
,
pQueryHandle
->
outputCapacity
,
0
,
pRow
,
numOfCols
,
pCheckInfo
->
pTableObj
,
NULL
);
tfree
(
pRow
);
pQueryHandle
->
currentLoadExternalRows
=
false
;
// clear the flag, since the exact matched row is found.
return
exists
;
}
// update the last key value
pCheckInfo
->
lastKey
=
key
+
step
;
pQueryHandle
->
checkFiles
=
false
;
}
cur
->
rows
=
1
;
// only one row
cur
->
lastKey
=
key
+
step
;
cur
->
mixBlock
=
true
;
cur
->
win
.
skey
=
key
;
cur
->
win
.
ekey
=
key
;
if
(
hasMoreDataInCache
(
pQueryHandle
))
{
pQueryHandle
->
currentLoadExternalRows
=
false
;
return
true
;
}
return
true
;
}
// current result is empty
if
(
pQueryHandle
->
currentLoadExternalRows
&&
pQueryHandle
->
window
.
skey
==
pQueryHandle
->
window
.
ekey
&&
pQueryHandle
->
cur
.
rows
==
0
)
{
SMemRef
*
pMemRef
=
pQueryHandle
->
pMemRef
;
return
false
;
doGetExternalRow
(
pQueryHandle
,
TSDB_PREV_ROW
,
pMemRef
);
doGetExternalRow
(
pQueryHandle
,
TSDB_NEXT_ROW
,
pMemRef
);
bool
result
=
tsdbGetExternalRow
(
pQueryHandle
);
pQueryHandle
->
prev
=
doFreeColumnInfoData
(
pQueryHandle
->
prev
);
pQueryHandle
->
next
=
doFreeColumnInfoData
(
pQueryHandle
->
next
);
pQueryHandle
->
currentLoadExternalRows
=
false
;
return
result
;
}
if
(
pQueryHandle
->
checkFiles
)
{
// check if the query range overlaps with the file data block
bool
exists
=
true
;
return
false
;
}
int32_t
code
=
getDataBlocksInFiles
(
pQueryHandle
,
&
exists
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pQueryHandle
->
activeIndex
=
0
;
pQueryHandle
->
checkFiles
=
false
;
static
bool
loadCachedLastRow
(
STsdbQueryHandle
*
pQueryHandle
)
{
// the last row is cached in buffer, return it directly.
// here note that the pQueryHandle->window must be the TS_INITIALIZER
int32_t
numOfCols
=
(
int32_t
)(
QH_GET_NUM_OF_COLS
(
pQueryHandle
));
size_t
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
assert
(
numOfTables
>
0
&&
numOfCols
>
0
);
SQueryFilePos
*
cur
=
&
pQueryHandle
->
cur
;
SDataRow
pRow
=
NULL
;
TSKEY
key
=
TSKEY_INITIAL_VAL
;
int32_t
step
=
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
)
?
1
:-
1
;
if
(
++
pQueryHandle
->
activeIndex
<
numOfTables
)
{
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
pQueryHandle
->
activeIndex
);
int32_t
ret
=
tsdbGetCachedLastRow
(
pCheckInfo
->
pTableObj
,
&
pRow
,
&
key
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
false
;
}
if
(
exists
)
{
pQueryHandle
->
cost
.
checkForNextTime
+=
(
taosGetTimestampUs
()
-
stime
);
return
exists
;
}
copyOneRowFromMem
(
pQueryHandle
,
pQueryHandle
->
outputCapacity
,
0
,
pRow
,
numOfCols
,
pCheckInfo
->
pTableObj
,
NULL
);
tfree
(
pRow
);
pQueryHandle
->
activeIndex
=
0
;
pQueryHandle
->
checkFiles
=
false
;
// update the last key value
pCheckInfo
->
lastKey
=
key
+
step
;
cur
->
rows
=
1
;
// only one row
cur
->
lastKey
=
key
+
step
;
cur
->
mixBlock
=
true
;
cur
->
win
.
skey
=
key
;
cur
->
win
.
ekey
=
key
;
return
true
;
}
// TODO: opt by consider the scan order
bool
ret
=
doHasDataInBuffer
(
pQueryHandle
);
terrno
=
TSDB_CODE_SUCCESS
;
return
false
;
}
static
bool
loadDataBlockFromTableSeq
(
STsdbQueryHandle
*
pQueryHandle
)
{
size_t
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
assert
(
numOfTables
>
0
);
elapsedTime
=
taosGetTimestampUs
()
-
stime
;
pQueryHandle
->
cost
.
checkForNextTime
+=
elapsedTime
;
return
ret
;
int64_t
stime
=
taosGetTimestampUs
();
while
(
pQueryHandle
->
activeIndex
<
numOfTables
)
{
if
(
loadBlockOfActiveTable
(
pQueryHandle
))
{
return
true
;
}
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
pQueryHandle
->
activeIndex
);
pCheckInfo
->
numOfBlocks
=
0
;
pQueryHandle
->
activeIndex
+=
1
;
pQueryHandle
->
locateStart
=
false
;
pQueryHandle
->
checkFiles
=
true
;
pQueryHandle
->
cur
.
rows
=
0
;
pQueryHandle
->
currentLoadExternalRows
=
pQueryHandle
->
loadExternalRow
;
terrno
=
TSDB_CODE_SUCCESS
;
int64_t
elapsedTime
=
taosGetTimestampUs
()
-
stime
;
pQueryHandle
->
cost
.
checkForNextTime
+=
elapsedTime
;
}
return
false
;
}
bool
tsdbNextDataBlockWithoutMerge
(
TsdbQueryHandleT
*
pHandle
)
{
// handle data in cache situation
bool
tsdbNextDataBlock
(
TsdbQueryHandleT
pHandle
)
{
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
pHandle
;
int64_t
stime
=
taosGetTimestampUs
();
int64_t
elapsedTime
=
stime
;
size_t
numOfTables
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
assert
(
numOfTables
>
0
);
if
(
pQueryHandle
->
type
==
TSDB_QUERY_TYPE_LAST
&&
pQueryHandle
->
cachelastrow
)
{
return
loadCachedLastRow
(
pQueryHandle
);
}
if
(
pQueryHandle
->
checkFiles
)
{
// check if the query range overlaps with the file data block
bool
exists
=
true
;
if
(
pQueryHandle
->
loadType
==
BLOCK_LOAD_TABLE_SEQ_ORDER
)
{
return
loadDataBlockFromTableSeq
(
pQueryHandle
);
}
else
{
// loadType == RR and Offset Order
if
(
pQueryHandle
->
checkFiles
)
{
// check if the query range overlaps with the file data block
bool
exists
=
true
;
int32_t
code
=
getDataBlocksInFiles
(
pQueryHandle
,
&
exists
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pQueryHandle
->
activeIndex
=
0
;
pQueryHandle
->
checkFiles
=
false
;
return
false
;
}
if
(
exists
)
{
pQueryHandle
->
cost
.
checkForNextTime
+=
(
taosGetTimestampUs
()
-
stime
);
return
exists
;
}
int32_t
code
=
getDataBlocksInFiles
(
pQueryHandle
,
&
exists
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pQueryHandle
->
activeIndex
=
0
;
pQueryHandle
->
checkFiles
=
false
;
return
false
;
}
if
(
exists
)
{
pQueryHandle
->
cost
.
checkForNextTime
+=
(
taosGetTimestampUs
()
-
stime
);
return
exists
;
}
// TODO: opt by consider the scan order
bool
ret
=
doHasDataInBuffer
(
pQueryHandle
);
terrno
=
TSDB_CODE_SUCCESS
;
pQueryHandle
->
activeIndex
=
0
;
pQueryHandle
->
checkFiles
=
false
;
elapsedTime
=
taosGetTimestampUs
()
-
stime
;
pQueryHandle
->
cost
.
checkForNextTime
+=
elapsedTime
;
return
ret
;
}
elapsedTime
=
taosGetTimestampUs
()
-
stime
;
pQueryHandle
->
cost
.
checkForNextTime
+=
elapsedTime
;
return
false
;
}
static
int32_t
doGetExternalRow
(
STsdbQueryHandle
*
pQueryHandle
,
int16_t
type
,
SMemRef
*
pMemRef
)
{
...
...
@@ -2480,7 +2569,7 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
}
// load the previous row
STsdbQueryCond
cond
=
{.
numOfCols
=
numOfCols
,
.
loadExternalRows
=
false
,};
STsdbQueryCond
cond
=
{.
numOfCols
=
numOfCols
,
.
loadExternalRows
=
false
,
.
type
=
BLOCK_LOAD_OFFSET_SEQ_ORDER
};
if
(
type
==
TSDB_PREV_ROW
)
{
cond
.
order
=
TSDB_ORDER_DESC
;
cond
.
twindow
=
(
STimeWindow
){
pQueryHandle
->
window
.
skey
,
INT64_MIN
};
...
...
@@ -2501,12 +2590,13 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
}
pSecQueryHandle
=
tsdbQueryTablesImpl
(
pQueryHandle
->
pTsdb
,
&
cond
,
pQueryHandle
->
qinfo
,
pMemRef
);
tfree
(
cond
.
colList
);
SArray
*
psTable
=
NULL
;
// current table, only one table
STableCheckInfo
*
pCurrent
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
pQueryHandle
->
activeIndex
);
pSecQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromCheckInfo
(
pQueryHandle
->
pTableCheckInfo
,
pSecQueryHandle
->
window
.
skey
,
&
psTable
);
SArray
*
psTable
=
NULL
;
pSecQueryHandle
->
pTableCheckInfo
=
createCheckInfoFromCheckInfo
(
pCurrent
,
pSecQueryHandle
->
window
.
skey
,
&
psTable
);
if
(
pSecQueryHandle
->
pTableCheckInfo
==
NULL
)
{
terrno
=
TSDB_CODE_QRY_OUT_OF_MEMORY
;
goto
out_of_memory
;
...
...
@@ -2514,7 +2604,6 @@ static int32_t doGetExternalRow(STsdbQueryHandle* pQueryHandle, int16_t type, SM
tsdbMayTakeMemSnapshot
(
pSecQueryHandle
,
psTable
);
if
(
!
tsdbNextDataBlock
((
void
*
)
pSecQueryHandle
))
{
// no result in current query, free the corresponding result rows structure
if
(
type
==
TSDB_PREV_ROW
)
{
...
...
@@ -2544,20 +2633,18 @@ out_of_memory:
return
terrno
;
}
SArray
*
tsdbGetExternalRow
(
TsdbQueryHandleT
*
pHandle
,
SDataBlockInfo
*
blockInfo
)
{
bool
tsdbGetExternalRow
(
TsdbQueryHandleT
pHandle
)
{
STsdbQueryHandle
*
pQueryHandle
=
(
STsdbQueryHandle
*
)
pHandle
;
int32_t
numOfCols
=
QH_GET_NUM_OF_COLS
(
pQueryHandle
);
STableCheckInfo
*
pCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
0
);
blockInfo
->
tid
=
pCheckInfo
->
tableId
.
tid
;
blockInfo
->
uid
=
pCheckInfo
->
tableId
.
uid
;
blockInfo
->
numOfCols
=
numOfCols
;
SQueryFilePos
*
cur
=
&
pQueryHandle
->
cur
;
cur
->
fid
=
INT32_MIN
;
cur
->
mixBlock
=
true
;
if
(
pQueryHandle
->
prev
==
NULL
||
pQueryHandle
->
next
==
NULL
)
{
blockInfo
->
rows
=
0
;
return
NULL
;
cur
->
rows
=
0
;
return
false
;
}
int32_t
numOfCols
=
QH_GET_NUM_OF_COLS
(
pQueryHandle
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
SColumnInfoData
*
first
=
taosArrayGet
(
pQueryHandle
->
prev
,
i
);
...
...
@@ -2568,13 +2655,13 @@ SArray* tsdbGetExternalRow(TsdbQueryHandleT *pHandle, SDataBlockInfo* blockInfo)
memcpy
(
pColInfoData
->
pData
+
pColInfoData
->
info
.
bytes
,
sec
->
pData
,
pColInfoData
->
info
.
bytes
);
if
(
i
==
0
&&
pColInfoData
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
blockInfo
->
window
.
skey
=
*
(
TSKEY
*
)
pColInfoData
->
pData
;
blockInfo
->
window
.
ekey
=
*
(
TSKEY
*
)(
pColInfoData
->
pData
+
TSDB_KEYSIZE
);
cur
->
win
.
skey
=
*
(
TSKEY
*
)
pColInfoData
->
pData
;
cur
->
win
.
ekey
=
*
(
TSKEY
*
)(
pColInfoData
->
pData
+
TSDB_KEYSIZE
);
}
}
blockInfo
->
rows
=
2
;
return
pQueryHandle
->
pColumns
;
cur
->
rows
=
2
;
return
true
;
}
/*
...
...
tests/script/general/parser/alter.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/alter1.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/alter_stable.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/auto_create_tb.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/between_and.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/binary_escapeCharacter.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/col_arithmetic_operation.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/columnValue.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/commit.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxTablesperVnode -v 100
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/create_db.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/create_mt.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/create_tb.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/create_tb_with_tag_name.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/dbtbnameValidate.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/fill.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/fill_stb.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/fill_us.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/first_last.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxTablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/function.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/groupby.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/import.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/import_file.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 500
sql connect
...
...
tests/script/general/parser/insert_multiTbl.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 500
sql connect
...
...
tests/script/general/parser/insert_tb.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/interp.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/interp_test.sim
浏览文件 @
8a45eedd
...
...
@@ -579,7 +579,7 @@ $tb = $tbPrefix . 0
## interp(*) from stb + group by + fill(none)
$t = $ts0 + 1000
sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname
sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname
if $rows != $tbNum then
return -1
endi
...
...
tests/script/general/parser/join.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c debugFlag -v 135
system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
...
...
tests/script/general/parser/join_multivnode.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/lastrow.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/limit.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/limit1.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/limit1_tblocks100.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/limit2.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c rowsInFileBlock -v 255
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/limit2_tblocks100.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c rowsInFileBlock -v 255
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/mixed_blocks.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/nchar.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/null_char.sim
浏览文件 @
8a45eedd
...
...
@@ -2,7 +2,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/projection_limit_offset.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/selectResNum.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 200
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/select_across_vnodes.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/select_distinct_tag.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 5
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/select_from_cache_disk.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/select_with_tags.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/set_tag_vals.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/single_row_in_tb.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/slimit.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/slimit1.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/slimit_alter_tags.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/stableOp.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
...
...
tests/script/general/parser/tags_dynamically_specifiy.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/tags_filter.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/tbnameIn.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
...
...
tests/script/general/parser/testSuite.sim
浏览文件 @
8a45eedd
#
run general/parser/alter.sim
#
sleep 100
#
run general/parser/alter1.sim
#
sleep 100
#
run general/parser/alter_stable.sim
#
sleep 100
#
run general/parser/auto_create_tb.sim
#
sleep 100
#
run general/parser/auto_create_tb_drop_tb.sim
#
sleep 100
#
run general/parser/col_arithmetic_operation.sim
#
sleep 100
#
run general/parser/columnValue.sim
#
sleep 100
#
run general/parser/commit.sim
#
sleep 100
#
run general/parser/create_db.sim
#
sleep 100
#
run general/parser/create_mt.sim
#
sleep 100
#
run general/parser/create_tb.sim
#
sleep 100
#
run general/parser/dbtbnameValidate.sim
#
sleep 100
#
run general/parser/fill.sim
#
sleep 100
#
run general/parser/fill_stb.sim
#
sleep 100
#
#
run general/parser/fill_us.sim #
#
sleep 100
#
run general/parser/first_last.sim
#
sleep 100
#
run general/parser/import_commit1.sim
#
sleep 100
#
run general/parser/import_commit2.sim
#
sleep 100
#
run general/parser/import_commit3.sim
#
sleep 100
#
#
run general/parser/import_file.sim
#
sleep 100
#
run general/parser/insert_tb.sim
#
sleep 100
#
run general/parser/tags_dynamically_specifiy.sim
#
sleep 100
#
run general/parser/interp.sim
#
sleep 100
#
run general/parser/lastrow.sim
#
sleep 100
#
run general/parser/limit.sim
#
sleep 100
#
run general/parser/limit1.sim
#
sleep 100
#
run general/parser/limit1_tblocks100.sim
#
sleep 100
#
run general/parser/limit2.sim
#
sleep 100
#
run general/parser/mixed_blocks.sim
#
sleep 100
#
run general/parser/nchar.sim
#
sleep 100
#
run general/parser/null_char.sim
#
sleep 100
#
run general/parser/selectResNum.sim
#
sleep 100
#
run general/parser/select_across_vnodes.sim
#
sleep 100
#
run general/parser/select_from_cache_disk.sim
#
sleep 100
#
run general/parser/set_tag_vals.sim
#
sleep 100
#
run general/parser/single_row_in_tb.sim
#
sleep 100
#
run general/parser/slimit.sim
#
sleep 100
#
run general/parser/slimit1.sim
#
sleep 100
#
run general/parser/slimit_alter_tags.sim
#
sleep 100
#
run general/parser/tbnameIn.sim
#
sleep 100
#
run general/parser/slimit_alter_tags.sim # persistent failed
#
sleep 100
#
run general/parser/join.sim
#
sleep 100
#
run general/parser/join_multivnode.sim
run general/parser/alter.sim
sleep 100
run general/parser/alter1.sim
sleep 100
run general/parser/alter_stable.sim
sleep 100
run general/parser/auto_create_tb.sim
sleep 100
run general/parser/auto_create_tb_drop_tb.sim
sleep 100
run general/parser/col_arithmetic_operation.sim
sleep 100
run general/parser/columnValue.sim
sleep 100
run general/parser/commit.sim
sleep 100
run general/parser/create_db.sim
sleep 100
run general/parser/create_mt.sim
sleep 100
run general/parser/create_tb.sim
sleep 100
run general/parser/dbtbnameValidate.sim
sleep 100
run general/parser/fill.sim
sleep 100
run general/parser/fill_stb.sim
sleep 100
#run general/parser/fill_us.sim #
sleep 100
run general/parser/first_last.sim
sleep 100
run general/parser/import_commit1.sim
sleep 100
run general/parser/import_commit2.sim
sleep 100
run general/parser/import_commit3.sim
sleep 100
#run general/parser/import_file.sim
sleep 100
run general/parser/insert_tb.sim
sleep 100
run general/parser/tags_dynamically_specifiy.sim
sleep 100
run general/parser/interp.sim
sleep 100
run general/parser/lastrow.sim
sleep 100
run general/parser/limit.sim
sleep 100
run general/parser/limit1.sim
sleep 100
run general/parser/limit1_tblocks100.sim
sleep 100
run general/parser/limit2.sim
sleep 100
run general/parser/mixed_blocks.sim
sleep 100
run general/parser/nchar.sim
sleep 100
run general/parser/null_char.sim
sleep 100
run general/parser/selectResNum.sim
sleep 100
run general/parser/select_across_vnodes.sim
sleep 100
run general/parser/select_from_cache_disk.sim
sleep 100
run general/parser/set_tag_vals.sim
sleep 100
run general/parser/single_row_in_tb.sim
sleep 100
run general/parser/slimit.sim
sleep 100
run general/parser/slimit1.sim
sleep 100
run general/parser/slimit_alter_tags.sim
sleep 100
run general/parser/tbnameIn.sim
sleep 100
run general/parser/slimit_alter_tags.sim # persistent failed
sleep 100
run general/parser/join.sim
sleep 100
run general/parser/join_multivnode.sim
sleep 100
run general/parser/projection_limit_offset.sim
sleep 100
...
...
tests/script/general/parser/timestamp.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/topbot.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 200
system sh/exec.sh -n dnode1 -s start
...
...
tests/script/general/parser/union.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c debugFlag -v 135
system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
...
...
tests/script/general/parser/where.sim
浏览文件 @
8a45eedd
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v
0
system sh/cfg.sh -n dnode1 -c walLevel -v
1
system sh/cfg.sh -n dnode1 -c maxtablespervnode -v 4
system sh/exec.sh -n dnode1 -s start
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录