--- sql/pgsql/parser3pgsql.C 2004/03/05 10:16:41 1.18 +++ sql/pgsql/parser3pgsql.C 2004/03/30 08:18:25 1.20 @@ -7,7 +7,7 @@ 2001.07.30 using PgSQL 7.1.2 */ -static const char *RCSId="$Id: parser3pgsql.C,v 1.18 2004/03/05 10:16:41 paf Exp $"; +static const char *RCSId="$Id: parser3pgsql.C,v 1.20 2004/03/30 08:18:25 paf Exp $"; #include "config_includes.h" @@ -58,7 +58,7 @@ static char *lsplit(char **string_ref, c return result; } -static void toupper(char *out, const char *in, size_t size) { +static void toupper_str(char *out, const char *in, size_t size) { while(size--) *out++=(char)toupper(*in++); } @@ -133,7 +133,7 @@ public: if(*key) { if(char *value=lsplit(key, '=')) { if(strcmp(key, "ClientCharset" ) == 0) { - toupper(value, value, strlen(value)); + toupper_str(value, value, strlen(value)); connection.cstrClientCharset=value; } else if(strcasecmp(key, "charset")==0) { // left for backward compatibility, consider using ClientCharset cstrBackwardCompAskServerToTranscode=value; @@ -232,11 +232,12 @@ public: SQL_Driver_query_event_handlers& handlers) { // _asm int 3; Connection& connection=*static_cast(aconnection); + const char* cstrClientCharset=connection.cstrClientCharset; SQL_Driver_services& services=*connection.services; PGconn *conn=connection.conn; // transcode from $request:charset to connect-string?client_charset - if(const char* cstrClientCharset=connection.cstrClientCharset) { + if(cstrClientCharset) { size_t transcoded_statement_size; services.transcode(astatement, strlen(astatement), astatement, transcoded_statement_size, @@ -281,16 +282,16 @@ public: for(int i=0; i