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

Commite1ebac3

Browse files
committed
Here are the patches against the current source tree. I have run the
regression test on a FreeBSD box with both non-MULTIBYTE andMULTIBYTE-enabled, and confirmed that the results are same.However I do not tested on PCs(I don't have access to win). Please letme know if the patches break anything on PCs.Also please note that the patch for varchar.c is a fix for a nasty bugof char(n) types that I introduced and I believe at least this shouldbe applied.Tatsuo Ishii
1 parentc77a29a commite1ebac3

File tree

7 files changed

+58
-10
lines changed

7 files changed

+58
-10
lines changed

‎src/backend/utils/adt/varchar.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.41 1998/09/25 15:51:02 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.42 1998/10/06 03:02:20 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -163,7 +163,11 @@ bpchar(char *s, int32 len)
163163
#ifdefMULTIBYTE
164164
/* truncate multi-byte string in a way not to break
165165
multi-byte boundary */
166-
slen=pg_mbcliplen(VARDATA(s),rlen,rlen);
166+
if (VARSIZE(s)>len) {
167+
slen=pg_mbcliplen(VARDATA(s),VARSIZE(s)-VARHDRSZ,rlen);
168+
}else {
169+
slen=VARSIZE(s)-VARHDRSZ;
170+
}
167171
#else
168172
slen=VARSIZE(s)-VARHDRSZ;
169173
#endif

‎src/backend/utils/mb/common.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22
* This file contains some public functions
33
* usable for both the backend and the frontend.
44
* Tatsuo Ishii
5-
* $Id: common.c,v 1.2 1998/09/01 04:33:19 momjian Exp $ */
5+
* $Id: common.c,v 1.3 1998/10/06 03:02:21 momjian Exp $ */
6+
7+
#include<stdlib.h>
8+
9+
#ifdefWIN32
10+
#include"win32.h"
11+
#else
12+
#if !defined(NO_UNISTD_H)
13+
#include<unistd.h>
14+
#endif
15+
#endif
616

7-
#include<stdio.h>
817
#include<string.h>
918

1019
#include"mb/pg_wchar.h"

‎src/bin/psql/win32.mak

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ CLEAN :
2929
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D\
3030
"_MBCS" /Fp"$(INTDIR)\psql.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c\
3131
/I ..\..\include /I ..\..\interfaces\libpq
32+
33+
!IFDEF MULTIBYTE
34+
!IFNDEF MBFLAGS
35+
MBFLAGS="-DMULTIBYTE=$(MULTIBYTE)"
36+
!ENDIF
37+
CPP_PROJ=$(MBFLAGS)$(CPP_PROJ)
38+
!ENDIF
39+
3240
CPP_OBJS=.\Release/
3341
CPP_SBRS=.
3442

‎src/interfaces/libpq/fe-print.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* didn't really belong there.
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.13 1998/10/04 20:46:39 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.14 1998/10/06 03:02:25 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -513,7 +513,17 @@ PQmblen(unsigned char *s)
513513
return (pg_encoding_mblen(encoding,s));
514514
}
515515

516-
#endif
516+
#else
517+
518+
#ifdefWIN32
519+
int
520+
PQmblen(unsignedchar*s)
521+
{
522+
}
523+
#endif/* WIN32 */
524+
525+
526+
#endif/* MULTIBYTE */
517527

518528
staticvoid
519529
do_field(PQprintOpt*po,PGresult*res,

‎src/interfaces/libpq/libpqdll.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ EXPORTS
6363
lo_unlink@ 60
6464
lo_import@ 61
6565
lo_export@ 62
66-
PQresultErrorMessage@ 63
66+
pgresStatus@ 63
67+
PQmblen@ 64

‎src/interfaces/libpq/win32.mak

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CLEAN :
3333
-@erase"$(OUTDIR)\libpq.lib"
3434
-@erase"$(OUTDIR)\libpq.dll"
3535
-@erase"$(OUTDIR)\libpq.res"
36-
-@erase"$(OUTDIR)\vc*.*"
36+
-@erase"vc50.pch"
3737
-@erase"$(OUTDIR)\libpq.pch"
3838
-@erase"$(OUTDIR)\libpqdll.exp"
3939
-@erase"$(OUTDIR)\libpqdll.lib"
@@ -44,6 +44,14 @@ CLEAN :
4444
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D\
4545
"WIN32" /D "_WINDOWS" /Fp"$(INTDIR)\libpq.pch" /YX\
4646
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
47+
48+
!IFDEF MULTIBYTE
49+
!IFNDEFMBFLAGS
50+
MBFLAGS="-DMULTIBYTE=$(MULTIBYTE)"
51+
!ENDIF
52+
CPP_PROJ =$(CPP_PROJ)$(MBFLAGS)
53+
!ENDIF
54+
4755
CPP_OBJS=.\Release/
4856
CPP_SBRS=.
4957

@@ -58,6 +66,10 @@ LIB32_OBJS= \
5866
"$(INTDIR)\fe-misc.obj"\
5967
"$(INTDIR)\fe-print.obj"
6068

69+
!IFDEF MULTIBYTE
70+
LIB32_OBJS =$(LIB32_OBJS)$(INTDIR)\common.obj$(INTDIR)\wchar.obj$(INTDIR)\conv.obj
71+
!ENDIF
72+
6173
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\libpq.res"
6274

6375
LINK32=link.exe

‎src/win32.mak

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ NULL=
1010
NULL=nul
1111
!ENDIF
1212

13+
!IFDEFMULTIBYTE
14+
MAKEMACRO = "MULTIBYTE=$(MULTIBYTE)"
15+
!ENDIF
16+
1317
ALL:
1418
cd interfaces\libpq
15-
nmake /f win32.mak
19+
nmake /f win32.mak $(MAKEMACRO)
1620
cd ..\..\bin\psql
17-
nmake /f win32.mak
21+
nmake /f win32.mak $(MAKEMACRO)
1822
cd ..\..
1923
echo All Win32 parts have been built!

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp