Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ec0637df
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ec0637df
编写于
4月 12, 2022
作者:
H
Haojun Liao
提交者:
GitHub
4月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11412 from taosdata/feature/3.0_liaohj
fix(query): load the null data in nchar/binary columns.
上级
fc3b4785
727085ad
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
30 addition
and
57 deletion
+30
-57
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+6
-2
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+0
-32
tests/script/tsim/query/diff.sim
tests/script/tsim/query/diff.sim
+23
-22
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
ec0637df
...
...
@@ -737,7 +737,7 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int
int32_t
type
=
pResultInfo
->
fields
[
i
].
type
;
int32_t
bytes
=
pResultInfo
->
fields
[
i
].
bytes
;
if
(
type
==
TSDB_DATA_TYPE_NCHAR
)
{
if
(
type
==
TSDB_DATA_TYPE_NCHAR
&&
colLength
[
i
]
>
0
)
{
char
*
p
=
taosMemoryRealloc
(
pResultInfo
->
convertBuf
[
i
],
colLength
[
i
]);
if
(
p
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
ec0637df
...
...
@@ -1414,7 +1414,7 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
}
if
(
sVal
.
valType
==
TD_VTYPE_NULL
)
{
colDataAppend
(
pColInfo
,
k
,
NULL
,
true
);
colDataAppend
NULL
(
pColInfo
,
k
);
}
else
{
colDataAppend
(
pColInfo
,
k
,
sVal
.
val
,
false
);
}
...
...
@@ -1427,7 +1427,11 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
TASSERT
(
0
);
}
colDataAppend
(
pColInfo
,
k
,
sVal
.
val
,
false
);
if
(
sVal
.
valType
==
TD_VTYPE_NULL
)
{
colDataAppendNULL
(
pColInfo
,
k
);
}
else
{
colDataAppend
(
pColInfo
,
k
,
sVal
.
val
,
false
);
}
}
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
ec0637df
...
...
@@ -6682,38 +6682,6 @@ bool validateExprColumnInfo(SQueriedTableInfo* pTableInfo, SExprBasicInfo* pExpr
return
j
!=
INT32_MIN
;
}
static
int32_t
deserializeColFilterInfo
(
SColumnFilterInfo
*
pColFilters
,
int16_t
numOfFilters
,
char
**
pMsg
)
{
for
(
int32_t
f
=
0
;
f
<
numOfFilters
;
++
f
)
{
SColumnFilterInfo
*
pFilterMsg
=
(
SColumnFilterInfo
*
)(
*
pMsg
);
SColumnFilterInfo
*
pColFilter
=
&
pColFilters
[
f
];
pColFilter
->
filterstr
=
htons
(
pFilterMsg
->
filterstr
);
(
*
pMsg
)
+=
sizeof
(
SColumnFilterInfo
);
if
(
pColFilter
->
filterstr
)
{
pColFilter
->
len
=
htobe64
(
pFilterMsg
->
len
);
pColFilter
->
pz
=
(
int64_t
)
taosMemoryCalloc
(
1
,
(
size_t
)(
pColFilter
->
len
+
1
*
TSDB_NCHAR_SIZE
));
// note: null-terminator
if
(
pColFilter
->
pz
==
0
)
{
return
TSDB_CODE_QRY_OUT_OF_MEMORY
;
}
memcpy
((
void
*
)
pColFilter
->
pz
,
(
*
pMsg
),
(
size_t
)
pColFilter
->
len
);
(
*
pMsg
)
+=
(
pColFilter
->
len
+
1
);
}
else
{
pColFilter
->
lowerBndi
=
htobe64
(
pFilterMsg
->
lowerBndi
);
pColFilter
->
upperBndi
=
htobe64
(
pFilterMsg
->
upperBndi
);
}
pColFilter
->
lowerRelOptr
=
htons
(
pFilterMsg
->
lowerRelOptr
);
pColFilter
->
upperRelOptr
=
htons
(
pFilterMsg
->
upperRelOptr
);
}
return
TSDB_CODE_SUCCESS
;
}
static
SResSchema
createResSchema
(
int32_t
type
,
int32_t
bytes
,
int32_t
slotId
,
int32_t
scale
,
int32_t
precision
,
const
char
*
name
)
{
SResSchema
s
=
{
0
};
...
...
tests/script/tsim/query/diff.sim
浏览文件 @
ec0637df
...
...
@@ -63,20 +63,21 @@ print =============== step2
$i = 1
$tb = $tbPrefix . $i
print ===> select diff(tbcol) from $tb
sql select diff(tbcol) from $tb
print ===> select
_rowts,
diff(tbcol) from $tb
sql select
_rowts,
diff(tbcol) from $tb
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $data11 != 1 then
if $data11 != 1 then
print expect 1, actual: $data11
return -1
endi
print =============== step3
$cc = 4 * 60000
$ms = 1601481600000 + $cc
print ===> select diff(tbcol) from $tb where ts > $ms
sql select diff(tbcol) from $tb where ts > $ms
print ===> select
_rowts,
diff(tbcol) from $tb where ts > $ms
sql select
_rowts,
diff(tbcol) from $tb where ts > $ms
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
...
...
@@ -86,8 +87,8 @@ endi
$cc = 4 * 60000
$ms = 1601481600000 + $cc
print ===> select diff(tbcol) from $tb where ts <= $ms
sql select diff(tbcol) from $tb where ts <= $ms
print ===> select
_rowts,
diff(tbcol) from $tb where ts <= $ms
sql select
_rowts,
diff(tbcol) from $tb where ts <= $ms
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
...
...
@@ -96,8 +97,8 @@ if $data11 != 1 then
endi
print =============== step4
print ===> select diff(tbcol) as b from $tb
sql select diff(tbcol) as b from $tb
print ===> select
_rowts,
diff(tbcol) as b from $tb
sql select
_rowts,
diff(tbcol) as b from $tb
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
...
...
@@ -105,24 +106,24 @@ if $data11 != 1 then
return -1
endi
print =============== step5
print ===> select diff(tbcol) as b from $tb interval(1m)
sql select diff(tbcol) as b from $tb interval(1m) -x step5
return -1
step5:
print =============== step6
$cc = 4 * 60000
$ms = 1601481600000 + $cc
print ===> select diff(tbcol) as b from $tb where ts <= $ms interval(1m)
sql select diff(tbcol) as b from $tb where ts <= $ms interval(1m) -x step6
return -1
#
print =============== step5
#
print ===> select diff(tbcol) as b from $tb interval(1m)
#
sql select diff(tbcol) as b from $tb interval(1m) -x step5
#
return -1
#
step5:
#
#
print =============== step6
#
$cc = 4 * 60000
#
$ms = 1601481600000 + $cc
#
print ===> select diff(tbcol) as b from $tb where ts <= $ms interval(1m)
#
sql select diff(tbcol) as b from $tb where ts <= $ms interval(1m) -x step6
#
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows !=
0 then
if $rows !=
1 then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录