Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2acb7c1a
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2acb7c1a
编写于
7月 09, 2022
作者:
H
Haojun Liao
提交者:
GitHub
7月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14707 from taosdata/feature/3_liaohj
fix(query): add error code check.
上级
5dff136b
5ee4a196
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
112 addition
and
40 deletion
+112
-40
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+71
-22
source/libs/scalar/test/filter/filterTests.cpp
source/libs/scalar/test/filter/filterTests.cpp
+41
-18
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
2acb7c1a
...
...
@@ -39,8 +39,8 @@ static int32_t buildSysDbTableInfo(const SSysTableScanInfo* pInfo, int32_t capac
static
int32_t
buildDbTableInfoBlock
(
const
SSDataBlock
*
p
,
const
SSysTableMeta
*
pSysDbTableMeta
,
size_t
size
,
const
char
*
dbName
);
static
void
addTagPseudoColumnData
(
SReadHandle
*
pHandle
,
SExprInfo
*
pPseudoExpr
,
int32_t
numOfPseudoExpr
,
SSDataBlock
*
pBlock
);
static
int32_t
addTagPseudoColumnData
(
SReadHandle
*
pHandle
,
SExprInfo
*
pPseudoExpr
,
int32_t
numOfPseudoExpr
,
SSDataBlock
*
pBlock
,
const
char
*
idStr
);
static
bool
processBlockWithProbability
(
const
SSampleExecInfo
*
pInfo
);
bool
processBlockWithProbability
(
const
SSampleExecInfo
*
pInfo
)
{
...
...
@@ -264,7 +264,11 @@ static int32_t loadDataBlock(SOperatorInfo* pOperator, STableScanInfo* pTableSca
// currently only the tbname pseudo column
if
(
pTableScanInfo
->
pseudoSup
.
numOfExprs
>
0
)
{
SExprSupp
*
pSup
=
&
pTableScanInfo
->
pseudoSup
;
addTagPseudoColumnData
(
&
pTableScanInfo
->
readHandle
,
pSup
->
pExprInfo
,
pSup
->
numOfExprs
,
pBlock
);
int32_t
code
=
addTagPseudoColumnData
(
&
pTableScanInfo
->
readHandle
,
pSup
->
pExprInfo
,
pSup
->
numOfExprs
,
pBlock
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pTaskInfo
->
env
,
code
);
}
}
int64_t
st
=
taosGetTimestampMs
();
...
...
@@ -298,16 +302,21 @@ static void prepareForDescendingScan(STableScanInfo* pTableScanInfo, SqlFunction
taosqsort
(
pCond
->
twindows
,
pCond
->
numOfTWindows
,
sizeof
(
STimeWindow
),
pCond
,
compareTimeWindow
);
}
void
addTagPseudoColumnData
(
SReadHandle
*
pHandle
,
SExprInfo
*
pPseudoExpr
,
int32_t
numOfPseudoExpr
,
SSDataBlock
*
pBlock
)
{
int32_t
addTagPseudoColumnData
(
SReadHandle
*
pHandle
,
SExprInfo
*
pPseudoExpr
,
int32_t
numOfPseudoExpr
,
SSDataBlock
*
pBlock
,
const
char
*
idStr
)
{
// currently only the tbname pseudo column
if
(
numOfPseudoExpr
==
0
)
{
return
;
return
TSDB_CODE_SUCCESS
;
}
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pHandle
->
meta
,
0
);
metaGetTableEntryByUid
(
&
mr
,
pBlock
->
info
.
uid
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
pBlock
->
info
.
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table meta, uid:0x%"
PRIx64
", code:%s, %s"
,
pBlock
->
info
.
uid
,
tstrerror
(
terrno
),
idStr
);
metaReaderClear
(
&
mr
);
return
terrno
;
}
for
(
int32_t
j
=
0
;
j
<
numOfPseudoExpr
;
++
j
)
{
SExprInfo
*
pExpr
=
&
pPseudoExpr
[
j
];
...
...
@@ -349,6 +358,7 @@ void addTagPseudoColumnData(SReadHandle* pHandle, SExprInfo* pPseudoExpr, int32_
}
metaReaderClear
(
&
mr
);
return
TSDB_CODE_SUCCESS
;
}
void
setTbNameColData
(
void
*
pMeta
,
const
SSDataBlock
*
pBlock
,
SColumnInfoData
*
pColInfoData
,
int32_t
functionId
)
{
...
...
@@ -680,34 +690,46 @@ SOperatorInfo* createTableSeqScanOperatorInfo(void* pReadHandle, SExecTaskInfo*
return
pOperator
;
}
static
int32_t
doGetTableRowSize
(
void
*
pMeta
,
uint64_t
uid
)
{
int32_t
rowLen
=
0
;
static
int32_t
doGetTableRowSize
(
void
*
pMeta
,
uint64_t
uid
,
int32_t
*
rowLen
,
const
char
*
idstr
)
{
*
rowLen
=
0
;
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pMeta
,
0
);
metaGetTableEntryByUid
(
&
mr
,
uid
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table meta, uid:0x%"
PRIx64
", code:%s, %s"
,
uid
,
tstrerror
(
terrno
),
idstr
);
metaReaderClear
(
&
mr
);
return
terrno
;
}
if
(
mr
.
me
.
type
==
TSDB_SUPER_TABLE
)
{
int32_t
numOfCols
=
mr
.
me
.
stbEntry
.
schemaRow
.
nCols
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
rowLen
+=
mr
.
me
.
stbEntry
.
schemaRow
.
pSchema
[
i
].
bytes
;
(
*
rowLen
)
+=
mr
.
me
.
stbEntry
.
schemaRow
.
pSchema
[
i
].
bytes
;
}
}
else
if
(
mr
.
me
.
type
==
TSDB_CHILD_TABLE
)
{
uint64_t
suid
=
mr
.
me
.
ctbEntry
.
suid
;
metaGetTableEntryByUid
(
&
mr
,
suid
);
code
=
metaGetTableEntryByUid
(
&
mr
,
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table meta, uid:0x%"
PRIx64
", code:%s, %s"
,
suid
,
tstrerror
(
terrno
),
idstr
);
metaReaderClear
(
&
mr
);
return
terrno
;
}
int32_t
numOfCols
=
mr
.
me
.
stbEntry
.
schemaRow
.
nCols
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
rowLen
+=
mr
.
me
.
stbEntry
.
schemaRow
.
pSchema
[
i
].
bytes
;
(
*
rowLen
)
+=
mr
.
me
.
stbEntry
.
schemaRow
.
pSchema
[
i
].
bytes
;
}
}
else
if
(
mr
.
me
.
type
==
TSDB_NORMAL_TABLE
)
{
int32_t
numOfCols
=
mr
.
me
.
ntbEntry
.
schemaRow
.
nCols
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
rowLen
+=
mr
.
me
.
ntbEntry
.
schemaRow
.
pSchema
[
i
].
bytes
;
(
*
rowLen
)
+=
mr
.
me
.
ntbEntry
.
schemaRow
.
pSchema
[
i
].
bytes
;
}
}
metaReaderClear
(
&
mr
);
return
rowLen
;
return
TSDB_CODE_SUCCESS
;
}
static
SSDataBlock
*
doBlockInfoScan
(
SOperatorInfo
*
pOperator
)
{
...
...
@@ -716,9 +738,13 @@ static SSDataBlock* doBlockInfoScan(SOperatorInfo* pOperator) {
}
SBlockDistInfo
*
pBlockScanInfo
=
pOperator
->
info
;
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
STableBlockDistInfo
blockDistInfo
=
{.
minRows
=
INT_MAX
,
.
maxRows
=
INT_MIN
};
blockDistInfo
.
rowSize
=
doGetTableRowSize
(
pBlockScanInfo
->
readHandle
.
meta
,
pBlockScanInfo
->
uid
);
int32_t
code
=
doGetTableRowSize
(
pBlockScanInfo
->
readHandle
.
meta
,
pBlockScanInfo
->
uid
,
&
blockDistInfo
.
rowSize
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pTaskInfo
->
env
,
code
);
}
tsdbGetFileBlocksDistInfo
(
pBlockScanInfo
->
pHandle
,
&
blockDistInfo
);
blockDistInfo
.
numOfInmemRows
=
(
int32_t
)
tsdbGetNumOfRowsInMemTable
(
pBlockScanInfo
->
pHandle
);
...
...
@@ -1193,7 +1219,10 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
// currently only the tbname pseudo column
if
(
pInfo
->
numOfPseudoExpr
>
0
)
{
addTagPseudoColumnData
(
&
pInfo
->
readHandle
,
pInfo
->
pPseudoExpr
,
pInfo
->
numOfPseudoExpr
,
pInfo
->
pRes
);
int32_t
code
=
addTagPseudoColumnData
(
&
pInfo
->
readHandle
,
pInfo
->
pPseudoExpr
,
pInfo
->
numOfPseudoExpr
,
pInfo
->
pRes
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pTaskInfo
->
env
,
code
);
}
}
doFilter
(
pInfo
->
pCondition
,
pInfo
->
pRes
);
...
...
@@ -1414,7 +1443,10 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
// currently only the tbname pseudo column
if
(
pInfo
->
numOfPseudoExpr
>
0
)
{
addTagPseudoColumnData
(
&
pInfo
->
readHandle
,
pInfo
->
pPseudoExpr
,
pInfo
->
numOfPseudoExpr
,
pInfo
->
pRes
);
code
=
addTagPseudoColumnData
(
&
pInfo
->
readHandle
,
pInfo
->
pPseudoExpr
,
pInfo
->
numOfPseudoExpr
,
pInfo
->
pRes
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pTaskInfo
->
env
,
code
);
}
}
doFilter
(
pInfo
->
pCondition
,
pInfo
->
pRes
);
...
...
@@ -1839,7 +1871,16 @@ static SSDataBlock* doSysTableScan(SOperatorInfo* pOperator) {
SMetaReader
mr
=
{
0
};
metaReaderInit
(
&
mr
,
pInfo
->
readHandle
.
meta
,
0
);
metaGetTableEntryByUid
(
&
mr
,
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
);
uint64_t
suid
=
pInfo
->
pCur
->
mr
.
me
.
ctbEntry
.
suid
;
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
suid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get super table meta, uid:0x%"
PRIx64
", code:%s, %s"
,
suid
,
tstrerror
(
terrno
),
GET_TASKID
(
pTaskInfo
));
metaReaderClear
(
&
mr
);
metaCloseTbCursor
(
pInfo
->
pCur
);
pInfo
->
pCur
=
NULL
;
longjmp
(
pTaskInfo
->
env
,
terrno
);
}
// number of columns
pColInfoData
=
taosArrayGet
(
p
->
pDataBlock
,
3
);
...
...
@@ -2234,7 +2275,12 @@ static SSDataBlock* doTagScan(SOperatorInfo* pOperator) {
while
(
pInfo
->
curPos
<
size
&&
count
<
pOperator
->
resultInfo
.
capacity
)
{
STableKeyInfo
*
item
=
taosArrayGet
(
pInfo
->
pTableList
->
pTableList
,
pInfo
->
curPos
);
metaGetTableEntryByUid
(
&
mr
,
item
->
uid
);
int32_t
code
=
metaGetTableEntryByUid
(
&
mr
,
item
->
uid
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
qError
(
"failed to get table meta, uid:0x%"
PRIx64
", code:%s, %s"
,
item
->
uid
,
tstrerror
(
terrno
),
GET_TASKID
(
pTaskInfo
));
metaReaderClear
(
&
mr
);
longjmp
(
pTaskInfo
->
env
,
terrno
);
}
for
(
int32_t
j
=
0
;
j
<
pOperator
->
exprSupp
.
numOfExprs
;
++
j
)
{
SColumnInfoData
*
pDst
=
taosArrayGet
(
pRes
->
pDataBlock
,
pExprInfo
[
j
].
base
.
resSchema
.
slotId
);
...
...
@@ -2519,8 +2565,11 @@ static int32_t loadDataBlockFromOneTable(SOperatorInfo* pOperator, STableMergeSc
// currently only the tbname pseudo column
if
(
pTableScanInfo
->
numOfPseudoExpr
>
0
)
{
addTagPseudoColumnData
(
&
pTableScanInfo
->
readHandle
,
pTableScanInfo
->
pPseudoExpr
,
pTableScanInfo
->
numOfPseudoExpr
,
pBlock
);
int32_t
code
=
addTagPseudoColumnData
(
&
pTableScanInfo
->
readHandle
,
pTableScanInfo
->
pPseudoExpr
,
pTableScanInfo
->
numOfPseudoExpr
,
pBlock
,
GET_TASKID
(
pTaskInfo
));
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
longjmp
(
pTaskInfo
->
env
,
code
);
}
}
int64_t
st
=
taosGetTimestampMs
();
...
...
source/libs/scalar/test/filter/filterTests.cpp
浏览文件 @
2acb7c1a
...
...
@@ -205,13 +205,19 @@ void flttMakeListNode(SNode **pNode, SNodeList *list, int32_t resType) {
*
pNode
=
(
SNode
*
)
lnode
;
}
void
initScalarParam
(
SScalarParam
*
pParam
)
{
memset
(
pParam
,
0
,
sizeof
(
SScalarParam
));
pParam
->
type
=
SHOULD_FREE_COLDATA
;
}
}
TEST
(
timerangeTest
,
greater
)
{
SNode
*
pcol
=
NULL
,
*
pval
=
NULL
,
*
opNode1
=
NULL
;
bool
eRes
[
5
]
=
{
false
,
false
,
true
,
true
,
true
};
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int64_t
tsmall
=
222
,
tbig
=
333
;
flttMakeColumnNode
(
&
pcol
,
NULL
,
TSDB_DATA_TYPE_TIMESTAMP
,
sizeof
(
int64_t
),
0
,
NULL
);
flttMakeValueNode
(
&
pval
,
TSDB_DATA_TYPE_TIMESTAMP
,
&
tsmall
);
...
...
@@ -234,7 +240,8 @@ TEST(timerangeTest, greater) {
TEST
(
timerangeTest
,
greater_and_lower
)
{
SNode
*
pcol
=
NULL
,
*
pval
=
NULL
,
*
opNode1
=
NULL
,
*
opNode2
=
NULL
,
*
logicNode
=
NULL
;
bool
eRes
[
5
]
=
{
false
,
false
,
true
,
true
,
true
};
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int64_t
tsmall
=
222
,
tbig
=
333
;
flttMakeColumnNode
(
&
pcol
,
NULL
,
TSDB_DATA_TYPE_TIMESTAMP
,
sizeof
(
int64_t
),
0
,
NULL
);
flttMakeValueNode
(
&
pval
,
TSDB_DATA_TYPE_TIMESTAMP
,
&
tsmall
);
...
...
@@ -265,7 +272,8 @@ TEST(timerangeTest, greater_and_lower) {
TEST
(
timerangeTest
,
greater_equal_and_lower_equal
)
{
SNode
*
pcol
=
NULL
,
*
pval
=
NULL
,
*
opNode1
=
NULL
,
*
opNode2
=
NULL
,
*
logicNode
=
NULL
;
bool
eRes
[
5
]
=
{
false
,
false
,
true
,
true
,
true
};
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int64_t
tsmall
=
222
,
tbig
=
333
;
flttMakeColumnNode
(
&
pcol
,
NULL
,
TSDB_DATA_TYPE_TIMESTAMP
,
sizeof
(
int64_t
),
0
,
NULL
);
flttMakeValueNode
(
&
pval
,
TSDB_DATA_TYPE_TIMESTAMP
,
&
tsmall
);
...
...
@@ -297,7 +305,8 @@ TEST(timerangeTest, greater_equal_and_lower_equal) {
TEST
(
timerangeTest
,
greater_and_lower_not_strict
)
{
SNode
*
pcol
=
NULL
,
*
pval
=
NULL
,
*
opNode1
=
NULL
,
*
opNode2
=
NULL
,
*
logicNode1
=
NULL
,
*
logicNode2
=
NULL
;
bool
eRes
[
5
]
=
{
false
,
false
,
true
,
true
,
true
};
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int64_t
tsmall1
=
222
,
tbig1
=
333
;
int64_t
tsmall2
=
444
,
tbig2
=
555
;
SNode
*
list
[
2
]
=
{
0
};
...
...
@@ -350,7 +359,8 @@ TEST(columnTest, smallint_column_greater_double_value) {
double
rightv
=
2.5
;
int8_t
eRes
[
5
]
=
{
0
,
0
,
1
,
1
,
1
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
leftv
)
/
sizeof
(
leftv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_SMALLINT
,
sizeof
(
int16_t
),
rowNum
,
leftv
);
flttMakeValueNode
(
&
pRight
,
TSDB_DATA_TYPE_DOUBLE
,
&
rightv
);
...
...
@@ -405,7 +415,8 @@ TEST(columnTest, int_column_greater_smallint_value) {
int16_t
rightv
=
4
;
int8_t
eRes
[
5
]
=
{
0
,
0
,
1
,
1
,
1
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
leftv
)
/
sizeof
(
leftv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_INT
,
sizeof
(
int32_t
),
rowNum
,
leftv
);
flttMakeValueNode
(
&
pRight
,
TSDB_DATA_TYPE_SMALLINT
,
&
rightv
);
...
...
@@ -460,7 +471,8 @@ TEST(columnTest, int_column_in_double_list) {
double
rightv1
=
1.1
,
rightv2
=
2.2
,
rightv3
=
3.3
;
bool
eRes
[
5
]
=
{
true
,
true
,
true
,
false
,
false
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
leftv
)
/
sizeof
(
leftv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_INT
,
sizeof
(
int32_t
),
rowNum
,
leftv
);
SNodeList
*
list
=
nodesMakeList
();
...
...
@@ -503,7 +515,8 @@ TEST(columnTest, binary_column_in_binary_list) {
SNode
*
pLeft
=
NULL
,
*
pRight
=
NULL
,
*
listNode
=
NULL
,
*
opNode
=
NULL
;
bool
eRes
[
5
]
=
{
true
,
true
,
false
,
false
,
false
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
char
leftv
[
5
][
5
]
=
{
0
};
char
rightv
[
3
][
5
]
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
5
;
++
i
)
{
...
...
@@ -567,7 +580,8 @@ TEST(columnTest, binary_column_like_binary) {
char
rightv
[
64
]
=
{
0
};
char
leftv
[
5
][
5
]
=
{
0
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
bool
eRes
[
5
]
=
{
true
,
false
,
true
,
false
,
true
};
for
(
int32_t
i
=
0
;
i
<
5
;
++
i
)
{
...
...
@@ -614,7 +628,8 @@ TEST(columnTest, binary_column_is_null) {
SNode
*
pLeft
=
NULL
,
*
opNode
=
NULL
;
char
leftv
[
5
][
5
]
=
{
0
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
bool
eRes
[
5
]
=
{
false
,
false
,
true
,
false
,
true
};
for
(
int32_t
i
=
0
;
i
<
5
;
++
i
)
{
...
...
@@ -661,7 +676,8 @@ TEST(columnTest, binary_column_is_not_null) {
SNode
*
pLeft
=
NULL
,
*
opNode
=
NULL
;
char
leftv
[
5
][
5
]
=
{
0
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
bool
eRes
[
5
]
=
{
true
,
true
,
true
,
true
,
false
};
for
(
int32_t
i
=
0
;
i
<
5
;
++
i
)
{
...
...
@@ -710,7 +726,8 @@ TEST(opTest, smallint_column_greater_int_column) {
int32_t
rightv
[
5
]
=
{
0
,
-
5
,
-
4
,
23
,
100
};
bool
eRes
[
5
]
=
{
true
,
false
,
true
,
false
,
true
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
rightv
)
/
sizeof
(
rightv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_SMALLINT
,
sizeof
(
int16_t
),
rowNum
,
leftv
);
flttMakeColumnNode
(
&
pRight
,
&
src
,
TSDB_DATA_TYPE_INT
,
sizeof
(
int32_t
),
rowNum
,
rightv
);
...
...
@@ -747,7 +764,8 @@ TEST(opTest, smallint_value_add_int_column) {
int16_t
rightv
[
5
]
=
{
0
,
-
1
,
-
4
,
-
1
,
100
};
bool
eRes
[
5
]
=
{
true
,
false
,
true
,
false
,
true
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
rightv
)
/
sizeof
(
rightv
[
0
]);
flttMakeValueNode
(
&
pLeft
,
TSDB_DATA_TYPE_INT
,
&
leftv
);
flttMakeColumnNode
(
&
pRight
,
&
src
,
TSDB_DATA_TYPE_SMALLINT
,
sizeof
(
int16_t
),
rowNum
,
rightv
);
...
...
@@ -790,7 +808,8 @@ TEST(opTest, bigint_column_multi_binary_column) {
}
bool
eRes
[
5
]
=
{
false
,
true
,
true
,
true
,
true
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
rightv
)
/
sizeof
(
rightv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_BIGINT
,
sizeof
(
int64_t
),
rowNum
,
leftv
);
flttMakeColumnNode
(
&
pRight
,
&
src
,
TSDB_DATA_TYPE_BINARY
,
5
,
rowNum
,
rightv
);
...
...
@@ -833,7 +852,8 @@ TEST(opTest, smallint_column_and_binary_column) {
}
bool
eRes
[
5
]
=
{
false
,
false
,
true
,
false
,
true
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
rightv
)
/
sizeof
(
rightv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_SMALLINT
,
sizeof
(
int16_t
),
rowNum
,
leftv
);
flttMakeColumnNode
(
&
pRight
,
&
src
,
TSDB_DATA_TYPE_BINARY
,
5
,
rowNum
,
rightv
);
...
...
@@ -871,7 +891,8 @@ TEST(opTest, smallint_column_or_float_column) {
float
rightv
[
5
]
=
{
2.0
,
3.0
,
0
,
5.2
,
6.0
};
bool
eRes
[
5
]
=
{
true
,
true
,
false
,
true
,
true
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
rightv
)
/
sizeof
(
rightv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_SMALLINT
,
sizeof
(
int16_t
),
rowNum
,
leftv
);
flttMakeColumnNode
(
&
pRight
,
&
src
,
TSDB_DATA_TYPE_FLOAT
,
sizeof
(
float
),
rowNum
,
rightv
);
...
...
@@ -909,7 +930,8 @@ TEST(opTest, smallint_column_or_double_value) {
double
rightv
=
10.2
;
bool
eRes
[
5
]
=
{
true
,
true
,
true
,
true
,
true
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
int32_t
rowNum
=
sizeof
(
leftv
)
/
sizeof
(
leftv
[
0
]);
flttMakeColumnNode
(
&
pLeft
,
&
src
,
TSDB_DATA_TYPE_SMALLINT
,
sizeof
(
int16_t
),
rowNum
,
leftv
);
flttMakeValueNode
(
&
pRight
,
TSDB_DATA_TYPE_DOUBLE
,
&
rightv
);
...
...
@@ -945,7 +967,8 @@ TEST(opTest, binary_column_is_true) {
SNode
*
pLeft
=
NULL
,
*
opNode
=
NULL
;
char
leftv
[
5
][
5
]
=
{
0
};
SSDataBlock
*
src
=
NULL
;
SScalarParam
res
=
{
0
};
SScalarParam
res
;
initScalarParam
(
&
res
);
bool
eRes
[
5
]
=
{
false
,
true
,
false
,
true
,
false
};
for
(
int32_t
i
=
0
;
i
<
5
;
++
i
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录