Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f6eefa99
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f6eefa99
编写于
10月 28, 2020
作者:
F
freemine
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. remove obsolete codes in tests/main.c
2. linux port of todbcinst
上级
cc496e12
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
14 deletion
+17
-14
src/connector/odbc/tests/main.c
src/connector/odbc/tests/main.c
+0
-7
src/connector/odbc/tools/CMakeLists.txt
src/connector/odbc/tools/CMakeLists.txt
+1
-1
src/connector/odbc/tools/main.c
src/connector/odbc/tools/main.c
+16
-6
未找到文件。
src/connector/odbc/tests/main.c
浏览文件 @
f6eefa99
...
...
@@ -497,13 +497,6 @@ int main(int argc, char *argv[]) {
return
0
;
}
if
(
argc
==
2
&&
strcmp
(
argv
[
1
],
"uninstall"
)
==
0
)
{
DWORD
usage
=
0
;
BOOL
ok
=
SQLRemoveDriver
(
"TAOS ODBC"
,
TRUE
,
&
usage
);
D
(
"ok/usage: %d/%d"
,
ok
,
usage
);
return
ok
?
0
:
1
;
}
const
char
*
dsn
=
(
argc
>
1
)
?
argv
[
1
]
:
NULL
;
const
char
*
uid
=
(
argc
>
2
)
?
argv
[
2
]
:
NULL
;
const
char
*
pwd
=
(
argc
>
3
)
?
argv
[
3
]
:
NULL
;
...
...
src/connector/odbc/tools/CMakeLists.txt
浏览文件 @
f6eefa99
...
...
@@ -2,7 +2,7 @@ PROJECT(TDengine)
IF
(
TD_LINUX
)
ADD_EXECUTABLE
(
todbcinst main.c
)
TARGET_LINK_LIBRARIES
(
todbcinst odbc
)
TARGET_LINK_LIBRARIES
(
todbcinst odbc
odbcinst
)
ENDIF
()
IF
(
TD_WINDOWS_64
)
...
...
src/connector/odbc/tools/main.c
浏览文件 @
f6eefa99
...
...
@@ -7,6 +7,7 @@
#endif
#include <odbcinst.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
...
...
@@ -36,14 +37,17 @@ int main(int argc, char *argv[]) {
}
static
void
usage
(
const
char
*
arg0
)
{
fprintf
(
stderr
,
"%s -h | -i -n [TaosDriverName] -p [TaosDriverPath] | -u [-f] [TaosDriverName]
\n
"
,
arg0
);
fprintf
(
stderr
,
"%s -h | -i -n [TaosDriverName] -p [TaosDriverPath] | -u [-f]
-n
[TaosDriverName]
\n
"
,
arg0
);
return
;
}
static
int
do_install
(
int
i
,
int
argc
,
char
*
argv
[])
{
int
forceful
=
0
;
const
char
*
driverName
=
NULL
;
#ifdef _MSC_VER
const
char
*
driverFile
=
"todbc.dll"
;
#else
const
char
*
driverFile
=
"libtodbc.so"
;
#endif
const
char
*
driverPath
=
NULL
;
for
(;
i
<
argc
;
++
i
)
{
const
char
*
arg
=
argv
[
i
];
...
...
@@ -82,7 +86,7 @@ static int do_install(int i, int argc, char *argv[]) {
char
buf
[
8192
];
snprintf
(
buf
,
sizeof
(
buf
),
"%s%cDriver=%s%cFileUage=0%cConnectFunctions=YYN%c"
,
driverName
,
0
,
driverFile
,
0
,
0
,
0
);
BOOL
ok
=
TRUE
;
BOOL
ok
=
1
;
DWORD
usageCount
=
1
;
char
installed
[
PATH_MAX
+
1
];
WORD
len
=
0
;
...
...
@@ -91,7 +95,13 @@ static int do_install(int i, int argc, char *argv[]) {
fprintf
(
stderr
,
"failed to query TaosDriverName: [%s]
\n
"
,
driverName
);
return
-
1
;
}
if
(
stricmp
(
driverPath
,
installed
))
{
int
r
=
0
;
#ifdef _MSC_VER
r
=
stricmp
(
driverPath
,
installed
);
#else
r
=
strcasecmp
(
driverPath
,
installed
);
#endif
if
(
r
)
{
fprintf
(
stderr
,
"previously installed TaosDriver [%s] has different target path [%s]
\n
"
"it shall be uninstalled before you can install it to different path [%s]
\n
"
,
driverName
,
installed
,
driverPath
);
...
...
@@ -134,10 +144,10 @@ static int do_uninstall(int i, int argc, char *argv[]) {
fprintf
(
stderr
,
"TaosDriverName not specified
\n
"
);
return
-
1
;
}
BOOL
ok
=
TRUE
;
BOOL
ok
=
1
;
DWORD
usageCount
=
1
;
do
{
ok
=
SQLRemoveDriver
(
driverName
,
FALSE
,
&
usageCount
);
ok
=
SQLRemoveDriver
(
driverName
,
0
,
&
usageCount
);
if
(
!
ok
)
{
fprintf
(
stderr
,
"failed to remove driver [%s]
\n
"
,
driverName
);
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录