--- sql/pgsql/parser3pgsql.C 2011/03/11 07:57:42 1.36 +++ sql/pgsql/parser3pgsql.C 2012/06/08 14:42:37 1.40 @@ -1,13 +1,12 @@ /** @file Parser PgSQL driver. - Copyright(c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) 2007.10.25 using PgSQL 8.1.5 */ -static const char *RCSId="$Id: parser3pgsql.C,v 1.36 2011/03/11 07:57:42 misha Exp $"; #include "config_includes.h" @@ -16,6 +15,8 @@ static const char *RCSId="$Id: parser3pg #include #include +volatile const char * IDENT_PARSER3PGSQL_C="$Id: parser3pgsql.C,v 1.40 2012/06/08 14:42:37 moko Exp $" IDENT_PA_SQL_DRIVER_H; + // from catalog/pg_type.h #define BOOLOID 16 #define INT8OID 20 @@ -200,14 +201,14 @@ public: } if(charset){ - char statement[MAX_STRING]="SET CLIENT_ENCODING="; + char statement[MAX_STRING+1]="SET CLIENT_ENCODING="; strncat(statement, charset, MAX_STRING); _execute_cmd(connection, statement); } if(datestyle){ - char statement[MAX_STRING]="SET DATESTYLE="; + char statement[MAX_STRING+1]="SET DATESTYLE="; strncat(statement, datestyle, MAX_STRING); _execute_cmd(connection, statement); @@ -545,9 +546,9 @@ private: char *cur=result; memcpy(cur, astatement, statement_size); cur+=statement_size; if(limit!=SQL_NO_LIMIT) - cur+=snprintf(cur, 7+MAX_NUMBER, " limit %u", limit); + cur+=snprintf(cur, 7+MAX_NUMBER, " limit %lu", limit); if(offset) - cur+=snprintf(cur, 8+MAX_NUMBER, " offset %u", offset); + cur+=snprintf(cur, 8+MAX_NUMBER, " offset %lu", offset); o=result; } else o=astatement;