Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a2d7ce30
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看板
提交
a2d7ce30
编写于
3月 24, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-14246] fix bug.
上级
e5d7cd15
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
47 deletion
+7
-47
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+3
-44
tests/script/tsim/insert/basic1.sim
tests/script/tsim/insert/basic1.sim
+4
-3
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
a2d7ce30
...
@@ -1377,7 +1377,6 @@ static int doBinarySearchKey(char* pValue, int num, TSKEY key, int order) {
...
@@ -1377,7 +1377,6 @@ static int doBinarySearchKey(char* pValue, int num, TSKEY key, int order) {
}
}
static
int32_t
doCopyRowsFromFileBlock
(
STsdbReadHandle
*
pTsdbReadHandle
,
int32_t
capacity
,
int32_t
numOfRows
,
int32_t
start
,
int32_t
end
)
{
static
int32_t
doCopyRowsFromFileBlock
(
STsdbReadHandle
*
pTsdbReadHandle
,
int32_t
capacity
,
int32_t
numOfRows
,
int32_t
start
,
int32_t
end
)
{
char
*
pData
=
NULL
;
int32_t
step
=
ASCENDING_TRAVERSE
(
pTsdbReadHandle
->
order
)
?
1
:
-
1
;
int32_t
step
=
ASCENDING_TRAVERSE
(
pTsdbReadHandle
->
order
)
?
1
:
-
1
;
SDataCols
*
pCols
=
pTsdbReadHandle
->
rhelper
.
pDCols
[
0
];
SDataCols
*
pCols
=
pTsdbReadHandle
->
rhelper
.
pDCols
[
0
];
...
@@ -1454,14 +1453,12 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
...
@@ -1454,14 +1453,12 @@ static int32_t doCopyRowsFromFileBlock(STsdbReadHandle* pTsdbReadHandle, int32_t
return
numOfRows
+
num
;
return
numOfRows
+
num
;
}
}
// TODO fix bug for reverse copy data
// TODO fix bug for reverse copy data problem
// TODO handle the null data
// Note: row1 always has high priority
// Note: row1 always has high priority
static
void
mergeTwoRowFromMem
(
STsdbReadHandle
*
pTsdbReadHandle
,
int32_t
capacity
,
int32_t
numOfRows
,
STSRow
*
row1
,
static
void
mergeTwoRowFromMem
(
STsdbReadHandle
*
pTsdbReadHandle
,
int32_t
capacity
,
int32_t
numOfRows
,
STSRow
*
row1
,
STSRow
*
row2
,
int32_t
numOfCols
,
uint64_t
uid
,
STSchema
*
pSchema1
,
STSchema
*
pSchema2
,
STSRow
*
row2
,
int32_t
numOfCols
,
uint64_t
uid
,
STSchema
*
pSchema1
,
STSchema
*
pSchema2
,
bool
forceSetNull
)
{
bool
forceSetNull
)
{
#if 1
#if 1
char
*
pData
=
NULL
;
STSchema
*
pSchema
;
STSchema
*
pSchema
;
STSRow
*
row
;
STSRow
*
row
;
int16_t
colId
;
int16_t
colId
;
...
@@ -1503,12 +1500,6 @@ static void mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capacit
...
@@ -1503,12 +1500,6 @@ static void mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capacit
while
(
i
<
numOfCols
&&
(
j
<
numOfColsOfRow1
||
k
<
numOfColsOfRow2
))
{
while
(
i
<
numOfCols
&&
(
j
<
numOfColsOfRow1
||
k
<
numOfColsOfRow2
))
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pTsdbReadHandle
->
pColumns
,
i
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pTsdbReadHandle
->
pColumns
,
i
);
if
(
ASCENDING_TRAVERSE
(
pTsdbReadHandle
->
order
))
{
pData
=
(
char
*
)
pColInfo
->
pData
+
numOfRows
*
pColInfo
->
info
.
bytes
;
}
else
{
pData
=
(
char
*
)
pColInfo
->
pData
+
(
capacity
-
numOfRows
-
1
)
*
pColInfo
->
info
.
bytes
;
}
int32_t
colIdOfRow1
;
int32_t
colIdOfRow1
;
if
(
j
>=
numOfColsOfRow1
)
{
if
(
j
>=
numOfColsOfRow1
)
{
colIdOfRow1
=
INT32_MAX
;
colIdOfRow1
=
INT32_MAX
;
...
@@ -1571,43 +1562,11 @@ static void mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capacit
...
@@ -1571,43 +1562,11 @@ static void mergeTwoRowFromMem(STsdbReadHandle* pTsdbReadHandle, int32_t capacit
if
(
colId
==
pColInfo
->
info
.
colId
)
{
if
(
colId
==
pColInfo
->
info
.
colId
)
{
if
(
tdValTypeIsNorm
(
sVal
.
valType
))
{
if
(
tdValTypeIsNorm
(
sVal
.
valType
))
{
switch
(
pColInfo
->
info
.
type
)
{
colDataAppend
(
pColInfo
,
numOfRows
,
sVal
.
val
,
false
);
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
memcpy
(
pData
,
sVal
.
val
,
varDataTLen
(
sVal
.
val
));
break
;
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_TINYINT
:
case
TSDB_DATA_TYPE_UTINYINT
:
*
(
uint8_t
*
)
pData
=
*
(
uint8_t
*
)
sVal
.
val
;
break
;
case
TSDB_DATA_TYPE_SMALLINT
:
case
TSDB_DATA_TYPE_USMALLINT
:
*
(
uint16_t
*
)
pData
=
*
(
uint16_t
*
)
sVal
.
val
;
break
;
case
TSDB_DATA_TYPE_INT
:
case
TSDB_DATA_TYPE_UINT
:
*
(
uint32_t
*
)
pData
=
*
(
uint32_t
*
)
sVal
.
val
;
break
;
case
TSDB_DATA_TYPE_BIGINT
:
case
TSDB_DATA_TYPE_UBIGINT
:
*
(
uint64_t
*
)
pData
=
*
(
uint64_t
*
)
sVal
.
val
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
SET_FLOAT_PTR
(
pData
,
sVal
.
val
);
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
SET_DOUBLE_PTR
(
pData
,
sVal
.
val
);
break
;
case
TSDB_DATA_TYPE_TIMESTAMP
:
*
(
TSKEY
*
)
pData
=
*
(
TSKEY
*
)
sVal
.
val
;
break
;
default:
memcpy
(
pData
,
sVal
.
val
,
pColInfo
->
info
.
bytes
);
}
}
else
if
(
forceSetNull
)
{
}
else
if
(
forceSetNull
)
{
colDataAppend
(
pColInfo
,
numOfRows
,
NULL
,
true
);
colDataAppend
(
pColInfo
,
numOfRows
,
NULL
,
true
);
}
}
i
++
;
i
++
;
if
(
row
==
row1
)
{
if
(
row
==
row1
)
{
...
...
tests/script/tsim/insert/basic1.sim
浏览文件 @
a2d7ce30
...
@@ -55,7 +55,8 @@ if $rows != 4 then
...
@@ -55,7 +55,8 @@ if $rows != 4 then
return -1
return -1
endi
endi
if $data01 != true then
if $data01 != 1 then
print expect 1, actual: $data01
return -1
return -1
endi
endi
...
@@ -80,7 +81,7 @@ system sh/exec.sh -n dnode1 -s start
...
@@ -80,7 +81,7 @@ system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
$loop_cnt = 0
check_dnode_ready:
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
$loop_cnt = $loop_cnt + 1
sleep
1
00
sleep
2
00
if $loop_cnt == 10 then
if $loop_cnt == 10 then
print ====> dnode not ready!
print ====> dnode not ready!
return -1
return -1
...
@@ -105,7 +106,7 @@ if $rows != 4 then
...
@@ -105,7 +106,7 @@ if $rows != 4 then
return -1
return -1
endi
endi
if $data01 !=
true then
if $data01 !=
1 then
return -1
return -1
endi
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录