mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Hi, here are the patches to enhance existing MB handling. This time
I have implemented a framework of encoding translation between the backend and the frontend. Also I have added a new variable setting command: SET CLIENT_ENCODING TO 'encoding'; Other features include: Latin1 support more 8 bit cleaness See doc/README.mb for more details. Note that the pacthes are against May 30 snapshot. Tatsuo Ishii
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# Makefile for access/common
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/backend/access/common/Makefile,v 1.10 1998/04/06 00:20:44 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/access/common/Makefile,v 1.11 1998/06/16 07:29:18 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -13,6 +13,10 @@ include ../../../Makefile.global
|
||||
|
||||
CFLAGS+=-I../..
|
||||
|
||||
ifdef MB
|
||||
CFLAGS+= -DMB=$(MB)
|
||||
endif
|
||||
|
||||
OBJS = heaptuple.o heapvalid.o indextuple.o indexvalid.o printtup.o \
|
||||
scankey.o tupdesc.o
|
||||
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.28 1998/05/14 17:18:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.29 1998/06/16 07:29:18 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -23,6 +23,10 @@
|
||||
#include <libpq/libpq.h>
|
||||
#include <utils/syscache.h>
|
||||
|
||||
#ifdef MB
|
||||
#include <commands/variable.h>
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* printtup / debugtup support
|
||||
* ----------------------------------------------------------------
|
||||
@@ -80,6 +84,9 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||
Datum attr;
|
||||
bool isnull;
|
||||
Oid typoutput;
|
||||
#ifdef MB
|
||||
unsigned char *p;
|
||||
#endif
|
||||
|
||||
/* ----------------
|
||||
* tell the frontend to expect new tuple data
|
||||
@@ -125,8 +132,14 @@ printtup(HeapTuple tuple, TupleDesc typeinfo)
|
||||
outputstr = fmgr(typoutput, attr,
|
||||
gettypelem(typeinfo->attrs[i]->atttypid),
|
||||
typeinfo->attrs[i]->atttypmod);
|
||||
#ifdef MB
|
||||
p = pg_server_to_client(outputstr, strlen(outputstr));
|
||||
pq_putint(strlen(p) + VARHDRSZ, VARHDRSZ);
|
||||
pq_putnchar(p, strlen(p));
|
||||
#else
|
||||
pq_putint(strlen(outputstr) + VARHDRSZ, VARHDRSZ);
|
||||
pq_putnchar(outputstr, strlen(outputstr));
|
||||
#endif
|
||||
pfree(outputstr);
|
||||
}
|
||||
}
|
||||
@@ -268,8 +281,12 @@ printtup_internal(HeapTuple tuple, TupleDesc typeinfo)
|
||||
/* variable length, assume a varlena structure */
|
||||
len = VARSIZE(attr) - VARHDRSZ;
|
||||
|
||||
#ifdef MB
|
||||
pq_putncharlen(VARDATA(attr), len);
|
||||
#else
|
||||
pq_putint(len, VARHDRSZ);
|
||||
pq_putnchar(VARDATA(attr), len);
|
||||
#endif
|
||||
#ifdef IPORTAL_DEBUG
|
||||
{
|
||||
char *d = VARDATA(attr);
|
||||
|
Reference in New Issue
Block a user