--- sql/pgsql/parser3pgsql.C 2008/06/24 17:43:48 1.29 +++ sql/pgsql/parser3pgsql.C 2008/06/26 15:49:40 1.30 @@ -7,7 +7,7 @@ 2007.10.25 using PgSQL 8.1.5 */ -static const char *RCSId="$Id: parser3pgsql.C,v 1.29 2008/06/24 17:43:48 misha Exp $"; +static const char *RCSId="$Id: parser3pgsql.C,v 1.30 2008/06/26 15:49:40 misha Exp $"; #include "config_includes.h" @@ -36,14 +36,13 @@ static const char *RCSId="$Id: parser3pg #endif #ifndef max -inline int max(int a,int b) { return a>b?a:b; } +inline int max(int a,int b){ return a>b?a:b; } inline int min(int a,int b){ return a suffixes const char *o; - if(offset || limit) { + if(offset || limit!=SQL_NO_LIMIT){ char *cur=result; memcpy(cur, astatement, statement_size); cur+=statement_size; - if(limit) + if(limit!=SQL_NO_LIMIT) cur+=snprintf(cur, 7+MAX_NUMBER, " limit %u", limit); if(offset) cur+=snprintf(cur, 8+MAX_NUMBER, " offset %u", offset); @@ -518,6 +510,10 @@ private: // private funcs return result; } + bool _transcode_required(Connection& connection){ + return (connection.client_charset && strcmp(connection.client_charset, connection.services->request_charset())!=0); + } + private: // lo_read/write exchancements bool lo_read_ex(PGconn *conn, int fd, const/*paf*/ char *buf, size_t len) { @@ -569,7 +565,7 @@ private: // conn client library funcs typedef char* (*t_PQgetvalue)(const PGresult *res, int tup_num, int field_num); t_PQgetvalue PQgetvalue; - typedef int (*t_PQntuples)(const PGresult *res); t_PQntuples PQntuples; + typedef int (*t_PQntuples)(const PGresult *res); t_PQntuples PQntuples; typedef char *(*t_PQfname)(const PGresult *res, int field_index); t_PQfname PQfname; typedef int (*t_PQnfields)(const PGresult *res); t_PQnfields PQnfields;