|
|
| version 1.37, 2012/03/16 10:05:04 | version 1.41, 2012/06/15 09:09:33 |
|---|---|
| Line 15 | Line 15 |
| #include <libpq-fe.h> | #include <libpq-fe.h> |
| #include <libpq/libpq-fs.h> | #include <libpq/libpq-fs.h> |
| volatile const char * IDENT_PARSER3PGSQL_C=="$Id$" IDENT_PA_SQL_DRIVER_H; | volatile const char * IDENT_PARSER3PGSQL_C="$Id$" IDENT_PA_SQL_DRIVER_H; |
| // from catalog/pg_type.h | // from catalog/pg_type.h |
| #define BOOLOID 16 | #define BOOLOID 16 |
| Line 201 public: | Line 201 public: |
| } | } |
| if(charset){ | if(charset){ |
| char statement[MAX_STRING]="SET CLIENT_ENCODING="; | char statement[MAX_STRING+1]="SET CLIENT_ENCODING="; |
| strncat(statement, charset, MAX_STRING); | strncat(statement, charset, MAX_STRING); |
| _execute_cmd(connection, statement); | _execute_cmd(connection, statement); |
| } | } |
| if(datestyle){ | if(datestyle){ |
| char statement[MAX_STRING]="SET DATESTYLE="; | char statement[MAX_STRING+1]="SET DATESTYLE="; |
| strncat(statement, datestyle, MAX_STRING); | strncat(statement, datestyle, MAX_STRING); |
| _execute_cmd(connection, statement); | _execute_cmd(connection, statement); |
| Line 546 private: | Line 546 private: |
| char *cur=result; | char *cur=result; |
| memcpy(cur, astatement, statement_size); cur+=statement_size; | memcpy(cur, astatement, statement_size); cur+=statement_size; |
| if(limit!=SQL_NO_LIMIT) | 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) | if(offset) |
| cur+=snprintf(cur, 8+MAX_NUMBER, " offset %u", offset); | cur+=snprintf(cur, 8+MAX_NUMBER, " offset %lu", offset); |
| o=result; | o=result; |
| } else | } else |
| o=astatement; | o=astatement; |
| Line 689 private: // conn client library funcs | Line 689 private: // conn client library funcs |
| private: // conn client library funcs linking | private: // conn client library funcs linking |
| const char *dlink(const char *dlopen_file_spec) { | const char *dlink(const char *dlopen_file_spec) { |
| if(lt_dlinit()) | if(lt_dlinit()){ |
| return lt_dlerror(); | if(const char* result=lt_dlerror()) |
| return result; | |
| return "can not prepare to dynamic loading"; | |
| } | |
| lt_dlhandle handle=lt_dlopen(dlopen_file_spec); | lt_dlhandle handle=lt_dlopen(dlopen_file_spec); |
| if(!handle) | |
| if(!handle){ | |
| if(const char* result=lt_dlerror()) | |
| return result; | |
| return "can not open the dynamic link module"; | return "can not open the dynamic link module"; |
| } | |
| #define DSLINK(name, action) \ | #define DSLINK(name, action) \ |
| name=(t_##name)lt_dlsym(handle, #name); \ | name=(t_##name)lt_dlsym(handle, #name); \ |