mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
From: t-ishii@sra.co.jp
As Bruce mentioned, this is due to the conflict among changes we made. Included patches should fix the problem(I changed all MB to MULTIBYTE). Please let me know if you have further problem. P.S. I did not include pathces to configure and gram.c to save the file size(configure.in and gram.y modified).
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# Makefile for commands
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/backend/commands/Makefile,v 1.14 1998/07/24 03:31:11 scrappy Exp $
|
||||
# $Header: /cvsroot/pgsql/src/backend/commands/Makefile,v 1.15 1998/07/26 04:30:22 scrappy Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@@ -13,8 +13,8 @@ include ../../Makefile.global
|
||||
|
||||
CFLAGS += -I..
|
||||
|
||||
ifdef MB
|
||||
CFLAGS += -DMB=$(MB)
|
||||
ifdef MULTIBYTE
|
||||
CFLAGS+= $(MBFLAGS)
|
||||
endif
|
||||
|
||||
OBJS = async.o creatinh.o command.o copy.o defind.o define.o \
|
||||
|
@@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.24 1998/07/24 03:31:13 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.25 1998/07/26 04:30:22 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -43,7 +43,7 @@
|
||||
#include <utils/excid.h>
|
||||
#include <utils/mcxt.h>
|
||||
#include <catalog/pg_proc.h>
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
#include <catalog/pg_class_mb.h>
|
||||
#else
|
||||
#include <catalog/pg_class.h>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.50 1998/07/24 03:31:14 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.51 1998/07/26 04:30:23 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "commands/trigger.h"
|
||||
#include <storage/fd.h>
|
||||
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
#include "mb/pg_wchar.h"
|
||||
#endif
|
||||
|
||||
@@ -1016,14 +1016,14 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
char c;
|
||||
int done = 0;
|
||||
int i = 0;
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
int mblen;
|
||||
int encoding;
|
||||
unsigned char s[2];
|
||||
int j;
|
||||
#endif
|
||||
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
encoding = pg_get_client_encoding();
|
||||
s[1] = 0;
|
||||
#endif
|
||||
@@ -1129,7 +1129,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
}
|
||||
if (!done) {
|
||||
attribute[i++] = c;
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
s[0] = c;
|
||||
mblen = pg_encoding_mblen(encoding, s);
|
||||
mblen--;
|
||||
@@ -1145,7 +1145,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
elog(ERROR, "CopyReadAttribute - attribute length too long. line: %d", lineno);
|
||||
}
|
||||
attribute[i] = '\0';
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
return(pg_client_to_server((unsigned char*)attribute, strlen(attribute)));
|
||||
#else
|
||||
return (&attribute[0]);
|
||||
@@ -1157,20 +1157,20 @@ CopyAttributeOut(FILE *fp, unsigned char *server_string, char *delim, int is_arr
|
||||
{
|
||||
unsigned char *string;
|
||||
unsigned char c;
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
int mblen;
|
||||
int encoding;
|
||||
int i;
|
||||
#endif
|
||||
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
string = pg_server_to_client(server_string, strlen(server_string));
|
||||
encoding = pg_get_client_encoding();
|
||||
#else
|
||||
string = server_string;
|
||||
#endif
|
||||
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
for (; (mblen = pg_encoding_mblen(encoding, string)) &&
|
||||
((c = *string) != '\0'); string += mblen)
|
||||
#else
|
||||
@@ -1197,7 +1197,7 @@ CopyAttributeOut(FILE *fp, unsigned char *server_string, char *delim, int is_arr
|
||||
fputc('\\', fp);
|
||||
}
|
||||
}
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
for (i=0;i<mblen;i++) {
|
||||
fputc(*(string+i), fp);
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.16 1998/07/24 03:31:15 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.17 1998/07/26 04:30:24 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "access/htup.h"
|
||||
#include "access/relscan.h"
|
||||
#include "catalog/catname.h"
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
#include "catalog/pg_database_mb.h"
|
||||
#else
|
||||
#include "catalog/pg_database.h"
|
||||
@@ -47,7 +47,7 @@ static HeapTuple get_pg_dbtup(char *command, char *dbname, Relation dbrel);
|
||||
static void stop_vacuum(char *dbpath, char *dbname);
|
||||
|
||||
void
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
createdb(char *dbname, char *dbpath, int encoding)
|
||||
#else
|
||||
createdb(char *dbname, char *dbpath)
|
||||
@@ -98,7 +98,7 @@ createdb(char *dbname, char *dbpath)
|
||||
dbname, user_id, dbname);
|
||||
#endif
|
||||
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
sprintf(buf, "insert into pg_database (datname, datdba, encoding, datpath)"
|
||||
" values (\'%s\', \'%d\', \'%d\', \'%s\');", dbname, user_id, encoding, loc);
|
||||
#else
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.12 1998/07/24 03:31:19 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.13 1998/07/26 04:30:24 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <utils/excid.h>
|
||||
#include <utils/mcxt.h>
|
||||
#include <catalog/pg_proc.h>
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
#include <catalog/pg_class_mb.h>
|
||||
#else
|
||||
#include <catalog/pg_class.h>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
#include <miscadmin.h>
|
||||
#include <catalog/catname.h>
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
#include <catalog/pg_database_mb.h>
|
||||
#else
|
||||
#include <catalog/pg_database.h>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.67 1998/07/24 03:31:20 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.68 1998/07/26 04:30:25 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "catalog/catalog.h"
|
||||
#include "catalog/catname.h"
|
||||
#include "catalog/index.h"
|
||||
#ifdef MB
|
||||
#ifdef MULTIBYTE
|
||||
#include "catalog/pg_class_mb.h"
|
||||
#else
|
||||
#include "catalog/pg_class.h"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* Routines for handling of 'SET var TO',
|
||||
* 'SHOW var' and 'RESET var' statements.
|
||||
*
|
||||
* $Id: variable.c,v 1.9 1998/07/24 03:31:20 scrappy Exp $
|
||||
* $Id: variable.c,v 1.10 1998/07/26 04:30:26 scrappy Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "utils/builtins.h"
|
||||
#include "optimizer/internal.h"
|
||||
#ifdef MULTIBYTE
|
||||
#include "regex/pg_wchar.h"
|
||||
#include "mb/pg_wchar.h"
|
||||
#endif
|
||||
|
||||
extern Cost _cpu_page_wight_;
|
||||
@@ -522,54 +522,6 @@ reset_timezone()
|
||||
return TRUE;
|
||||
} /* reset_timezone() */
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
/*-----------------------------------------------------------------------*/
|
||||
bool
|
||||
parse_client_encoding(const char *value)
|
||||
{
|
||||
int encoding;
|
||||
|
||||
encoding = pg_valid_client_encoding(value);
|
||||
if (encoding < 0) {
|
||||
elog(ERROR, "Client encoding %s is not supported", value);
|
||||
} else {
|
||||
if (pg_set_client_encoding(encoding)) {
|
||||
elog(ERROR, "Conversion between %s and %s is not supported",
|
||||
value, pg_encoding_to_char(MULTIBYTE));
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool
|
||||
show_client_encoding()
|
||||
{
|
||||
elog(NOTICE, "Current client encoding is %s",
|
||||
pg_encoding_to_char(pg_get_client_encoding()));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool
|
||||
reset_client_encoding()
|
||||
{
|
||||
int encoding;
|
||||
char *env = getenv("PGCLIENTENCODING");
|
||||
|
||||
if (env) {
|
||||
encoding = pg_char_to_encoding(env);
|
||||
if (encoding < 0) {
|
||||
encoding = MULTIBYTE;
|
||||
}
|
||||
} else {
|
||||
encoding = MULTIBYTE;
|
||||
}
|
||||
pg_set_client_encoding(encoding);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
#endif
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
struct VariableParsers
|
||||
{
|
||||
|
Reference in New Issue
Block a user