Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ddb33879
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看板
提交
ddb33879
编写于
10月 19, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix openTSDBTest.c and memory leak
上级
dc13ae8a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
108 addition
and
41 deletion
+108
-41
src/client/src/tscParseLineProtocol.c
src/client/src/tscParseLineProtocol.c
+3
-6
tests/script/api/openTSDBTest.c
tests/script/api/openTSDBTest.c
+105
-35
未找到文件。
src/client/src/tscParseLineProtocol.c
浏览文件 @
ddb33879
...
...
@@ -2331,16 +2331,13 @@ static int32_t convertPrecisionType(int precision, SMLTimeStampType *tsType) {
}
//make a dummy SSqlObj
static
SSqlObj
*
createSmlQueryObj
(
int32_t
affected_rows
,
int32_t
code
)
{
static
SSqlObj
*
createSmlQueryObj
(
TAOS
*
taos
,
int32_t
affected_rows
,
int32_t
code
)
{
SSqlObj
*
pNew
=
(
SSqlObj
*
)
calloc
(
1
,
sizeof
(
SSqlObj
));
if
(
pNew
==
NULL
)
{
return
NULL
;
}
pNew
->
signature
=
pNew
;
pNew
->
pTscObj
=
(
STscObj
*
)
calloc
(
1
,
sizeof
(
STscObj
));
if
(
pNew
->
pTscObj
==
NULL
)
{
return
NULL
;
}
pNew
->
pTscObj
=
taos
;
tsem_init
(
&
pNew
->
rspSem
,
0
,
0
);
registerSqlObj
(
pNew
);
...
...
@@ -2402,7 +2399,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
}
SSqlObj
*
pSql
=
createSmlQueryObj
(
affected_rows
,
code
);
SSqlObj
*
pSql
=
createSmlQueryObj
(
taos
,
affected_rows
,
code
);
return
(
TAOS_RES
*
)
pSql
;
}
tests/script/api/openTSDBTest.c
浏览文件 @
ddb33879
...
...
@@ -26,10 +26,12 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines0
,
3
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
/* timestamp */
char
*
lines1
[]
=
{
...
...
@@ -41,10 +43,12 @@ void verify_telnet_insert(TAOS* taos) {
"stb1 1626006833651ms 6i8 host=
\"
host0
\"
"
,
"stb1 0 7i8 host=
\"
host0
\"
"
,
};
code
=
taos_schemaless_insert
(
taos
,
lines1
,
7
,
1
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines1
,
7
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
/* metric value */
//tinyint
...
...
@@ -52,40 +56,48 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_0
,
2
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//smallint
char
*
lines2_1
[]
=
{
"stb2_1 1626006833651ms -32767i16 host=
\"
host0
\"
"
,
"stb2_1 1626006833652ms 32767i16 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_1
,
2
,
1
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_1
,
2
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//int
char
*
lines2_2
[]
=
{
"stb2_2 1626006833651ms -2147483647i32 host=
\"
host0
\"
"
,
"stb2_2 1626006833652ms 2147483647i32 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_2
,
2
,
1
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_2
,
2
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//bigint
char
*
lines2_3
[]
=
{
"stb2_3 1626006833651ms -9223372036854775807i64 host=
\"
host0
\"
"
,
"stb2_3 1626006833652ms 9223372036854775807i64 host=
\"
host0
\"
"
};
code
=
taos_schemaless_insert
(
taos
,
lines2_3
,
2
,
1
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_3
,
2
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_3 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//float
char
*
lines2_4
[]
=
{
...
...
@@ -100,10 +112,12 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_4
,
10
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//double
char
*
lines2_5
[]
=
{
...
...
@@ -119,10 +133,12 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_5
,
11
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_5 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//bool
char
*
lines2_6
[]
=
{
...
...
@@ -137,10 +153,12 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_6
,
10
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_6 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//binary
char
*
lines2_7
[]
=
{
...
...
@@ -148,20 +166,24 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_7
,
3
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_7 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//nchar
char
*
lines2_8
[]
=
{
"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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines2_8
,
2
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines2_8 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
/* tags */
//tag value types
...
...
@@ -169,10 +191,12 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines3_0
,
2
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines3_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
//tag ID as child table name
char
*
lines3_1
[]
=
{
...
...
@@ -180,10 +204,12 @@ void verify_telnet_insert(TAOS* taos) {
"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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
lines3_1
,
3
,
SML_TELNET_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"lines3_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
return
;
}
...
...
@@ -214,10 +240,12 @@ void verify_json_insert(TAOS* taos) {
} \
}"
};
code
=
taos_schemaless_insert
(
taos
,
message
,
0
,
2
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
message
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
char
*
message1
[]
=
{
"[ \
...
...
@@ -245,10 +273,12 @@ void verify_json_insert(TAOS* taos) {
} \
]"
};
code
=
taos_schemaless_insert
(
taos
,
message1
,
0
,
2
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
message1
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
char
*
message2
[]
=
{
"[ \
...
...
@@ -296,10 +326,12 @@ void verify_json_insert(TAOS* taos) {
} \
} \
]"
};
code
=
taos_schemaless_insert
(
taos
,
message2
,
0
,
2
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
message2
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
taos_free_result
(
result
);
cJSON
*
payload
,
*
tags
;
...
...
@@ -320,12 +352,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload0_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//true
payload
=
cJSON_CreateObject
();
...
...
@@ -341,12 +375,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload0_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//false
payload
=
cJSON_CreateObject
();
...
...
@@ -362,12 +398,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload0_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//string
payload
=
cJSON_CreateObject
();
...
...
@@ -383,12 +421,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload0_3 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//timestamp 0 -> current time
payload
=
cJSON_CreateObject
();
...
...
@@ -404,12 +444,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload0_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
/* Nested format */
//timestamp
...
...
@@ -433,12 +475,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload1_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//milleseconds
payload
=
cJSON_CreateObject
();
...
...
@@ -459,12 +503,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload1_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//microseconds
payload
=
cJSON_CreateObject
();
...
...
@@ -485,12 +531,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload1_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//now
payload
=
cJSON_CreateObject
();
...
...
@@ -511,12 +559,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload1_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//metric value
cJSON
*
metric_val
;
...
...
@@ -543,12 +593,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//tinyint
payload
=
cJSON_CreateObject
();
...
...
@@ -573,12 +625,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_1 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//smallint
payload
=
cJSON_CreateObject
();
...
...
@@ -603,12 +657,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_2 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//int
payload
=
cJSON_CreateObject
();
...
...
@@ -633,12 +689,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_3 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//bigint
payload
=
cJSON_CreateObject
();
...
...
@@ -663,12 +721,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_4 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//float
payload
=
cJSON_CreateObject
();
...
...
@@ -693,12 +753,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_5 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//double
payload
=
cJSON_CreateObject
();
...
...
@@ -723,12 +785,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_6 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//binary
payload
=
cJSON_CreateObject
();
...
...
@@ -753,12 +817,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_7 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//nchar
payload
=
cJSON_CreateObject
();
...
...
@@ -783,12 +849,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload2_8 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
//tag value
cJSON
*
tag
;
...
...
@@ -863,12 +931,14 @@ 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
,
NULL
,
NULL
,
NULL
,
0
);
result
=
taos_schemaless_insert
(
taos
,
payload_str
,
0
,
SML_JSON_PROTOCOL
,
SML_TIMESTAMP_NOT_CONFIGURED
);
code
=
taos_errno
(
result
);
if
(
code
)
{
printf
(
"payload3_0 code: %d, %s.
\n
"
,
code
,
tstrerror
(
code
));
}
free
(
*
payload_str
);
cJSON_Delete
(
payload
);
taos_free_result
(
result
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录