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

Commit2ae5d51

Browse files
committed
From: Tatsuo Ishii <t-ishii@sra.co.jp>Included patches fix a portability problem of unsetenv() used in6.4.2 multi-byte support. unsetenv() is only avaliable on FreeBSD andLinux so I decided to replace with putenv().
1 parente27f879 commit2ae5d51

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

‎src/backend/parser/analyze.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: analyze.c,v 1.95 1999/01/25 12:01:05 vadim Exp $
8+
* $Id: analyze.c,v 1.96 1999/01/2701:18:20 scrappy Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -714,6 +714,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
714714
index=makeNode(IndexStmt);
715715

716716
index->unique= TRUE;
717+
index->primary= (constraint->contype==CONSTR_PRIMARY ? TRUE:FALSE);
717718
if (constraint->name!=NULL)
718719
index->idxname=constraint->name;
719720
elseif (constraint->contype==CONSTR_PRIMARY)
@@ -722,14 +723,10 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
722723
elog(ERROR,"CREATE TABLE/PRIMARY KEY multiple keys for table %s are not legal",stmt->relname);
723724

724725
have_pkey= TRUE;
725-
index->primary= TRUE;
726726
index->idxname=makeTableName(stmt->relname,"pkey",NULL);
727727
}
728728
else
729-
{
730-
index->primary= FALSE;
731729
index->idxname=NULL;
732-
}
733730

734731
index->relname=stmt->relname;
735732
index->accessMethod="btree";

‎src/bin/psql/psql.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.166 1999/01/17 06:19:19 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.167 1999/01/27 01:18:21 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1509,7 +1509,8 @@ do_connect(const char *new_dbname,
15091509
PGCLIENTENCODING value. -- 1998/12/12 Tatsuo Ishii */
15101510

15111511
if (!has_client_encoding) {
1512-
unsetenv("PGCLIENTENCODING");
1512+
staticconstcharev[]="PGCLIENTENCODING=";
1513+
putenv(ev);
15131514
}
15141515
#endif
15151516

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.88 1999/01/17 06:19:35 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.89 1999/01/27 01:18:22 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -816,7 +816,7 @@ PQsetenv(PGconn *conn)
816816
#ifdefMULTIBYTE
817817
/* query server encoding */
818818
env=getenv(envname);
819-
if (!env)
819+
if (!env||*env==NULL)
820820
{
821821
rtn=PQexec(conn,"select getdatabaseencoding()");
822822
if (rtn&&PQresultStatus(rtn)==PGRES_TUPLES_OK)

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

Lines changed: 2 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.15 1998/10/06 14:16:50 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.16 1999/01/27 01:18:23 scrappy Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -506,7 +506,7 @@ PQmblen(unsigned char *s)
506506
intencoding=-1;
507507

508508
str=getenv("PGCLIENTENCODING");
509-
if (str)
509+
if (str&&*str!=NULL)
510510
encoding=pg_char_to_encoding(str);
511511
if (encoding<0)
512512
encoding=MULTIBYTE;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp