Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
d264b53d
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d264b53d
编写于
11月 30, 1999
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename readonly to onlyread in odbc. Use varargs properly.
上级
daf6ffb6
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
27 addition
and
29 deletion
+27
-29
src/interfaces/odbc/connection.h
src/interfaces/odbc/connection.h
+2
-2
src/interfaces/odbc/dlg_specific.c
src/interfaces/odbc/dlg_specific.c
+17
-17
src/interfaces/odbc/execute.c
src/interfaces/odbc/execute.c
+4
-6
src/interfaces/odbc/info.c
src/interfaces/odbc/info.c
+1
-1
src/interfaces/odbc/misc.c
src/interfaces/odbc/misc.c
+2
-2
src/interfaces/odbc/psqlodbc.h
src/interfaces/odbc/psqlodbc.h
+1
-1
未找到文件。
src/interfaces/odbc/connection.h
浏览文件 @
d264b53d
...
...
@@ -147,7 +147,7 @@ typedef struct {
char
conn_settings
[
LARGE_REGISTRY_LEN
];
char
protocol
[
SMALL_REGISTRY_LEN
];
char
port
[
SMALL_REGISTRY_LEN
];
char
readonly
[
SMALL_REGISTRY_LEN
];
char
onlyread
[
SMALL_REGISTRY_LEN
];
char
fake_oid_index
[
SMALL_REGISTRY_LEN
];
char
show_oid_column
[
SMALL_REGISTRY_LEN
];
char
row_versioning
[
SMALL_REGISTRY_LEN
];
...
...
@@ -230,7 +230,7 @@ struct ConnectionClass_ {
#define CC_get_server(x) (x->connInfo.server)
#define CC_get_DSN(x) (x->connInfo.dsn)
#define CC_get_username(x) (x->connInfo.username)
#define CC_is_
readonly(x) (x->connInfo.readonly
[0] == '1')
#define CC_is_
onlyread(x) (x->connInfo.onlyread
[0] == '1')
/* for CC_DSN_info */
...
...
src/interfaces/odbc/dlg_specific.c
浏览文件 @
d264b53d
...
...
@@ -89,7 +89,7 @@ int CALLBACK driver_optionsProc(HWND hdlg,
CheckDlgButton
(
hdlg
,
DRV_OPTIMIZER
,
globals
.
disable_optimizer
);
CheckDlgButton
(
hdlg
,
DRV_KSQO
,
globals
.
ksqo
);
CheckDlgButton
(
hdlg
,
DRV_UNIQUEINDEX
,
globals
.
unique_index
);
CheckDlgButton
(
hdlg
,
DRV_READONLY
,
globals
.
readonly
);
CheckDlgButton
(
hdlg
,
DRV_READONLY
,
globals
.
onlyread
);
CheckDlgButton
(
hdlg
,
DRV_USEDECLAREFETCH
,
globals
.
use_declarefetch
);
/* Unknown (Default) Data Type sizes */
...
...
@@ -133,7 +133,7 @@ int CALLBACK driver_optionsProc(HWND hdlg,
globals
.
disable_optimizer
=
IsDlgButtonChecked
(
hdlg
,
DRV_OPTIMIZER
);
globals
.
ksqo
=
IsDlgButtonChecked
(
hdlg
,
DRV_KSQO
);
globals
.
unique_index
=
IsDlgButtonChecked
(
hdlg
,
DRV_UNIQUEINDEX
);
globals
.
readonly
=
IsDlgButtonChecked
(
hdlg
,
DRV_READONLY
);
globals
.
onlyread
=
IsDlgButtonChecked
(
hdlg
,
DRV_READONLY
);
globals
.
use_declarefetch
=
IsDlgButtonChecked
(
hdlg
,
DRV_USEDECLAREFETCH
);
/* Unknown (Default) Data Type sizes */
...
...
@@ -241,7 +241,7 @@ char buf[128];
}
/* Readonly */
CheckDlgButton
(
hdlg
,
DS_READONLY
,
atoi
(
ci
->
readonly
));
CheckDlgButton
(
hdlg
,
DS_READONLY
,
atoi
(
ci
->
onlyread
));
/* Protocol */
if
(
strncmp
(
ci
->
protocol
,
PG62
,
strlen
(
PG62
))
==
0
)
...
...
@@ -279,7 +279,7 @@ char buf[128];
mylog
(
"IDOK: got ci = %u
\n
"
,
ci
);
/* Readonly */
sprintf
(
ci
->
readonly
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_READONLY
));
sprintf
(
ci
->
onlyread
,
"%d"
,
IsDlgButtonChecked
(
hdlg
,
DS_READONLY
));
/* Protocol */
if
(
IsDlgButtonChecked
(
hdlg
,
DS_PG62
))
...
...
@@ -335,7 +335,7 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
/* extra info */
sprintf
(
&
connect_string
[
strlen
(
connect_string
)],
";READONLY=%s;PROTOCOL=%s;FAKEOIDINDEX=%s;SHOWOIDCOLUMN=%s;ROWVERSIONING=%s;SHOWSYSTEMTABLES=%s;CONNSETTINGS=%s"
,
ci
->
readonly
,
ci
->
onlyread
,
ci
->
protocol
,
ci
->
fake_oid_index
,
ci
->
show_oid_column
,
...
...
@@ -370,7 +370,7 @@ copyAttributes(ConnInfo *ci, char *attribute, char *value)
strcpy
(
ci
->
port
,
value
);
else
if
(
stricmp
(
attribute
,
INI_READONLY
)
==
0
)
strcpy
(
ci
->
readonly
,
value
);
strcpy
(
ci
->
onlyread
,
value
);
else
if
(
stricmp
(
attribute
,
INI_PROTOCOL
)
==
0
)
strcpy
(
ci
->
protocol
,
value
);
...
...
@@ -392,7 +392,7 @@ copyAttributes(ConnInfo *ci, char *attribute, char *value)
// strcpy(ci->conn_settings, value);
}
mylog
(
"copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',
readonly='%s',protocol='%s', conn_settings='%s')
\n
"
,
ci
->
dsn
,
ci
->
server
,
ci
->
database
,
ci
->
username
,
ci
->
password
,
ci
->
port
,
ci
->
readonly
,
ci
->
protocol
,
ci
->
conn_settings
);
mylog
(
"copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',
onlyread='%s',protocol='%s', conn_settings='%s')
\n
"
,
ci
->
dsn
,
ci
->
server
,
ci
->
database
,
ci
->
username
,
ci
->
password
,
ci
->
port
,
ci
->
onlyread
,
ci
->
protocol
,
ci
->
conn_settings
);
}
...
...
@@ -402,8 +402,8 @@ getDSNdefaults(ConnInfo *ci)
if
(
ci
->
port
[
0
]
==
'\0'
)
strcpy
(
ci
->
port
,
DEFAULT_PORT
);
if
(
ci
->
readonly
[
0
]
==
'\0'
)
sprintf
(
ci
->
readonly
,
"%d"
,
globals
.
readonly
);
if
(
ci
->
onlyread
[
0
]
==
'\0'
)
sprintf
(
ci
->
onlyread
,
"%d"
,
globals
.
onlyread
);
if
(
ci
->
protocol
[
0
]
==
'\0'
)
strcpy
(
ci
->
protocol
,
globals
.
protocol
);
...
...
@@ -460,8 +460,8 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
if
(
ci
->
port
[
0
]
==
'\0'
||
overwrite
)
SQLGetPrivateProfileString
(
DSN
,
INI_PORT
,
""
,
ci
->
port
,
sizeof
(
ci
->
port
),
ODBC_INI
);
if
(
ci
->
readonly
[
0
]
==
'\0'
||
overwrite
)
SQLGetPrivateProfileString
(
DSN
,
INI_READONLY
,
""
,
ci
->
readonly
,
sizeof
(
ci
->
readonly
),
ODBC_INI
);
if
(
ci
->
onlyread
[
0
]
==
'\0'
||
overwrite
)
SQLGetPrivateProfileString
(
DSN
,
INI_READONLY
,
""
,
ci
->
onlyread
,
sizeof
(
ci
->
onlyread
),
ODBC_INI
);
if
(
ci
->
show_oid_column
[
0
]
==
'\0'
||
overwrite
)
SQLGetPrivateProfileString
(
DSN
,
INI_SHOWOIDCOLUMN
,
""
,
ci
->
show_oid_column
,
sizeof
(
ci
->
show_oid_column
),
ODBC_INI
);
...
...
@@ -501,8 +501,8 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
ci
->
database
,
ci
->
username
,
ci
->
password
);
qlog
(
"
readonly
='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'
\n
"
,
ci
->
readonly
,
qlog
(
"
onlyread
='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'
\n
"
,
ci
->
onlyread
,
ci
->
protocol
,
ci
->
show_oid_column
,
ci
->
fake_oid_index
,
...
...
@@ -557,7 +557,7 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
SQLWritePrivateProfileString
(
DSN
,
INI_READONLY
,
ci
->
readonly
,
ci
->
onlyread
,
ODBC_INI
);
SQLWritePrivateProfileString
(
DSN
,
...
...
@@ -772,9 +772,9 @@ char temp[256];
SQLGetPrivateProfileString
(
section
,
INI_READONLY
,
""
,
temp
,
sizeof
(
temp
),
filename
);
if
(
temp
[
0
]
)
globals
.
readonly
=
atoi
(
temp
);
globals
.
onlyread
=
atoi
(
temp
);
else
globals
.
readonly
=
DEFAULT_READONLY
;
globals
.
onlyread
=
DEFAULT_READONLY
;
/* Default state for future DSN's protocol attribute
This isn't a real driver option YET. This is more
...
...
@@ -818,7 +818,7 @@ char tmp[128];
SQLWritePrivateProfileString
(
DBMS_NAME
,
INI_UNIQUEINDEX
,
tmp
,
ODBCINST_INI
);
sprintf
(
tmp
,
"%d"
,
globals
.
readonly
);
sprintf
(
tmp
,
"%d"
,
globals
.
onlyread
);
SQLWritePrivateProfileString
(
DBMS_NAME
,
INI_READONLY
,
tmp
,
ODBCINST_INI
);
...
...
src/interfaces/odbc/execute.c
浏览文件 @
d264b53d
...
...
@@ -108,8 +108,8 @@ StatementClass *self = (StatementClass *) hstmt;
self
->
prepare
=
TRUE
;
self
->
statement_type
=
statement_type
(
self
->
statement
);
// Check if connection is
readonly
(only selects are allowed)
if
(
CC_is_
readonly
(
self
->
hdbc
)
&&
STMT_UPDATE
(
self
))
{
// Check if connection is
onlyread
(only selects are allowed)
if
(
CC_is_
onlyread
(
self
->
hdbc
)
&&
STMT_UPDATE
(
self
))
{
self
->
errornumber
=
STMT_EXEC_ERROR
;
self
->
errormsg
=
"Connection is readonly, only select statements are allowed."
;
SC_log_error
(
func
,
""
,
self
);
...
...
@@ -159,8 +159,8 @@ static char *func = "SQLExecDirect";
stmt
->
prepare
=
FALSE
;
stmt
->
statement_type
=
statement_type
(
stmt
->
statement
);
// Check if connection is
readonly
(only selects are allowed)
if
(
CC_is_
readonly
(
stmt
->
hdbc
)
&&
STMT_UPDATE
(
stmt
))
{
// Check if connection is
onlyread
(only selects are allowed)
if
(
CC_is_
onlyread
(
stmt
->
hdbc
)
&&
STMT_UPDATE
(
stmt
))
{
stmt
->
errornumber
=
STMT_EXEC_ERROR
;
stmt
->
errormsg
=
"Connection is readonly, only select statements are allowed."
;
SC_log_error
(
func
,
""
,
stmt
);
...
...
@@ -727,5 +727,3 @@ char *buffer;
return
SQL_SUCCESS
;
}
src/interfaces/odbc/info.c
浏览文件 @
d264b53d
...
...
@@ -173,7 +173,7 @@ RETCODE result;
break
;
case
SQL_DATA_SOURCE_READ_ONLY
:
/* ODBC 1.0 */
p
=
CC_is_
readonly
(
conn
)
?
"Y"
:
"N"
;
p
=
CC_is_
onlyread
(
conn
)
?
"Y"
:
"N"
;
break
;
case
SQL_DATABASE_NAME
:
/* Support for old ODBC 1.0 Apps */
...
...
src/interfaces/odbc/misc.c
浏览文件 @
d264b53d
...
...
@@ -61,7 +61,7 @@ mylog(va_alist)
va_dcl
{
char
*
fmt
;
char
*
args
;
va_list
args
;
char
filebuf
[
80
];
FILE
*
LOGFP
=
globals
.
mylogFP
;
...
...
@@ -95,7 +95,7 @@ void qlog(va_alist)
va_dcl
{
char
*
fmt
;
char
*
args
;
va_list
args
;
char
filebuf
[
80
];
FILE
*
LOGFP
=
globals
.
qlogFP
;
...
...
src/interfaces/odbc/psqlodbc.h
浏览文件 @
d264b53d
...
...
@@ -113,7 +113,7 @@ typedef struct GlobalValues_
char
disable_optimizer
;
char
ksqo
;
char
unique_index
;
char
readonly
;
char
onlyread
;
/* readonly is reserved on Digital C++ compiler */
char
use_declarefetch
;
char
text_as_longvarchar
;
char
unknowns_as_longvarchar
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录