Commit d330f09a authored by Tatsuo Ishii's avatar Tatsuo Ishii

Backout Karel's patch

parent 1a63ef05
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* client encoding and server internal encoding. * client encoding and server internal encoding.
* (currently mule internal code (mic) is used) * (currently mule internal code (mic) is used)
* Tatsuo Ishii * Tatsuo Ishii
* $Id: mbutils.c,v 1.21 2001/09/08 14:30:15 momjian Exp $ * $Id: mbutils.c,v 1.22 2001/09/09 01:15:11 ishii Exp $
*/ */
#include "postgres.h" #include "postgres.h"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* Karel Zak (Aug 2001) * Karel Zak (Aug 2001)
*/ */
static pg_enc2name *ClientEncoding = NULL; static pg_enc2name *ClientEncoding = &pg_enc2name_tbl[ PG_SQL_ASCII ];
static pg_enc2name *DatabaseEncoding = &pg_enc2name_tbl[ PG_SQL_ASCII ]; static pg_enc2name *DatabaseEncoding = &pg_enc2name_tbl[ PG_SQL_ASCII ];
static void (*client_to_mic) (); /* something to MIC */ static void (*client_to_mic) (); /* something to MIC */
...@@ -134,12 +134,7 @@ pg_set_client_encoding(int encoding) ...@@ -134,12 +134,7 @@ pg_set_client_encoding(int encoding)
int int
pg_get_client_encoding() pg_get_client_encoding()
{ {
Assert(DatabaseEncoding); Assert(ClientEncoding);
if (ClientEncoding == NULL)
/* this is the first time */
ClientEncoding = DatabaseEncoding;
return (ClientEncoding->encoding); return (ClientEncoding->encoding);
} }
...@@ -149,12 +144,7 @@ pg_get_client_encoding() ...@@ -149,12 +144,7 @@ pg_get_client_encoding()
const char * const char *
pg_get_client_encoding_name() pg_get_client_encoding_name()
{ {
Assert(DatabaseEncoding); Assert(ClientEncoding);
if (ClientEncoding == NULL)
/* this is the first time */
ClientEncoding = DatabaseEncoding;
return (ClientEncoding->name); return (ClientEncoding->name);
} }
...@@ -310,10 +300,7 @@ unsigned char * ...@@ -310,10 +300,7 @@ unsigned char *
pg_client_to_server(unsigned char *s, int len) pg_client_to_server(unsigned char *s, int len)
{ {
Assert(DatabaseEncoding); Assert(DatabaseEncoding);
Assert(ClientEncoding);
if (ClientEncoding == NULL)
/* this is the first time */
ClientEncoding = DatabaseEncoding;
if (ClientEncoding->encoding == DatabaseEncoding->encoding) if (ClientEncoding->encoding == DatabaseEncoding->encoding)
return s; return s;
...@@ -338,10 +325,7 @@ unsigned char * ...@@ -338,10 +325,7 @@ unsigned char *
pg_server_to_client(unsigned char *s, int len) pg_server_to_client(unsigned char *s, int len)
{ {
Assert(DatabaseEncoding); Assert(DatabaseEncoding);
Assert(ClientEncoding);
if (ClientEncoding == NULL)
/* this is the first time */
ClientEncoding = DatabaseEncoding;
if (ClientEncoding->encoding == DatabaseEncoding->encoding) if (ClientEncoding->encoding == DatabaseEncoding->encoding)
return s; return s;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment