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
c9f87042
Commit
c9f87042
authored
Jun 28, 2002
by
Hiroshi Inoue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1) prevent setting of KSQO on 7.3+ servers(Thanks to Dave Page).
2) Allow LF->CR/LF conversion under UNICODE driver.
parent
23e5da8a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
src/interfaces/odbc/connection.c
src/interfaces/odbc/connection.c
+9
-4
src/interfaces/odbc/convert.c
src/interfaces/odbc/convert.c
+2
-2
src/interfaces/odbc/psqlodbc.h
src/interfaces/odbc/psqlodbc.h
+3
-2
src/interfaces/odbc/win_unicode.c
src/interfaces/odbc/win_unicode.c
+8
-1
No files found.
src/interfaces/odbc/connection.c
View file @
c9f87042
...
...
@@ -952,6 +952,13 @@ another_version_retry:
* Send any initial settings
*/
/*
* Get the version number first so we can check it before sending options
* that are now obsolete. DJP 21/06/2002
*/
CC_lookup_pg_version
(
self
);
/* Get PostgreSQL version for
SQLGetInfo use */
/*
* Since these functions allocate statements, and since the connection
* is not established yet, it would violate odbc state transition
...
...
@@ -961,8 +968,6 @@ another_version_retry:
CC_send_settings
(
self
);
CC_lookup_lo
(
self
);
/* a hack to get the oid of
our large object oid type */
CC_lookup_pg_version
(
self
);
/* Get PostgreSQL version for
SQLGetInfo use */
/*
* Multibyte handling is available ?
...
...
@@ -1802,8 +1807,8 @@ CC_send_settings(ConnectionClass *self)
}
/* KSQO */
if
(
ci
->
drivers
.
ksqo
)
/* KSQO
(not applicable to 7.1+ - DJP 21/06/2002)
*/
if
(
ci
->
drivers
.
ksqo
&&
PG_VERSION_LT
(
self
,
7
.
1
)
)
{
result
=
PGAPI_ExecDirect
(
hstmt
,
"set ksqo to 'ON'"
,
SQL_NTS
);
if
((
result
!=
SQL_SUCCESS
)
&&
(
result
!=
SQL_SUCCESS_WITH_INFO
))
...
...
src/interfaces/odbc/convert.c
View file @
c9f87042
...
...
@@ -702,7 +702,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
#ifdef UNICODE_SUPPORT
if
(
fCType
==
SQL_C_WCHAR
)
{
len
=
utf8_to_ucs2
(
neut_str
,
-
1
,
NULL
,
0
);
len
=
utf8_to_ucs2
_lf
(
neut_str
,
-
1
,
lf_conv
,
NULL
,
0
);
len
*=
2
;
wchanged
=
changed
=
TRUE
;
}
...
...
@@ -728,7 +728,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
#ifdef UNICODE_SUPPORT
if
(
fCType
==
SQL_C_WCHAR
)
{
utf8_to_ucs2
(
neut_str
,
-
1
,
(
SQLWCHAR
*
)
pbic
->
ttlbuf
,
len
/
2
);
utf8_to_ucs2
_lf
(
neut_str
,
-
1
,
lf_conv
,
(
SQLWCHAR
*
)
pbic
->
ttlbuf
,
len
/
2
);
}
else
#endif
/* UNICODE_SUPPORT */
...
...
src/interfaces/odbc/psqlodbc.h
View file @
c9f87042
...
...
@@ -5,7 +5,7 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
* $Id: psqlodbc.h,v 1.6
7 2002/06/06 04:50:47
inoue Exp $
* $Id: psqlodbc.h,v 1.6
8 2002/06/28 02:44:15
inoue Exp $
*
*/
...
...
@@ -255,7 +255,8 @@ void logs_on_off(int cnopen, int, int);
#ifdef UNICODE_SUPPORT
UInt4
ucs2strlen
(
const
SQLWCHAR
*
ucs2str
);
char
*
ucs2_to_utf8
(
const
SQLWCHAR
*
ucs2str
,
Int4
ilen
,
UInt4
*
olen
);
UInt4
utf8_to_ucs2
(
const
char
*
utf8str
,
Int4
ilen
,
SQLWCHAR
*
ucs2str
,
UInt4
buflen
);
UInt4
utf8_to_ucs2_lf
(
const
char
*
utf8str
,
Int4
ilen
,
BOOL
lfconv
,
SQLWCHAR
*
ucs2str
,
UInt4
buflen
);
#define utf8_to_ucs2(utf8str, ilen, ucs2str, buflen) utf8_to_ucs2_lf(utf8str, ilen, FALSE, ucs2str, buflen)
#endif
/* UNICODE_SUPPORT */
/*#define _MEMORY_DEBUG_ */
#ifdef _MEMORY_DEBUG_
...
...
src/interfaces/odbc/win_unicode.c
View file @
c9f87042
...
...
@@ -82,7 +82,7 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, Int4 ilen, UInt4 *olen)
#define byte3_m3 0x3f
#define byte2_m1 0x1f
#define byte2_m2 0x3f
UInt4
utf8_to_ucs2
(
const
char
*
utf8str
,
Int4
ilen
,
SQLWCHAR
*
ucs2str
,
UInt4
bufcount
)
UInt4
utf8_to_ucs2
_lf
(
const
char
*
utf8str
,
Int4
ilen
,
BOOL
lfconv
,
SQLWCHAR
*
ucs2str
,
UInt4
bufcount
)
{
int
i
;
UInt4
ocount
,
wcode
;
...
...
@@ -102,6 +102,13 @@ UInt4 utf8_to_ucs2(const char *utf8str, Int4 ilen, SQLWCHAR *ucs2str, UInt4 bufc
{
if
(
iswascii
(
*
str
))
{
if
(
lfconv
&&
*
str
==
'\n'
&&
(
i
==
0
||
str
[
-
1
]
!=
'\r'
))
{
if
(
ocount
<
bufcount
)
ucs2str
[
ocount
]
=
'\r'
;
ocount
++
;
}
if
(
ocount
<
bufcount
)
ucs2str
[
ocount
]
=
*
str
;
ocount
++
;
...
...
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