Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
803e1ab1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
803e1ab1
编写于
4月 01, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-14393] fix bug.
上级
9d16e862
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
8 deletion
+22
-8
include/client/taos.h
include/client/taos.h
+1
-1
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+3
-2
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+12
-1
source/client/src/clientMain.c
source/client/src/clientMain.c
+6
-4
未找到文件。
include/client/taos.h
浏览文件 @
803e1ab1
...
...
@@ -188,7 +188,7 @@ DLL_EXPORT bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col);
DLL_EXPORT
bool
taos_is_update_query
(
TAOS_RES
*
res
);
DLL_EXPORT
int
taos_fetch_block
(
TAOS_RES
*
res
,
TAOS_ROW
*
rows
);
DLL_EXPORT
int
taos_validate_sql
(
TAOS
*
taos
,
const
char
*
sql
);
DLL_EXPORT
void
taos_reset_current_db
(
TAOS
*
taos
);
DLL_EXPORT
void
taos_reset_current_db
(
TAOS
*
taos
);
DLL_EXPORT
int
*
taos_fetch_lengths
(
TAOS_RES
*
res
);
DLL_EXPORT
TAOS_ROW
*
taos_result_block
(
TAOS_RES
*
res
);
...
...
source/client/inc/clientInt.h
浏览文件 @
803e1ab1
...
...
@@ -136,7 +136,7 @@ typedef struct STscObj {
uint32_t
connId
;
int32_t
connType
;
uint64_t
id
;
// ref ID returned by taosAddRef
TdThreadMutex
mutex
;
// used to protect the operation on db
TdThreadMutex
mutex
;
// used to protect the operation on db
int32_t
numOfReqs
;
// number of sqlObj bound to this connection
SAppInstInfo
*
pAppInfo
;
}
STscObj
;
...
...
@@ -152,7 +152,7 @@ typedef struct SResultColumn {
typedef
struct
SReqResultInfo
{
const
char
*
pRspMsg
;
const
char
*
pData
;
TAOS_FIELD
*
fields
;
TAOS_FIELD
*
fields
;
// todo, column names are not needed.
TAOS_FIELD
*
userFields
;
// the fields info that return to user
uint32_t
numOfCols
;
int32_t
*
length
;
...
...
@@ -222,6 +222,7 @@ void destroyRequest(SRequestObj* pRequest);
char
*
getDbOfConnection
(
STscObj
*
pObj
);
void
setConnectionDB
(
STscObj
*
pTscObj
,
const
char
*
db
);
void
resetConnectDB
(
STscObj
*
pTscObj
);
void
taos_init_imp
(
void
);
int
taos_options_imp
(
TSDB_OPTION
option
,
const
char
*
str
);
...
...
source/client/src/clientImpl.c
浏览文件 @
803e1ab1
...
...
@@ -56,7 +56,7 @@ TAOS* taos_connect_internal(const char* ip, const char* user, const char* pass,
}
char
localDb
[
TSDB_DB_NAME_LEN
]
=
{
0
};
if
(
db
!=
NULL
)
{
if
(
db
!=
NULL
&&
strlen
(
db
)
>
0
)
{
if
(
!
validateDbName
(
db
))
{
terrno
=
TSDB_CODE_TSC_INVALID_DB_LENGTH
;
return
NULL
;
...
...
@@ -164,6 +164,7 @@ int32_t parseSql(SRequestObj* pRequest, bool topicQuery, SQuery** pQuery) {
if
((
*
pQuery
)
->
haveResultSet
)
{
setResSchemaInfo
(
&
pRequest
->
body
.
resInfo
,
(
*
pQuery
)
->
pResSchema
,
(
*
pQuery
)
->
numOfResCols
);
}
TSWAP
(
pRequest
->
dbList
,
(
*
pQuery
)
->
pDbList
,
SArray
*
);
TSWAP
(
pRequest
->
tableList
,
(
*
pQuery
)
->
pTableList
,
SArray
*
);
}
...
...
@@ -803,6 +804,16 @@ void setConnectionDB(STscObj* pTscObj, const char* db) {
taosThreadMutexUnlock
(
&
pTscObj
->
mutex
);
}
void
resetConnectDB
(
STscObj
*
pTscObj
)
{
if
(
pTscObj
==
NULL
)
{
return
;
}
taosThreadMutexLock
(
&
pTscObj
->
mutex
);
pTscObj
->
db
[
0
]
=
0
;
taosThreadMutexUnlock
(
&
pTscObj
->
mutex
);
}
int32_t
setQueryResultFromRsp
(
SReqResultInfo
*
pResultInfo
,
const
SRetrieveTableRsp
*
pRsp
)
{
assert
(
pResultInfo
!=
NULL
&&
pRsp
!=
NULL
);
...
...
source/client/src/clientMain.c
浏览文件 @
803e1ab1
...
...
@@ -365,8 +365,7 @@ bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) {
}
bool
taos_is_update_query
(
TAOS_RES
*
res
)
{
// TODO
return
true
;
return
taos_num_fields
(
res
)
==
0
;
}
int
taos_fetch_block
(
TAOS_RES
*
res
,
TAOS_ROW
*
rows
)
{
...
...
@@ -393,8 +392,11 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
int
taos_validate_sql
(
TAOS
*
taos
,
const
char
*
sql
)
{
return
true
;
}
void
taos_reset_current_db
(
TAOS
*
taos
)
{
// TODO
return
;
if
(
taos
==
NULL
)
{
return
;
}
resetConnectDB
(
taos
);
}
const
char
*
taos_get_server_info
(
TAOS
*
taos
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录