--- sql/mysql/parser3mysql.C 2011/09/24 03:35:08 1.39 +++ sql/mysql/parser3mysql.C 2012/06/06 14:45:14 1.41 @@ -1,7 +1,7 @@ /** @file Parser MySQL driver. - Copyright(c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) @@ -10,12 +10,13 @@ 2001-11-06 numrows on "HP-UX istok1 B.11.00 A 9000/869 448594332 two-user license" 3.23.42 & 4.0.0.alfa never worked, both subst & .sl version returned 0 */ -static const char *RCSId="$Id: parser3mysql.C,v 1.39 2011/09/24 03:35:08 misha Exp $"; #include "config_includes.h" #include "pa_sql_driver.h" +volatile const char * IDENT_PARSER3MYSQL_C="$Id: parser3mysql.C,v 1.41 2012/06/06 14:45:14 moko Exp $" IDENT_PA_SQL_DRIVER_H; + #define NO_CLIENT_LONG_LONG #include "mysql.h" #include "ltdl.h" @@ -265,7 +266,7 @@ public: } if(charset){ - char statement[MAX_STRING]="SET CHARACTER SET "; + char statement[MAX_STRING+1]="SET CHARACTER SET "; strncat(statement, charset, MAX_STRING); _exec(connection, statement); } @@ -393,9 +394,9 @@ public: memcpy(cur, astatement, statement_size); cur+=statement_size; cur+=sprintf(cur, " LIMIT "); if(offset) - cur+=snprintf(cur, MAX_NUMBER+1, "%u,", offset); + cur+=snprintf(cur, MAX_NUMBER+1, "%lu,", offset); if(limit!=SQL_NO_LIMIT) - cur+=snprintf(cur, MAX_NUMBER, "%u", limit); + cur+=snprintf(cur, MAX_NUMBER, "%lu", limit); statement=statement_limited; } else statement=astatement;