Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4481bb4e
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4481bb4e
编写于
6月 13, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: error in schemaless with same timestamp
上级
c54fc87a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
14 deletion
+38
-14
source/client/src/clientSml.c
source/client/src/clientSml.c
+13
-13
source/client/test/smlTest.cpp
source/client/test/smlTest.cpp
+25
-1
未找到文件。
source/client/src/clientSml.c
浏览文件 @
4481bb4e
...
@@ -1297,8 +1297,8 @@ static int32_t smlKvTimeArrayCompare(const void* key1, const void* key2) {
...
@@ -1297,8 +1297,8 @@ static int32_t smlKvTimeArrayCompare(const void* key1, const void* key2) {
static
int32_t
smlKvTimeHashCompare
(
const
void
*
key1
,
const
void
*
key2
)
{
static
int32_t
smlKvTimeHashCompare
(
const
void
*
key1
,
const
void
*
key2
)
{
SHashObj
*
s1
=
*
(
SHashObj
**
)
key1
;
SHashObj
*
s1
=
*
(
SHashObj
**
)
key1
;
SHashObj
*
s2
=
*
(
SHashObj
**
)
key2
;
SHashObj
*
s2
=
*
(
SHashObj
**
)
key2
;
SSmlKv
*
kv1
=
(
SSmlKv
*
)
taosHashGet
(
s1
,
TS
,
TS_LEN
);
SSmlKv
*
kv1
=
*
(
SSmlKv
*
*
)
taosHashGet
(
s1
,
TS
,
TS_LEN
);
SSmlKv
*
kv2
=
(
SSmlKv
*
)
taosHashGet
(
s2
,
TS
,
TS_LEN
);
SSmlKv
*
kv2
=
*
(
SSmlKv
*
*
)
taosHashGet
(
s2
,
TS
,
TS_LEN
);
ASSERT
(
kv1
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
);
ASSERT
(
kv1
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
);
ASSERT
(
kv2
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
);
ASSERT
(
kv2
->
type
==
TSDB_DATA_TYPE_TIMESTAMP
);
if
(
kv1
->
i
<
kv2
->
i
)
{
if
(
kv1
->
i
<
kv2
->
i
)
{
...
@@ -1316,17 +1316,17 @@ static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *col
...
@@ -1316,17 +1316,17 @@ static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *col
if
(
p
==
NULL
){
if
(
p
==
NULL
){
taosArrayPush
(
oneTable
->
cols
,
&
cols
);
taosArrayPush
(
oneTable
->
cols
,
&
cols
);
}
else
{
// to make the sort stable for update data
}
else
{
// to make the sort stable for update data
SArray
*
sa
=
(
SArray
*
)
p
;
SArray
*
sa
=
*
(
SArray
*
*
)
p
;
SSmlKv
*
cur
=
(
SSmlKv
*
)
taosArrayGet
(
sa
,
0
);
SSmlKv
*
cur
=
(
SSmlKv
*
)
taosArrayGet
P
(
sa
,
0
);
SSmlKv
*
dCur
=
(
SSmlKv
*
)
taosArrayGet
(
cols
,
0
);
SSmlKv
*
dCur
=
(
SSmlKv
*
)
taosArrayGet
P
(
cols
,
0
);
if
(
cur
->
i
>
dCur
->
i
){
if
(
cur
->
i
>
dCur
->
i
){
taosArrayInsert
(
oneTable
->
cols
,
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
),
&
cols
);
taosArrayInsert
(
oneTable
->
cols
,
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
),
&
cols
);
}
else
{
}
else
{
ASSERT
(
cur
->
i
==
dCur
->
i
);
ASSERT
(
cur
->
i
==
dCur
->
i
);
int32_t
index
=
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
)
+
1
;
int32_t
index
=
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
)
+
1
;
for
(;
index
<
taosArrayGetSize
(
oneTable
->
cols
);
index
++
){
for
(;
index
<
taosArrayGetSize
(
oneTable
->
cols
);
index
++
){
SArray
*
tmp
=
(
SArray
*
)
taosArrayGet
(
oneTable
->
cols
,
index
);
SArray
*
tmp
=
(
SArray
*
)
taosArrayGet
P
(
oneTable
->
cols
,
index
);
SSmlKv
*
curTs
=
(
SSmlKv
*
)
taosArrayGet
(
tmp
,
0
);
SSmlKv
*
curTs
=
(
SSmlKv
*
)
taosArrayGet
P
(
tmp
,
0
);
if
(
curTs
->
i
>
dCur
->
i
){
if
(
curTs
->
i
>
dCur
->
i
){
break
;
break
;
}
}
...
@@ -1351,22 +1351,22 @@ static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *col
...
@@ -1351,22 +1351,22 @@ static int32_t smlDealCols(SSmlTableInfo* oneTable, bool dataFormat, SArray *col
if
(
p
==
NULL
){
if
(
p
==
NULL
){
taosArrayPush
(
oneTable
->
cols
,
&
kvHash
);
taosArrayPush
(
oneTable
->
cols
,
&
kvHash
);
}
else
{
// to make the sort stable for update data
}
else
{
// to make the sort stable for update data
SHashObj
*
sa
=
(
SHashObj
*
)
p
;
SHashObj
*
sa
=
*
(
SHashObj
*
*
)
p
;
SSmlKv
*
cur
=
(
SSmlKv
*
)
taosHashGet
(
sa
,
TS
,
TS_LEN
);
SSmlKv
*
cur
=
*
(
SSmlKv
*
*
)
taosHashGet
(
sa
,
TS
,
TS_LEN
);
SSmlKv
*
dCur
=
(
SSmlKv
*
)
taosArrayGet
(
cols
,
0
);
SSmlKv
*
dCur
=
(
SSmlKv
*
)
taosArrayGet
P
(
cols
,
0
);
if
(
cur
->
i
>
dCur
->
i
){
if
(
cur
->
i
>
dCur
->
i
){
taosArrayInsert
(
oneTable
->
cols
,
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
),
&
cols
);
taosArrayInsert
(
oneTable
->
cols
,
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
),
&
cols
);
}
else
{
}
else
{
ASSERT
(
cur
->
i
==
dCur
->
i
);
ASSERT
(
cur
->
i
==
dCur
->
i
);
int32_t
index
=
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
)
+
1
;
int32_t
index
=
TARRAY_ELEM_IDX
(
oneTable
->
cols
,
p
)
+
1
;
for
(;
index
<
taosArrayGetSize
(
oneTable
->
cols
);
index
++
){
for
(;
index
<
taosArrayGetSize
(
oneTable
->
cols
);
index
++
){
SHashObj
*
tmp
=
(
SHashObj
*
)
taosArrayGet
(
oneTable
->
cols
,
index
);
SHashObj
*
tmp
=
(
SHashObj
*
)
taosArrayGet
P
(
oneTable
->
cols
,
index
);
SSmlKv
*
curTs
=
(
SSmlKv
*
)
taosHashGet
(
tmp
,
TS
,
TS_LEN
);
SSmlKv
*
curTs
=
*
(
SSmlKv
*
*
)
taosHashGet
(
tmp
,
TS
,
TS_LEN
);
if
(
curTs
->
i
>
dCur
->
i
){
if
(
curTs
->
i
>
dCur
->
i
){
break
;
break
;
}
}
}
}
taosArrayInsert
(
oneTable
->
cols
,
index
,
&
cols
);
taosArrayInsert
(
oneTable
->
cols
,
index
,
&
kvHash
);
}
}
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
source/client/test/smlTest.cpp
浏览文件 @
4481bb4e
...
@@ -1260,4 +1260,28 @@ TEST(testCase, sml_16368_Test) {
...
@@ -1260,4 +1260,28 @@ TEST(testCase, sml_16368_Test) {
pRes = taos_schemaless_insert(taos, (char**)sql, sizeof(sql)/sizeof(sql[0]), TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_MICRO_SECONDS);
pRes = taos_schemaless_insert(taos, (char**)sql, sizeof(sql)/sizeof(sql[0]), TSDB_SML_JSON_PROTOCOL, TSDB_SML_TIMESTAMP_MICRO_SECONDS);
ASSERT_EQ(taos_errno(pRes), 0);
ASSERT_EQ(taos_errno(pRes), 0);
taos_free_result(pRes);
taos_free_result(pRes);
}*/
}
TEST(testCase, sml_dup_time_Test) {
TAOS *taos = taos_connect("localhost", "root", "taosdata", NULL, 0);
ASSERT_NE(taos, nullptr);
TAOS_RES* pRes = taos_query(taos, "create database if not exists dup_time schemaless 1");
taos_free_result(pRes);
const char *sql[] = {
//"test_ms,t0=t c0=f 1626006833641",
"ubzlsr,id=qmtcvgd,t0=t,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=false,c1=1i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"xcxvwjvf\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000",
"ubzlsr,id=qmtcvgd,t0=t,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=T,c1=2i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"fixrzcuq\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000",
"ubzlsr,id=qmtcvgd,t0=t,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=t,c1=3i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"iupzdqub\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000",
"ubzlsr,id=qmtcvgd,t0=t,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=t,c1=4i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"yvvtzzof\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000",
"ubzlsr,id=qmtcvgd,t0=t,t1=127i8,t2=32767i16,t3=2147483647i32,t4=9223372036854775807i64,t5=11.12345f32,t6=22.123456789f64,t7=\"binaryTagValue\",t8=L\"ncharTagValue\" c0=t,c1=5i8,c2=32767i16,c3=2147483647i32,c4=9223372036854775807i64,c5=11.12345f32,c6=22.123456789f64,c7=\"vbxpilkj\",c8=L\"ncharColValue\",c9=7u64 1626006833639000000"
};
pRes = taos_query(taos, "use dup_time");
taos_free_result(pRes);
pRes = taos_schemaless_insert(taos, (char**)sql, sizeof(sql)/sizeof(sql[0]), TSDB_SML_LINE_PROTOCOL, 0);
ASSERT_EQ(taos_errno(pRes), 0);
taos_free_result(pRes);
}
*/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录