Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d264b53d
Commit
d264b53d
authored
Nov 30, 1999
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename readonly to onlyread in odbc. Use varargs properly.
parent
daf6ffb6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
29 deletions
+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
No files found.
src/interfaces/odbc/connection.h
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment