Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
fad472bc
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
fad472bc
编写于
9月 21, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
9月 21, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3593 from taosdata/feature/query
[td-225] fix bugs in regression test.
上级
f8cbfe74
77b86280
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
23 deletion
+40
-23
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+4
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+8
-13
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+13
-5
tests/script/general/parser/where.sim
tests/script/general/parser/where.sim
+15
-3
未找到文件。
src/client/src/tscFunctionImpl.c
浏览文件 @
fad472bc
...
...
@@ -326,7 +326,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
}
else
if
(
functionId
==
TSDB_FUNC_LAST_ROW
)
{
*
type
=
(
int16_t
)
dataType
;
*
bytes
=
(
int16_t
)
dataBytes
;
*
interBytes
=
dataBytes
+
sizeof
(
SLastrowInfo
)
;
*
interBytes
=
dataBytes
;
}
else
{
return
TSDB_CODE_TSC_INVALID_SQL
;
}
...
...
@@ -1843,8 +1843,10 @@ static void last_row_function(SQLFunctionCtx *pCtx) {
pInfo1
->
hasResult
=
DATA_SET_FLAG
;
DO_UPDATE_TAG_COLUMNS
(
pCtx
,
pInfo1
->
ts
);
}
else
{
DO_UPDATE_TAG_COLUMNS
(
pCtx
,
pCtx
->
ptsList
[
pCtx
->
size
-
1
]);
}
SET_VAL
(
pCtx
,
pCtx
->
size
,
1
);
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
fad472bc
...
...
@@ -5286,9 +5286,12 @@ void doAddGroupColumnForSubquery(SQueryInfo* pQueryInfo, int32_t tagIndex) {
static
void
doUpdateSqlFunctionForTagPrj
(
SQueryInfo
*
pQueryInfo
)
{
int32_t
tagLength
=
0
;
size_t
size
=
taosArrayGetSize
(
pQueryInfo
->
exprList
);
//todo is 0??
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
bool
isSTable
=
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pQueryInfo
,
i
);
if
(
pExpr
->
functionId
==
TSDB_FUNC_TAGPRJ
||
pExpr
->
functionId
==
TSDB_FUNC_TAG
)
{
...
...
@@ -5300,8 +5303,7 @@ static void doUpdateSqlFunctionForTagPrj(SQueryInfo* pQueryInfo) {
}
}
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
SSchema
*
pSchema
=
tscGetTableSchema
(
pTableMetaInfo
->
pTableMeta
);
SSchema
*
pSchema
=
tscGetTableSchema
(
pTableMetaInfo
->
pTableMeta
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pQueryInfo
,
i
);
...
...
@@ -5309,7 +5311,7 @@ static void doUpdateSqlFunctionForTagPrj(SQueryInfo* pQueryInfo) {
!
(
pExpr
->
functionId
==
TSDB_FUNC_PRJ
&&
TSDB_COL_IS_UD_COL
(
pExpr
->
colInfo
.
flag
)))
{
SSchema
*
pColSchema
=
&
pSchema
[
pExpr
->
colInfo
.
colIndex
];
getResultDataInfo
(
pColSchema
->
type
,
pColSchema
->
bytes
,
pExpr
->
functionId
,
(
int32_t
)
pExpr
->
param
[
0
].
i64Key
,
&
pExpr
->
resType
,
&
pExpr
->
resBytes
,
&
pExpr
->
interBytes
,
tagLength
,
tru
e
);
&
pExpr
->
resBytes
,
&
pExpr
->
interBytes
,
tagLength
,
isSTabl
e
);
}
}
}
...
...
@@ -5320,7 +5322,7 @@ static int32_t doUpdateSqlFunctionForColPrj(SQueryInfo* pQueryInfo) {
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SSqlExpr
*
pExpr
=
tscSqlExprGet
(
pQueryInfo
,
i
);
if
(
pExpr
->
functionId
==
TSDB_FUNC_PRJ
&&
(
!
TSDB_COL_IS_UD_COL
(
pExpr
->
colInfo
.
flag
)))
{
if
(
pExpr
->
functionId
==
TSDB_FUNC_PRJ
&&
(
!
TSDB_COL_IS_UD_COL
(
pExpr
->
colInfo
.
flag
)
&&
(
pExpr
->
colInfo
.
colId
!=
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
))
{
bool
qualifiedCol
=
false
;
for
(
int32_t
j
=
0
;
j
<
pQueryInfo
->
groupbyExpr
.
numOfGroupCols
;
++
j
)
{
SColIndex
*
pColIndex
=
taosArrayGet
(
pQueryInfo
->
groupbyExpr
.
columnInfo
,
j
);
...
...
@@ -5418,13 +5420,6 @@ static int32_t checkUpdateTagPrjFunctions(SQueryInfo* pQueryInfo, SSqlCmd* pCmd)
int16_t
numOfSelectivity
=
0
;
int16_t
numOfAggregation
=
0
;
// todo is 0??
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
bool
isSTable
=
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
);
if
(
!
isSTable
)
{
return
TSDB_CODE_SUCCESS
;
}
size_t
numOfExprs
=
taosArrayGetSize
(
pQueryInfo
->
exprList
);
for
(
int32_t
i
=
0
;
i
<
numOfExprs
;
++
i
)
{
SSqlExpr
*
pExpr
=
taosArrayGetP
(
pQueryInfo
->
exprList
,
i
);
...
...
src/query/src/qExecutor.c
浏览文件 @
fad472bc
...
...
@@ -2120,7 +2120,7 @@ static bool needToLoadDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SDataStatis *pDat
}
}
// no statistics data
// no statistics data
, load the true data block
if
(
index
==
-
1
)
{
return
true
;
}
...
...
@@ -2130,8 +2130,17 @@ static bool needToLoadDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SDataStatis *pDat
return
true
;
}
// all
points
in current column are NULL, no need to check its boundary value
// all
data
in current column are NULL, no need to check its boundary value
if
(
pDataStatis
[
index
].
numOfNull
==
numOfRows
)
{
// if isNULL query exists, load the null data column
for
(
int32_t
j
=
0
;
j
<
pFilterInfo
->
numOfFilters
;
++
j
)
{
SColumnFilterElem
*
pFilterElem
=
&
pFilterInfo
->
pFilters
[
j
];
if
(
pFilterElem
->
fp
==
isNull_filter
)
{
return
true
;
}
}
continue
;
}
...
...
@@ -2957,11 +2966,10 @@ int32_t mergeIntoGroupResultImpl(SQInfo *pQInfo, SArray *pGroup) {
STableQueryInfo
*
item
=
taosArrayGetP
(
pGroup
,
i
);
SIDList
list
=
getDataBufPagesIdList
(
pRuntimeEnv
->
pResultBuf
,
TSDB_TABLEID
(
item
->
pTable
)
->
tid
);
pageList
=
list
;
tid
=
TSDB_TABLEID
(
item
->
pTable
)
->
tid
;
if
(
taosArrayGetSize
(
list
)
>
0
&&
item
->
windowResInfo
.
size
>
0
)
{
pTableList
[
numOfTables
++
]
=
item
;
tid
=
TSDB_TABLEID
(
item
->
pTable
)
->
tid
;
pageList
=
list
;
}
}
...
...
tests/script/general/parser/where.sim
浏览文件 @
fad472bc
...
...
@@ -308,13 +308,25 @@ sleep 2000
system sh/exec.sh -n dnode1 -s start
sql select * from wh_mt0 where c3 = 'abc' and tbname in ('test_null_filter');
sql_error select * from wh_mt0 where c3 = 'abc' and tbname in ('test_null_filter');
sql select * from wh_mt0 where c3 = '1' and tbname in ('test_null_filter');
if $row != 0 then
return -1
endi
sql select * from wh_mt0 where c3 = 'abc' and tbname in ('test_null_filter');
if $row != 0 then
sql select * from wh_mt0 where c3 = '1';
if $row == 0 then
return -1
endi
sql select * from wh_mt0 where c3 is null and tbname in ('test_null_filter');
if $rows != 10000 then
return -1
endi
sql select * from wh_mt0 where c3 is not null and tbname in ('test_null_filter');
if $rows != 0 then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录