Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20241a4

Browse files
author
Hiroshi Inoue
committed
1) Add support for GB18030.
2) Fix a bug about the handling of large objects.
1 parent0b58483 commit20241a4

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

‎src/interfaces/odbc/execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ PGAPI_ParamData(
777777
/* commit transaction if needed */
778778
if (!ci->drivers.use_declarefetch&&CC_is_in_autocommit(stmt->hdbc))
779779
{
780-
if (CC_commit(stmt->hdbc))
780+
if (!CC_commit(stmt->hdbc))
781781
{
782782
stmt->errormsg="Could not commit (in-line) a transaction";
783783
stmt->errornumber=STMT_EXEC_ERROR;

‎src/interfaces/odbc/multibyte.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pg_CS CS_Table[] =
5656
{"GBK",GBK },
5757
{"UHC",UHC },
5858
{"WIN1250",WIN1250 },
59+
{"GB18030",GB18030 },
5960
{"OTHER",OTHER }
6061
};
6162

@@ -239,6 +240,25 @@ pg_CS_stat(int stat,unsigned int character,int characterset_code)
239240
stat=0;
240241
}
241242
break;
243+
/*Chinese GB18030 support.Added by Bill Huang <bhuang@redhat.com> <bill_huanghb@ybb.ne.jp>*/
244+
caseGB18030:
245+
{
246+
if (stat<2&&character>0x80)
247+
stat=2;
248+
elseif (stat=2)
249+
if (character >=0x30&&character <=0x39)
250+
stat=3;
251+
else
252+
stat=1;
253+
elseif (stat=3)
254+
if (character >=0x30&&character <=0x39)
255+
stat=1;
256+
else
257+
stat=3;
258+
else
259+
stat=0;
260+
}
261+
break;
242262
default:
243263
{
244264
stat=0;

‎src/interfaces/odbc/multibyte.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#defineGBK30/* GBK */
4242
#defineUHC31/* UHC */
4343
#defineWIN125032/* windows-1250 */
44+
#defineGB1803033/* GB18030 */
4445
#defineOTHER-1
4546

4647
#defineMAX_CHARACTERSET_NAME24

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp