Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
572e1066
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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,发现更多精彩内容 >>
提交
572e1066
编写于
6月 21, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:affect row in schemaless & md5
上级
81acad62
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
22 addition
and
13 deletion
+22
-13
source/client/src/clientSml.c
source/client/src/clientSml.c
+5
-3
source/client/test/smlTest.cpp
source/client/test/smlTest.cpp
+6
-6
source/common/src/tname.c
source/common/src/tname.c
+11
-4
未找到文件。
source/client/src/clientSml.c
浏览文件 @
572e1066
...
...
@@ -2389,17 +2389,19 @@ static int32_t isSchemalessDb(STscObj *taos, SRequestObj *request) {
static
void
smlInsertCallback
(
void
*
param
,
void
*
res
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
(
SRequestObj
*
)
res
;
SSmlHandle
*
info
=
(
SSmlHandle
*
)
param
;
int32_t
rows
=
taos_affected_rows
(
pRequest
);
uDebug
(
"SML:0x%"
PRIx64
" result. code:%d, msg:%s"
,
info
->
id
,
pRequest
->
code
,
pRequest
->
msgBuf
);
// lock
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
taosThreadSpinLock
(
&
info
->
params
->
lock
);
info
->
params
->
request
->
body
.
resInfo
.
numOfRows
+=
rows
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
info
->
params
->
request
->
code
=
code
;
taosThreadSpinUnlock
(
&
info
->
params
->
lock
);
}
taosThreadSpinUnlock
(
&
info
->
params
->
lock
);
// unlock
printf
(
"SML:0x%"
PRIx64
" insert finished, code: %d, total: %d
\n
"
,
info
->
id
,
code
,
info
->
affectedRows
);
uDebug
(
"SML:0x%"
PRIx64
" insert finished, code: %d, rows: %d, total: %d"
,
info
->
id
,
code
,
rows
,
info
->
affectedRows
);
Params
*
pParam
=
info
->
params
;
bool
isLast
=
info
->
isLast
;
info
->
cost
.
endTime
=
taosGetTimestampUs
();
...
...
source/client/test/smlTest.cpp
浏览文件 @
572e1066
...
...
@@ -1261,7 +1261,7 @@ TEST(testCase, sml_16368_Test) {
ASSERT_EQ(taos_errno(pRes), 0);
taos_free_result(pRes);
}
*/
TEST
(
testCase
,
sml_dup_time_Test
)
{
TAOS
*
taos
=
taos_connect
(
"localhost"
,
"root"
,
"taosdata"
,
NULL
,
0
);
ASSERT_NE
(
taos
,
nullptr
);
...
...
@@ -1272,10 +1272,10 @@ TEST(testCase, sml_dup_time_Test) {
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 162600683
3
639000000",
"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 162600683
3
639000000",
"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 162600683
3
639000000",
"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 162600683
3
639000000"
"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 162600683
4
639000000"
,
"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 162600683
5
639000000"
,
"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 162600683
6
639000000"
,
"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 162600683
7
639000000"
};
pRes
=
taos_query
(
taos
,
"use dup_time"
);
taos_free_result
(
pRes
);
...
...
@@ -1284,4 +1284,4 @@ TEST(testCase, sml_dup_time_Test) {
ASSERT_EQ
(
taos_errno
(
pRes
),
0
);
taos_free_result
(
pRes
);
}
*/
source/common/src/tname.c
浏览文件 @
572e1066
...
...
@@ -312,8 +312,10 @@ void buildChildTableName(RandTableName* rName) {
taosStringBuilderAppendStringLen
(
&
sb
,
rName
->
sTableName
,
rName
->
sTableNameLen
);
taosArraySort
(
rName
->
tags
,
compareKv
);
for
(
int
j
=
0
;
j
<
taosArrayGetSize
(
rName
->
tags
);
++
j
)
{
taosStringBuilderAppendChar
(
&
sb
,
','
);
SSmlKv
*
tagKv
=
taosArrayGetP
(
rName
->
tags
,
j
);
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
key
,
tagKv
->
keyLen
);
taosStringBuilderAppendChar
(
&
sb
,
'='
);
if
(
IS_VAR_DATA_TYPE
(
tagKv
->
type
))
{
taosStringBuilderAppendStringLen
(
&
sb
,
tagKv
->
value
,
tagKv
->
length
);
}
else
{
...
...
@@ -326,9 +328,14 @@ void buildChildTableName(RandTableName* rName) {
tMD5Init
(
&
context
);
tMD5Update
(
&
context
,
(
uint8_t
*
)
keyJoined
,
(
uint32_t
)
len
);
tMD5Final
(
&
context
);
uint64_t
digest1
=
*
(
uint64_t
*
)(
context
.
digest
);
uint64_t
digest2
=
*
(
uint64_t
*
)(
context
.
digest
+
8
);
snprintf
(
rName
->
childTableName
,
TSDB_TABLE_NAME_LEN
,
"t_%016"
PRIx64
"%016"
PRIx64
,
digest1
,
digest2
);
char
temp
[
8
]
=
{
0
};
rName
->
childTableName
[
0
]
=
't'
;
rName
->
childTableName
[
1
]
=
'_'
;
for
(
int
i
=
0
;
i
<
16
;
i
++
){
sprintf
(
temp
,
"%02x"
,
context
.
digest
[
i
]);
strcat
(
rName
->
childTableName
,
temp
);
}
taosStringBuilderDestroy
(
&
sb
);
rName
->
uid
=
digest1
;
rName
->
uid
=
*
(
uint64_t
*
)(
context
.
digest
)
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录