Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1ca75c5a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
1ca75c5a
编写于
11月 11, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs in package script
上级
3c3edeb2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
20 deletion
+31
-20
packaging/tools/install.sh
packaging/tools/install.sh
+2
-2
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+29
-18
未找到文件。
packaging/tools/install.sh
浏览文件 @
1ca75c5a
...
...
@@ -247,9 +247,9 @@ vercomp () {
function
is_version_compatible
()
{
curr_version
=
$(
${
bin_dir
}
/taosd
-V
|
cut
-d
' '
-f
1
)
curr_version
=
$(
${
bin_dir
}
/taosd
-V
|
cut
-d
' '
-f
2
)
min_compatible_version
=
$(
${
script_dir
}
/bin/taosd
-V
|
cut
-d
' '
-f
2
)
min_compatible_version
=
$(
${
script_dir
}
/bin/taosd
-V
|
cut
-d
' '
-f
4
)
vercomp
$curr_version
$min_compatible_version
case
$?
in
...
...
src/client/src/TSDBJNIConnector.c
浏览文件 @
1ca75c5a
...
...
@@ -208,10 +208,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn
ret
=
(
jlong
)
taos_connect
((
char
*
)
host
,
(
char
*
)
user
,
(
char
*
)
pass
,
(
char
*
)
dbname
,
jport
);
if
(
ret
==
0
)
{
jniError
(
"jobj:%p,
taos:%p, connect to tdengin
e failed, host=%s, user=%s, dbname=%s, port=%d"
,
jobj
,
(
void
*
)
ret
,
jniError
(
"jobj:%p,
conn:%p, connect to databas
e failed, host=%s, user=%s, dbname=%s, port=%d"
,
jobj
,
(
void
*
)
ret
,
(
char
*
)
host
,
(
char
*
)
user
,
(
char
*
)
dbname
,
jport
);
}
else
{
jniTrace
(
"jobj:%p,
taos:%p, connect to tdengin
e succeed, host=%s, user=%s, dbname=%s, port=%d"
,
jobj
,
(
void
*
)
ret
,
jniTrace
(
"jobj:%p,
conn:%p, connect to databas
e succeed, host=%s, user=%s, dbname=%s, port=%d"
,
jobj
,
(
void
*
)
ret
,
(
char
*
)
host
,
(
char
*
)
user
,
(
char
*
)
dbname
,
jport
);
}
...
...
@@ -232,7 +232,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
}
if
(
jsql
==
NULL
)
{
jniError
(
"jobj:%p,
taos
:%p, sql is null"
,
jobj
,
tscon
);
jniError
(
"jobj:%p,
conn
:%p, sql is null"
,
jobj
,
tscon
);
return
JNI_SQL_NULL
;
}
...
...
@@ -250,7 +250,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
int
code
=
taos_query
(
tscon
,
dst
);
if
(
code
!=
0
)
{
jniError
(
"jobj:%p,
taos
:%p, code:%d, msg:%s, sql:%s"
,
jobj
,
tscon
,
code
,
taos_errstr
(
tscon
),
dst
);
jniError
(
"jobj:%p,
conn
:%p, code:%d, msg:%s, sql:%s"
,
jobj
,
tscon
,
code
,
taos_errstr
(
tscon
),
dst
);
free
(
dst
);
return
JNI_TDENGINE_ERROR
;
}
else
{
...
...
@@ -259,9 +259,9 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_executeQueryImp(J
if
(
pSql
->
cmd
.
command
==
TSDB_SQL_INSERT
)
{
affectRows
=
taos_affected_rows
(
tscon
);
jniTrace
(
"jobj:%p,
taos
:%p, code:%d, affect rows:%d, sql:%s"
,
jobj
,
tscon
,
code
,
affectRows
,
dst
);
jniTrace
(
"jobj:%p,
conn
:%p, code:%d, affect rows:%d, sql:%s"
,
jobj
,
tscon
,
code
,
affectRows
,
dst
);
}
else
{
jniTrace
(
"jobj:%p,
taos
:%p, code:%d, sql:%s"
,
jobj
,
tscon
,
code
,
dst
);
jniTrace
(
"jobj:%p,
conn
:%p, code:%d, sql:%s"
,
jobj
,
tscon
,
code
,
dst
);
}
free
(
dst
);
...
...
@@ -291,11 +291,22 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getResultSetImp(
return
JNI_CONNECTION_NULL
;
}
<<<<<<<
Updated
upstream
int
num_fields
=
taos_field_count
(
tscon
);
if
(
num_fields
!=
0
)
{
jlong
ret
=
(
jlong
)
taos_use_result
(
tscon
);
jniTrace
(
"jobj:%p, taos:%p, get resultset:%p"
,
jobj
,
tscon
,
(
void
*
)
ret
);
return
ret
;
=======
jlong
ret
=
0
;
if
(
tscIsUpdateQuery
(
tscon
))
{
ret
=
0
;
// for update query, no result pointer
jniTrace
(
"jobj:%p, conn:%p, no result"
,
jobj
,
tscon
);
}
else
{
ret
=
(
jlong
)
taos_use_result
(
tscon
);
jniTrace
(
"jobj:%p, conn:%p, get resultset:%p"
,
jobj
,
tscon
,
(
void
*
)
ret
);
>>>>>>>
Stashed
changes
}
jniTrace
(
"jobj:%p, taos:%p, no resultset"
,
jobj
,
tscon
);
...
...
@@ -311,12 +322,12 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_freeResultSetImp(
}
if
((
void
*
)
res
==
NULL
)
{
jniError
(
"jobj:%p,
taos
:%p, resultset is null"
,
jobj
,
tscon
);
jniError
(
"jobj:%p,
conn
:%p, resultset is null"
,
jobj
,
tscon
);
return
JNI_RESULT_SET_NULL
;
}
taos_free_result
((
void
*
)
res
);
jniTrace
(
"jobj:%p,
taos
:%p, free resultset:%p"
,
jobj
,
tscon
,
(
void
*
)
res
);
jniTrace
(
"jobj:%p,
conn
:%p, free resultset:%p"
,
jobj
,
tscon
,
(
void
*
)
res
);
return
JNI_SUCCESS
;
}
...
...
@@ -330,7 +341,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm
jint
ret
=
taos_affected_rows
(
tscon
);
jniTrace
(
"jobj:%p,
taos
:%p, affect rows:%d"
,
jobj
,
tscon
,
(
void
*
)
con
,
ret
);
jniTrace
(
"jobj:%p,
conn
:%p, affect rows:%d"
,
jobj
,
tscon
,
(
void
*
)
con
,
ret
);
return
ret
;
}
...
...
@@ -346,7 +357,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
TAOS_RES
*
result
=
(
TAOS_RES
*
)
res
;
if
(
result
==
NULL
)
{
jniError
(
"jobj:%p,
taos
:%p, resultset is null"
,
jobj
,
tscon
);
jniError
(
"jobj:%p,
conn
:%p, resultset is null"
,
jobj
,
tscon
);
return
JNI_RESULT_SET_NULL
;
}
...
...
@@ -356,10 +367,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getSchemaMetaData
// jobject arrayListObj = (*env)->NewObject(env, g_arrayListClass, g_arrayListConstructFp, "");
if
(
num_fields
==
0
)
{
jniError
(
"jobj:%p,
taos
:%p, resultset:%p, fields size is %d"
,
jobj
,
tscon
,
res
,
num_fields
);
jniError
(
"jobj:%p,
conn
:%p, resultset:%p, fields size is %d"
,
jobj
,
tscon
,
res
,
num_fields
);
return
JNI_NUM_OF_FIELDS_0
;
}
else
{
jniTrace
(
"jobj:%p,
taos
:%p, resultset:%p, fields size is %d"
,
jobj
,
tscon
,
res
,
num_fields
);
jniTrace
(
"jobj:%p,
conn
:%p, resultset:%p, fields size is %d"
,
jobj
,
tscon
,
res
,
num_fields
);
for
(
int
i
=
0
;
i
<
num_fields
;
++
i
)
{
jobject
metadataObj
=
(
*
env
)
->
NewObject
(
env
,
g_metadataClass
,
g_metadataConstructFp
);
(
*
env
)
->
SetIntField
(
env
,
metadataObj
,
g_metadataColtypeField
,
fields
[
i
].
type
);
...
...
@@ -402,7 +413,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
TAOS_RES
*
result
=
(
TAOS_RES
*
)
res
;
if
(
result
==
NULL
)
{
jniError
(
"jobj:%p,
taos
:%p, resultset is null"
,
jobj
,
tscon
);
jniError
(
"jobj:%p,
conn
:%p, resultset is null"
,
jobj
,
tscon
);
return
JNI_RESULT_SET_NULL
;
}
...
...
@@ -410,7 +421,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
int
num_fields
=
taos_num_fields
(
result
);
if
(
num_fields
==
0
)
{
jniError
(
"jobj:%p,
taos
:%p, resultset:%p, fields size is %d"
,
jobj
,
tscon
,
res
,
num_fields
);
jniError
(
"jobj:%p,
conn
:%p, resultset:%p, fields size is %d"
,
jobj
,
tscon
,
res
,
num_fields
);
return
JNI_NUM_OF_FIELDS_0
;
}
...
...
@@ -418,10 +429,10 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_fetchRowImp(JNIEn
if
(
row
==
NULL
)
{
int
tserrno
=
taos_errno
(
tscon
);
if
(
tserrno
==
0
)
{
jniTrace
(
"jobj:%p,
taos
:%p, resultset:%p, fields size is %d, fetch row to the end"
,
jobj
,
tscon
,
res
,
num_fields
);
jniTrace
(
"jobj:%p,
conn
:%p, resultset:%p, fields size is %d, fetch row to the end"
,
jobj
,
tscon
,
res
,
num_fields
);
return
JNI_FETCH_END
;
}
else
{
jniTrace
(
"jobj:%p,
taos
:%p, interruptted query"
,
jobj
,
tscon
);
jniTrace
(
"jobj:%p,
conn
:%p, interruptted query"
,
jobj
,
tscon
);
return
JNI_RESULT_SET_NULL
;
}
}
...
...
@@ -485,7 +496,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_closeConnectionIm
jniError
(
"jobj:%p, connection is closed"
,
jobj
);
return
JNI_CONNECTION_NULL
;
}
else
{
jniTrace
(
"jobj:%p,
taos
:%p, close connection success"
,
jobj
,
tscon
);
jniTrace
(
"jobj:%p,
conn
:%p, close connection success"
,
jobj
,
tscon
);
taos_close
(
tscon
);
return
JNI_SUCCESS
;
}
...
...
@@ -640,7 +651,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_validateCreateTab
}
if
(
jsql
==
NULL
)
{
jniError
(
"jobj:%p,
taos
:%p, sql is null"
,
jobj
,
tscon
);
jniError
(
"jobj:%p,
conn
:%p, sql is null"
,
jobj
,
tscon
);
return
JNI_SQL_NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录