Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
744bc92f
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,发现更多精彩内容 >>
提交
744bc92f
编写于
6月 17, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify TAOS as id addr
上级
c2a96b2c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
25 deletion
+30
-25
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+4
-2
source/client/src/clientMain.c
source/client/src/clientMain.c
+23
-20
source/client/src/clientSml.c
source/client/src/clientSml.c
+3
-3
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
744bc92f
...
@@ -1100,10 +1100,12 @@ TAOS* taos_connect_auth(const char* ip, const char* user, const char* auth, cons
...
@@ -1100,10 +1100,12 @@ TAOS* taos_connect_auth(const char* ip, const char* user, const char* auth, cons
STscObj
*
pObj
=
taos_connect_internal
(
ip
,
user
,
NULL
,
auth
,
db
,
port
,
CONN_TYPE__QUERY
);
STscObj
*
pObj
=
taos_connect_internal
(
ip
,
user
,
NULL
,
auth
,
db
,
port
,
CONN_TYPE__QUERY
);
if
(
pObj
)
{
if
(
pObj
)
{
return
(
TAOS
*
)
pObj
->
id
;
uint64_t
*
id
=
taosMemoryMalloc
(
sizeof
(
uint64_t
));
*
id
=
pObj
->
id
;
return
(
TAOS
*
)
id
;
}
}
return
(
TAOS
*
)
0
;
return
NULL
;
}
}
TAOS
*
taos_connect_l
(
const
char
*
ip
,
int
ipLen
,
const
char
*
user
,
int
userLen
,
const
char
*
pass
,
int
passLen
,
TAOS
*
taos_connect_l
(
const
char
*
ip
,
int
ipLen
,
const
char
*
user
,
int
userLen
,
const
char
*
pass
,
int
passLen
,
...
...
source/client/src/clientMain.c
浏览文件 @
744bc92f
...
@@ -99,10 +99,12 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha
...
@@ -99,10 +99,12 @@ TAOS *taos_connect(const char *ip, const char *user, const char *pass, const cha
STscObj
*
pObj
=
taos_connect_internal
(
ip
,
user
,
pass
,
NULL
,
db
,
port
,
CONN_TYPE__QUERY
);
STscObj
*
pObj
=
taos_connect_internal
(
ip
,
user
,
pass
,
NULL
,
db
,
port
,
CONN_TYPE__QUERY
);
if
(
pObj
)
{
if
(
pObj
)
{
return
(
TAOS
*
)
pObj
->
id
;
uint64_t
*
id
=
taosMemoryMalloc
(
sizeof
(
uint64_t
));
*
id
=
pObj
->
id
;
return
(
TAOS
*
)
id
;
}
}
return
(
TAOS
*
)
0
;
return
NULL
;
}
}
void
taos_close_internal
(
void
*
taos
)
{
void
taos_close_internal
(
void
*
taos
)
{
...
@@ -117,13 +119,14 @@ void taos_close_internal(void *taos) {
...
@@ -117,13 +119,14 @@ void taos_close_internal(void *taos) {
}
}
void
taos_close
(
TAOS
*
taos
)
{
void
taos_close
(
TAOS
*
taos
)
{
STscObj
*
pObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
NULL
==
pObj
)
{
if
(
NULL
==
pObj
)
{
return
;
return
;
}
}
taos_close_internal
(
pObj
);
taos_close_internal
(
pObj
);
releaseTscObj
((
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
taosMemoryFree
(
taos
);
}
}
...
@@ -206,7 +209,7 @@ static void syncQueryFn(void *param, void *res, int32_t code) {
...
@@ -206,7 +209,7 @@ static void syncQueryFn(void *param, void *res, int32_t code) {
}
}
TAOS_RES
*
taos_query
(
TAOS
*
taos
,
const
char
*
sql
)
{
TAOS_RES
*
taos_query
(
TAOS
*
taos
,
const
char
*
sql
)
{
STscObj
*
pTscObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pTscObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
pTscObj
==
NULL
||
sql
==
NULL
)
{
if
(
pTscObj
==
NULL
||
sql
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
return
NULL
;
return
NULL
;
...
@@ -219,13 +222,13 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
...
@@ -219,13 +222,13 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
taos_query_a
(
taos
,
sql
,
syncQueryFn
,
param
);
taos_query_a
(
taos
,
sql
,
syncQueryFn
,
param
);
tsem_wait
(
&
param
->
sem
);
tsem_wait
(
&
param
->
sem
);
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
return
param
->
pRequest
;
return
param
->
pRequest
;
#else
#else
size_t
sqlLen
=
strlen
(
sql
);
size_t
sqlLen
=
strlen
(
sql
);
if
(
sqlLen
>
(
size_t
)
TSDB_MAX_ALLOWED_SQL_LEN
)
{
if
(
sqlLen
>
(
size_t
)
TSDB_MAX_ALLOWED_SQL_LEN
)
{
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
tscError
(
"sql string exceeds max length:%d"
,
TSDB_MAX_ALLOWED_SQL_LEN
);
tscError
(
"sql string exceeds max length:%d"
,
TSDB_MAX_ALLOWED_SQL_LEN
);
terrno
=
TSDB_CODE_TSC_EXCEED_SQL_LIMIT
;
terrno
=
TSDB_CODE_TSC_EXCEED_SQL_LIMIT
;
return
NULL
;
return
NULL
;
...
@@ -233,7 +236,7 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
...
@@ -233,7 +236,7 @@ TAOS_RES *taos_query(TAOS *taos, const char *sql) {
TAOS_RES
*
pRes
=
execQuery
(
pTscObj
,
sql
,
sqlLen
);
TAOS_RES
*
pRes
=
execQuery
(
pTscObj
,
sql
,
sqlLen
);
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
return
pRes
;
return
pRes
;
#endif
#endif
...
@@ -453,15 +456,15 @@ int taos_result_precision(TAOS_RES *res) {
...
@@ -453,15 +456,15 @@ int taos_result_precision(TAOS_RES *res) {
}
}
int
taos_select_db
(
TAOS
*
taos
,
const
char
*
db
)
{
int
taos_select_db
(
TAOS
*
taos
,
const
char
*
db
)
{
STscObj
*
pObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
pObj
==
NULL
)
{
if
(
pObj
==
NULL
)
{
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
return
TSDB_CODE_TSC_DISCONNECTED
;
return
TSDB_CODE_TSC_DISCONNECTED
;
}
}
if
(
db
==
NULL
||
strlen
(
db
)
==
0
)
{
if
(
db
==
NULL
||
strlen
(
db
)
==
0
)
{
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
terrno
=
TSDB_CODE_TSC_INVALID_INPUT
;
terrno
=
TSDB_CODE_TSC_INVALID_INPUT
;
return
terrno
;
return
terrno
;
}
}
...
@@ -473,7 +476,7 @@ int taos_select_db(TAOS *taos, const char *db) {
...
@@ -473,7 +476,7 @@ int taos_select_db(TAOS *taos, const char *db) {
int32_t
code
=
taos_errno
(
pRequest
);
int32_t
code
=
taos_errno
(
pRequest
);
taos_free_result
(
pRequest
);
taos_free_result
(
pRequest
);
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
return
code
;
return
code
;
}
}
...
@@ -626,7 +629,7 @@ int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) {
...
@@ -626,7 +629,7 @@ int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) {
int
taos_validate_sql
(
TAOS
*
taos
,
const
char
*
sql
)
{
return
true
;
}
int
taos_validate_sql
(
TAOS
*
taos
,
const
char
*
sql
)
{
return
true
;
}
void
taos_reset_current_db
(
TAOS
*
taos
)
{
void
taos_reset_current_db
(
TAOS
*
taos
)
{
STscObj
*
pTscObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pTscObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
pTscObj
==
NULL
)
{
if
(
pTscObj
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
return
;
return
;
...
@@ -634,17 +637,17 @@ void taos_reset_current_db(TAOS *taos) {
...
@@ -634,17 +637,17 @@ void taos_reset_current_db(TAOS *taos) {
resetConnectDB
(
pTscObj
);
resetConnectDB
(
pTscObj
);
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
}
}
const
char
*
taos_get_server_info
(
TAOS
*
taos
)
{
const
char
*
taos_get_server_info
(
TAOS
*
taos
)
{
STscObj
*
pTscObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pTscObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
pTscObj
==
NULL
)
{
if
(
pTscObj
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
return
NULL
;
return
NULL
;
}
}
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
return
pTscObj
->
ver
;
return
pTscObj
->
ver
;
}
}
...
@@ -711,11 +714,11 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
...
@@ -711,11 +714,11 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
}
}
void
taos_query_a
(
TAOS
*
taos
,
const
char
*
sql
,
__taos_async_fn_t
fp
,
void
*
param
)
{
void
taos_query_a
(
TAOS
*
taos
,
const
char
*
sql
,
__taos_async_fn_t
fp
,
void
*
param
)
{
STscObj
*
pTscObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pTscObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
pTscObj
==
NULL
||
sql
==
NULL
||
NULL
==
fp
)
{
if
(
pTscObj
==
NULL
||
sql
==
NULL
||
NULL
==
fp
)
{
terrno
=
TSDB_CODE_INVALID_PARA
;
terrno
=
TSDB_CODE_INVALID_PARA
;
if
(
pTscObj
)
{
if
(
pTscObj
)
{
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
}
else
{
}
else
{
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
}
}
...
@@ -936,7 +939,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
...
@@ -936,7 +939,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
}
}
TAOS_STMT
*
taos_stmt_init
(
TAOS
*
taos
)
{
TAOS_STMT
*
taos_stmt_init
(
TAOS
*
taos
)
{
STscObj
*
pObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
NULL
==
pObj
)
{
if
(
NULL
==
pObj
)
{
tscError
(
"invalid parameter for %s"
,
__FUNCTION__
);
tscError
(
"invalid parameter for %s"
,
__FUNCTION__
);
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
...
@@ -945,7 +948,7 @@ TAOS_STMT *taos_stmt_init(TAOS *taos) {
...
@@ -945,7 +948,7 @@ TAOS_STMT *taos_stmt_init(TAOS *taos) {
TAOS_STMT
*
pStmt
=
stmtInit
(
pObj
);
TAOS_STMT
*
pStmt
=
stmtInit
(
pObj
);
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
return
pStmt
;
return
pStmt
;
}
}
...
...
source/client/src/clientSml.c
浏览文件 @
744bc92f
...
@@ -2434,7 +2434,7 @@ static void smlInsertCallback(void *param, void *res, int32_t code) {
...
@@ -2434,7 +2434,7 @@ static void smlInsertCallback(void *param, void *res, int32_t code) {
*/
*/
TAOS_RES
*
taos_schemaless_insert
(
TAOS
*
taos
,
char
*
lines
[],
int
numLines
,
int
protocol
,
int
precision
)
{
TAOS_RES
*
taos_schemaless_insert
(
TAOS
*
taos
,
char
*
lines
[],
int
numLines
,
int
protocol
,
int
precision
)
{
STscObj
*
pTscObj
=
acquireTscObj
(
(
int64_t
)
taos
);
STscObj
*
pTscObj
=
acquireTscObj
(
*
(
int64_t
*
)
taos
);
if
(
NULL
==
pTscObj
)
{
if
(
NULL
==
pTscObj
)
{
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
terrno
=
TSDB_CODE_TSC_DISCONNECTED
;
uError
(
"SML:taos_schemaless_insert invalid taos"
);
uError
(
"SML:taos_schemaless_insert invalid taos"
);
...
@@ -2443,7 +2443,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
...
@@ -2443,7 +2443,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
SRequestObj
*
request
=
(
SRequestObj
*
)
createRequest
(
pTscObj
,
TSDB_SQL_INSERT
);
SRequestObj
*
request
=
(
SRequestObj
*
)
createRequest
(
pTscObj
,
TSDB_SQL_INSERT
);
if
(
!
request
){
if
(
!
request
){
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
uError
(
"SML:taos_schemaless_insert error request is null"
);
uError
(
"SML:taos_schemaless_insert error request is null"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -2531,6 +2531,6 @@ end:
...
@@ -2531,6 +2531,6 @@ end:
// ((STscObj *)taos)->schemalessType = 0;
// ((STscObj *)taos)->schemalessType = 0;
pTscObj
->
schemalessType
=
1
;
pTscObj
->
schemalessType
=
1
;
uDebug
(
"resultend:%s"
,
request
->
msgBuf
);
uDebug
(
"resultend:%s"
,
request
->
msgBuf
);
releaseTscObj
(
(
int64_t
)
taos
);
releaseTscObj
(
*
(
int64_t
*
)
taos
);
return
(
TAOS_RES
*
)
request
;
return
(
TAOS_RES
*
)
request
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录