Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f7ba4b8d
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
f7ba4b8d
编写于
10月 10, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10532]<enhance>: schemaless fix test cases
上级
3d110dd3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
106 addition
and
85 deletion
+106
-85
src/client/inc/tscParseLine.h
src/client/inc/tscParseLine.h
+2
-1
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+6
-3
src/client/src/tscParseOpenTSDB.c
src/client/src/tscParseOpenTSDB.c
+1
-1
tests/examples/c/apitest.c
tests/examples/c/apitest.c
+2
-1
tests/pytest/insert/insertJSONPayload.py
tests/pytest/insert/insertJSONPayload.py
+23
-7
tests/pytest/insert/insertTelnetLines.py
tests/pytest/insert/insertTelnetLines.py
+19
-19
tests/script/api/openTSDBTest.c
tests/script/api/openTSDBTest.c
+53
-53
未找到文件。
src/client/inc/tscParseLine.h
浏览文件 @
f7ba4b8d
...
...
@@ -47,7 +47,8 @@ typedef enum {
SML_TIME_STAMP_SECONDS
,
SML_TIME_STAMP_MILLI_SECONDS
,
SML_TIME_STAMP_MICRO_SECONDS
,
SML_TIME_STAMP_NANO_SECONDS
SML_TIME_STAMP_NANO_SECONDS
,
SML_TIME_STAMP_NOT_CONFIGURED
}
SMLTimeStampType
;
typedef
enum
{
...
...
src/client/src/tscParseLineProtocol.c
浏览文件 @
f7ba4b8d
...
...
@@ -1408,7 +1408,7 @@ static bool isTimeStamp(char *pVal, uint16_t len, SMLTimeStampType *tsType, SSml
//Default no appendix
if
(
isdigit
(
pVal
[
len
-
1
])
&&
isdigit
(
pVal
[
len
-
2
]))
{
if
(
info
->
protocol
==
SML_LINE_PROTOCOL
)
{
if
(
info
->
protocol
==
SML_LINE_PROTOCOL
&&
info
->
tsType
!=
SML_TIME_STAMP_NOT_CONFIGURED
)
{
*
tsType
=
info
->
tsType
;
}
else
if
(
info
->
protocol
==
SML_TELNET_PROTOCOL
)
{
if
(
len
==
SML_TIMESTAMP_SECOND_DIGITS
)
{
...
...
@@ -2018,8 +2018,7 @@ static int32_t parseSmlKvPairs(TAOS_SML_KV **pKVs, int *num_kvs,
tscError
(
"SML:0x%"
PRIx64
" Unable to parse value"
,
info
->
id
);
goto
error
;
}
if
(
!
isField
&&
(
strcasecmp
(
pkv
->
key
,
"ID"
)
==
0
)
&&
pkv
->
type
==
TSDB_DATA_TYPE_BINARY
)
{
if
(
!
isField
&&
(
strcasecmp
(
pkv
->
key
,
"ID"
)
==
0
))
{
ret
=
isValidChildTableName
(
pkv
->
value
,
pkv
->
length
,
info
);
if
(
ret
)
{
goto
error
;
...
...
@@ -2233,6 +2232,10 @@ cleanup:
}
int32_t
convertPrecisionStrType
(
char
*
precision
,
SMLTimeStampType
*
tsType
)
{
if
(
precision
==
NULL
)
{
*
tsType
=
SML_TIME_STAMP_NOT_CONFIGURED
;
return
TSDB_CODE_SUCCESS
;
}
int32_t
len
=
(
int32_t
)
strlen
(
precision
);
if
(
len
==
1
&&
precision
[
0
]
==
's'
)
{
*
tsType
=
SML_TIME_STAMP_SECONDS
;
...
...
src/client/src/tscParseOpenTSDB.c
浏览文件 @
f7ba4b8d
...
...
@@ -297,7 +297,7 @@ static int32_t parseTelnetTagKvs(TAOS_SML_KV **pKVs, int *num_kvs,
tscError
(
"OTD:0x%"
PRIx64
" Unable to parse value"
,
info
->
id
);
return
ret
;
}
if
((
strcasecmp
(
pkv
->
key
,
"ID"
)
==
0
)
&&
pkv
->
type
==
TSDB_DATA_TYPE_BINARY
)
{
if
((
strcasecmp
(
pkv
->
key
,
"ID"
)
==
0
))
{
ret
=
isValidChildTableName
(
pkv
->
value
,
pkv
->
length
,
info
);
if
(
ret
)
{
return
ret
;
...
...
tests/examples/c/apitest.c
浏览文件 @
f7ba4b8d
...
...
@@ -990,7 +990,7 @@ int32_t verify_schema_less(TAOS* taos) {
code
=
taos_schemaless_insert
(
taos
,
&
lines2
[
1
],
1
,
0
,
"ns"
);
char
*
lines3
[]
=
{
"sth,t1=4i64,t2=5f64,t4=5f64,ID=
\"
childtable
\"
c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933641"
,
"sth,t1=4i64,t2=5f64,t4=5f64,ID=
childTable
c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933641"
,
"sth,t1=4i64,t2=5f64,t4=5f64 c1=3i64,c3=L
\"
passitagin_stf
\"
,c2=false,c5=5f64,c6=7u64 1626006933654"
};
code
=
taos_schemaless_insert
(
taos
,
lines3
,
2
,
0
,
"ms"
);
...
...
@@ -1036,6 +1036,7 @@ int main(int argc, char *argv[]) {
printf
(
"************ verify schema-less *************
\n
"
);
verify_schema_less
(
taos
);
return
0
;
printf
(
"************ verify query *************
\n
"
);
verify_query
(
taos
);
...
...
tests/pytest/insert/insertJSONPayload.py
浏览文件 @
f7ba4b8d
...
...
@@ -36,7 +36,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": ".stb.0.",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": 10,
"tags": {
"t1": true,
...
...
@@ -57,7 +57,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": "stb0_0",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": 10,
"tags": {
"t1": true,
...
...
@@ -76,7 +76,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": "stb0_1",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": true,
"tags": {
"t1": true,
...
...
@@ -95,7 +95,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": "stb0_2",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": false,
"tags": {
"t1": true,
...
...
@@ -114,7 +114,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": "stb0_3",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>",
"tags": {
"t1": true,
...
...
@@ -133,7 +133,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": "stb0_4",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": 3.14,
"tags": {
"t1": true,
...
...
@@ -152,7 +152,7 @@ class TDTestCase:
payload
=
[
'''
{
"metric": "stb0_5",
"timestamp": 1626006833610
123
,
"timestamp": 1626006833610,
"value": 3.14E-2,
"tags": {
"t1": true,
...
...
@@ -187,6 +187,22 @@ class TDTestCase:
code
=
self
.
_conn
.
schemaless_insert
(
payload
,
2
)
print
(
"schemaless_insert result {}"
.
format
(
code
))
### timestamp 10 digits second ###
payload
=
[
'''
{
"metric": "stb0_7",
"timestamp": 1626006833,
"value": 123,
"tags": {
"t1": true,
"t2": false,
"t3": 10,
"t4": "123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"
}
}
'''
]
code
=
self
.
_conn
.
schemaless_insert
(
payload
,
2
)
print
(
"schemaless_insert result {}"
.
format
(
code
))
print
(
"============= step3 : test tags ================"
)
### Default tag numeric types ###
...
...
tests/pytest/insert/insertTelnetLines.py
浏览文件 @
f7ba4b8d
...
...
@@ -63,16 +63,17 @@ class TDTestCase:
"stb1 1626006833s 1i8 host=
\"
host0
\"
"
,
"stb1 1626006833639000000ns 2i8 host=
\"
host0
\"
"
,
"stb1 1626006833640000us 3i8 host=
\"
host0
\"
"
,
"stb1 1626006833641123 4i8 host=
\"
host0
\"
"
,
"stb1 1626006833651ms 5i8 host=
\"
host0
\"
"
,
"stb1 0 6i8 host=
\"
host0
\"
"
,
"stb1 1626006833641 4i8 host=
\"
host0
\"
"
,
"stb1 1626006834 5i8 host=
\"
host0
\"
"
,
"stb1 1626006833651ms 6i8 host=
\"
host0
\"
"
,
"stb1 0 7i8 host=
\"
host0
\"
"
,
]
code
=
self
.
_conn
.
schemaless_insert
(
lines1
,
1
)
print
(
"schemaless_insert result {}"
.
format
(
code
))
tdSql
.
query
(
"select * from stb1"
)
tdSql
.
checkRows
(
6
)
tdSql
.
checkRows
(
7
)
### metric value ###
print
(
"============= step3 : test metric value ================"
)
...
...
@@ -126,15 +127,14 @@ class TDTestCase:
#bigint
lines2_3
=
[
"stb2_3 1626006833651ms -9223372036854775807i64 host=
\"
host0
\"
"
,
"stb2_3 1626006833652ms 9223372036854775807i64 host=
\"
host0
\"
"
,
"stb2_3 1626006833662ms 9223372036854775807 host=
\"
host0
\"
"
"stb2_3 1626006833652ms 9223372036854775807i64 host=
\"
host0
\"
"
]
code
=
self
.
_conn
.
schemaless_insert
(
lines2_3
,
1
)
print
(
"schemaless_insert result {}"
.
format
(
code
))
tdSql
.
query
(
"select * from stb2_3"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"describe stb2_3"
)
tdSql
.
checkRows
(
3
)
...
...
@@ -176,7 +176,7 @@ class TDTestCase:
"stb2_5 1626006833680ms -3.4e-2f64 host=
\"
host0
\"
"
,
"stb2_5 1626006833690ms 1.7E308f64 host=
\"
host0
\"
"
,
"stb2_5 1626006833700ms -1.7E308f64 host=
\"
host0
\"
"
,
"stb2_5 1626006833710ms 3
.15
host=
\"
host0
\"
"
"stb2_5 1626006833710ms 3 host=
\"
host0
\"
"
]
code
=
self
.
_conn
.
schemaless_insert
(
lines2_5
,
1
)
...
...
@@ -263,28 +263,28 @@ class TDTestCase:
tdSql
.
query
(
"describe stb3_0"
)
tdSql
.
checkRows
(
11
)
tdSql
.
checkData
(
2
,
1
,
"
TINYINT
"
)
tdSql
.
checkData
(
2
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
2
,
3
,
"TAG"
)
tdSql
.
checkData
(
3
,
1
,
"
SMALLINT
"
)
tdSql
.
checkData
(
3
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
3
,
3
,
"TAG"
)
tdSql
.
checkData
(
4
,
1
,
"
INT
"
)
tdSql
.
checkData
(
4
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
4
,
3
,
"TAG"
)
tdSql
.
checkData
(
5
,
1
,
"
BIGINT
"
)
tdSql
.
checkData
(
5
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
5
,
3
,
"TAG"
)
tdSql
.
checkData
(
6
,
1
,
"
FLOAT
"
)
tdSql
.
checkData
(
6
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
6
,
3
,
"TAG"
)
tdSql
.
checkData
(
7
,
1
,
"
DOUBLE
"
)
tdSql
.
checkData
(
7
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
7
,
3
,
"TAG"
)
tdSql
.
checkData
(
8
,
1
,
"
BOOL
"
)
tdSql
.
checkData
(
8
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
8
,
3
,
"TAG"
)
tdSql
.
checkData
(
9
,
1
,
"
BINARY
"
)
tdSql
.
checkData
(
9
,
1
,
"
NCHAR
"
)
tdSql
.
checkData
(
9
,
3
,
"TAG"
)
tdSql
.
checkData
(
10
,
1
,
"NCHAR"
)
...
...
@@ -293,9 +293,9 @@ class TDTestCase:
#tag ID as child table name
lines3_1
=
[
"stb3_1 1626006833610ms 1 id=
\"
child_table1
\"
host=
\"
host1
\"
"
,
"stb3_1 1626006833610ms 2 host=
\"
host2
\"
iD=
\"
child_table2
\"
"
,
"stb3_1 1626006833610ms 3 ID=
\"
child_table3
\"
host=
\"
host3
\"
"
"stb3_1 1626006833610ms 1 id=
child_table1 host=host1
"
,
"stb3_1 1626006833610ms 2 host=
host2 iD=child_table2
"
,
"stb3_1 1626006833610ms 3 ID=
child_table3 host=host3
"
]
code
=
self
.
_conn
.
schemaless_insert
(
lines3_1
,
1
)
...
...
tests/script/api/openTSDBTest.c
浏览文件 @
f7ba4b8d
...
...
@@ -26,7 +26,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb0_1 1626006833639000000ns 4i8 host=
\"
host0
\"
interface=
\"
eth0
\"
"
,
"stb0_2 1626006833639000000ns 4i8 host=
\"
host0
\"
interface=
\"
eth0
\"
"
,
};
code
=
taos_schemaless_insert
(
taos
,
lines0
,
3
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines0
,
3
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -36,11 +36,12 @@ void verify_telnet_insert(TAOS* taos) {
"stb1 1626006833s 1i8 host=
\"
host0
\"
"
,
"stb1 1626006833639000000ns 2i8 host=
\"
host0
\"
"
,
"stb1 1626006833640000us 3i8 host=
\"
host0
\"
"
,
"stb1 1626006833641123 4i8 host=
\"
host0
\"
"
,
"stb1 1626006833651ms 5i8 host=
\"
host0
\"
"
,
"stb1 0 6i8 host=
\"
host0
\"
"
,
"stb1 1626006833641 4i8 host=
\"
host0
\"
"
,
"stb1 1626006832 5i8 host=
\"
host0
\"
"
,
"stb1 1626006833651ms 6i8 host=
\"
host0
\"
"
,
"stb1 0 7i8 host=
\"
host0
\"
"
,
};
code
=
taos_schemaless_insert
(
taos
,
lines1
,
6
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines1
,
7
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -51,7 +52,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_0 1626006833651ms -127i8 host=
\"
host0
\"
"
,
"stb2_0 1626006833652ms 127i8 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_0
,
2
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_0
,
2
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -61,7 +62,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_1 1626006833651ms -32767i16 host=
\"
host0
\"
"
,
"stb2_1 1626006833652ms 32767i16 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_1
,
2
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_1
,
2
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -71,7 +72,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_2 1626006833651ms -2147483647i32 host=
\"
host0
\"
"
,
"stb2_2 1626006833652ms 2147483647i32 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_2
,
2
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_2
,
2
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -79,10 +80,9 @@ void verify_telnet_insert(TAOS* taos) {
//bigint
char
*
lines2_3
[]
=
{
"stb2_3 1626006833651ms -9223372036854775807i64 host=
\"
host0
\"
"
,
"stb2_3 1626006833652ms 9223372036854775807i64 host=
\"
host0
\"
"
,
"stb2_3 1626006833662ms 9223372036854775807 host=
\"
host0
\"
"
"stb2_3 1626006833652ms 9223372036854775807i64 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_3
,
3
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_3
,
2
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_3 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -100,7 +100,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_4 1626006833700ms 3.4E38f32 host=
\"
host0
\"
"
,
"stb2_4 1626006833710ms -3.4E38f32 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_4
,
10
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_4
,
10
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -119,7 +119,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_5 1626006833700ms -1.7E308f64 host=
\"
host0
\"
"
,
"stb2_5 1626006833710ms 3.15 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_5
,
11
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_5
,
11
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_5 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -137,7 +137,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_6 1626006833690ms False host=
\"
host0
\"
"
,
"stb2_6 1626006833700ms FALSE host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_6
,
10
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_6
,
10
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_6 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -148,7 +148,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_7 1626006833620ms
\"
binary_val.:;,./?|+-=
\"
host=
\"
host0
\"
"
,
"stb2_7 1626006833630ms
\"
binary_val.()[]{}<>
\"
host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_7
,
3
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_7
,
3
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_7 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -158,7 +158,7 @@ void verify_telnet_insert(TAOS* taos) {
"stb2_8 1626006833610ms L
\"
nchar_val数值一
\"
host=
\"
host0
\"
"
,
"stb2_8 1626006833620ms L
\"
nchar_val数值二
\"
host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_8
,
2
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines2_8
,
2
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines2_8 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -169,18 +169,18 @@ void verify_telnet_insert(TAOS* taos) {
"stb3_0 1626006833610ms 1 t1=127i8 t2=32767i16 t3=2147483647i32 t4=9223372036854775807i64 t5=3.4E38f32 t6=1.7E308f64 t7=true t8=
\"
binary_val_1
\"
t9=L
\"
标签值1
\"
"
,
"stb3_0 1626006833610ms 2 t1=-127i8 t2=-32767i16 t3=-2147483647i32 t4=-9223372036854775807i64 t5=-3.4E38f32 t6=-1.7E308f64 t7=false t8=
\"
binary_val_2
\"
t9=L
\"
标签值2
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines3_0
,
2
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines3_0
,
2
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines3_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
//tag ID as child table name
char
*
lines3_1
[]
=
{
"stb3_1 1626006833610ms 1 id=
\"
child_table1
\"
host=
\"
host1
\"
"
,
"stb3_1 1626006833610ms 2 host=
\"
host2
\"
iD=
\"
child_table2
\"
"
,
"stb3_1 1626006833610ms 3 ID=
\"
child_table3
\"
host=
\"
host3
\"
"
"stb3_1 1626006833610ms 1 id=
child_table1 host=host1
"
,
"stb3_1 1626006833610ms 2 host=
host2 iD=child_table2
"
,
"stb3_1 1626006833610ms 3 ID=
child_table3 host=host3
"
};
code
=
taos_schemaless_insert
(
taos
,
lines3_1
,
3
,
1
);
code
=
taos_schemaless_insert
(
taos
,
lines3_1
,
3
,
1
,
NULL
);
if
(
code
)
{
printf
(
"lines3_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -204,7 +204,7 @@ void verify_json_insert(TAOS* taos) {
char
*
message
[]
=
{
"{ \
\"
metric
\"
:
\"
cpu_load_0
\"
, \
\"
timestamp
\"
: 1626006833610
123,
\
\"
timestamp
\"
: 1626006833610
,
\
\"
value
\"
: 55.5, \
\"
tags
\"
: \
{ \
...
...
@@ -214,7 +214,7 @@ void verify_json_insert(TAOS* taos) {
} \
}"
};
code
=
taos_schemaless_insert
(
taos
,
message
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
message
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -223,7 +223,7 @@ void verify_json_insert(TAOS* taos) {
"[ \
{ \
\"
metric
\"
:
\"
cpu_load_1
\"
, \
\"
timestamp
\"
: 1626006833610
123,
\
\"
timestamp
\"
: 1626006833610
,
\
\"
value
\"
: 55.5, \
\"
tags
\"
: \
{ \
...
...
@@ -234,7 +234,7 @@ void verify_json_insert(TAOS* taos) {
}, \
{ \
\"
metric
\"
:
\"
cpu_load_2
\"
, \
\"
timestamp
\"
: 1626006833610
123,
\
\"
timestamp
\"
: 1626006833610
,
\
\"
value
\"
: 55.5, \
\"
tags
\"
: \
{ \
...
...
@@ -245,7 +245,7 @@ void verify_json_insert(TAOS* taos) {
} \
]"
};
code
=
taos_schemaless_insert
(
taos
,
message1
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
message1
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -256,8 +256,8 @@ void verify_json_insert(TAOS* taos) {
\"
metric
\"
:
\"
cpu_load_3
\"
, \
\"
timestamp
\"
: \
{ \
\"
value
\"
: 1626006833610
123,
\
\"
type
\"
:
\"
u
s
\"
\
\"
value
\"
: 1626006833610
,
\
\"
type
\"
:
\"
m
s
\"
\
}, \
\"
value
\"
: \
{ \
...
...
@@ -286,7 +286,7 @@ void verify_json_insert(TAOS* taos) {
}, \
{ \
\"
metric
\"
:
\"
cpu_load_4
\"
, \
\"
timestamp
\"
: 1626006833610
123,
\
\"
timestamp
\"
: 1626006833610
,
\
\"
value
\"
: 66.6, \
\"
tags
\"
: \
{ \
...
...
@@ -296,7 +296,7 @@ void verify_json_insert(TAOS* taos) {
} \
} \
]"
};
code
=
taos_schemaless_insert
(
taos
,
message2
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
message2
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -309,7 +309,7 @@ void verify_json_insert(TAOS* taos) {
//number
payload
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
payload
,
"metric"
,
"stb0_0"
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
123
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
);
cJSON_AddNumberToObject
(
payload
,
"value"
,
10
);
tags
=
cJSON_CreateObject
();
cJSON_AddTrueToObject
(
tags
,
"t1"
);
...
...
@@ -320,7 +320,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload0_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -330,7 +330,7 @@ void verify_json_insert(TAOS* taos) {
//true
payload
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
payload
,
"metric"
,
"stb0_1"
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
123
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
);
cJSON_AddTrueToObject
(
payload
,
"value"
);
tags
=
cJSON_CreateObject
();
cJSON_AddTrueToObject
(
tags
,
"t1"
);
...
...
@@ -341,7 +341,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload0_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -351,7 +351,7 @@ void verify_json_insert(TAOS* taos) {
//false
payload
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
payload
,
"metric"
,
"stb0_2"
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
123
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
);
cJSON_AddFalseToObject
(
payload
,
"value"
);
tags
=
cJSON_CreateObject
();
cJSON_AddTrueToObject
(
tags
,
"t1"
);
...
...
@@ -362,7 +362,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload0_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -372,7 +372,7 @@ void verify_json_insert(TAOS* taos) {
//string
payload
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
payload
,
"metric"
,
"stb0_3"
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
123
);
cJSON_AddNumberToObject
(
payload
,
"timestamp"
,
1626006833610
);
cJSON_AddStringToObject
(
payload
,
"value"
,
"123_abc_.!@#$%^&*:;,./?|+-=()[]{}<>"
);
tags
=
cJSON_CreateObject
();
cJSON_AddTrueToObject
(
tags
,
"t1"
);
...
...
@@ -383,7 +383,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload0_3 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -404,7 +404,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload0_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -433,7 +433,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload1_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -459,7 +459,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload1_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -485,7 +485,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload1_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -511,7 +511,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload1_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -543,7 +543,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -573,7 +573,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -603,7 +603,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -633,7 +633,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_3 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -663,7 +663,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -693,7 +693,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_5 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -723,7 +723,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_6 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -753,7 +753,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_7 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -783,7 +783,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload2_8 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
@@ -863,7 +863,7 @@ void verify_json_insert(TAOS* taos) {
*
payload_str
=
cJSON_Print
(
payload
);
//printf("%s\n", payload_str);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
);
code
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
2
,
NULL
);
if
(
code
)
{
printf
(
"payload3_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录