Diff for /sql/pgsql/parser3pgsql.C between versions 1.2 and 1.7

version 1.2, 2001/10/29 08:57:58 version 1.7, 2002/03/22 15:50:25
Line 1 Line 1
 /** @file  /** @file
         Parser PgSQL driver.          Parser PgSQL driver.
   
         Copyright(c) 2001 ArtLebedev Group(http://www.artlebedev.com)          Copyright(c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com)
   
         Author: Alexander Petrosyan <paf@design.ru>(http://design.ru/paf)          Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
   
         2001.07.30 using PgSQL 7.1.2          2001.07.30 using PgSQL 7.1.2
 */  */
Line 63  public: Line 63  public:
         /// get api version          /// get api version
         int api_version() { return SQL_DRIVER_API_VERSION; }          int api_version() { return SQL_DRIVER_API_VERSION; }
         /// initialize driver by loading sql dynamic link library          /// initialize driver by loading sql dynamic link library
         const char *initialize(const char *dlopen_file_spec) {          const char *initialize(char *dlopen_file_spec) {
                 return dlopen_file_spec?                  return dlopen_file_spec?
                         dlink(dlopen_file_spec):"client library column is empty";                          dlink(dlopen_file_spec):"client library column is empty";
         }          }
Line 86  public: Line 86  public:
                 char *port=lsplit(host, ':');                  char *port=lsplit(host, ':');
   
                 PGconn *conn=PQsetdbLogin(                  PGconn *conn=PQsetdbLogin(
                         strcasecmp(host, "local")==0?NULL/* local Unix domain socket */:host, port,                           (host&&strcasecmp(host, "local")==0)?NULL/* local Unix domain socket */:host, port, 
                         NULL, NULL, db, user, pwd);                          NULL, NULL, db, user, pwd);
                 if(!conn)                  if(!conn)
                         services._throw("PQsetdbLogin failed");                          services._throw("PQsetdbLogin failed");
Line 123  public: Line 123  public:
         unsigned int quote(          unsigned int quote(
                 SQL_Driver_services&, void *connection,                  SQL_Driver_services&, void *connection,
                 char *to, const char *from, unsigned int length) {                  char *to, const char *from, unsigned int length) {
                 /*                  if(to) { // store mode
                         it's already UNTAINT_TIMES_BIGGER                          unsigned int result=length;
                 */                          while(length--) {
                 unsigned int result=length;                                  switch(*from) {
                 while(length--) {                                  case '\'': // "'" -> "''"
                         switch(*from) {                                          *to++='\''; result++;
                         case '\'': // "'" -> "''"                                          break;
                                 *to++='\'';                                  case '\\': // "\" -> "\\"
                                 break;                                          *to++='\''; result++;
                         case '\\': // "\" -> "\\"                                          break;
                                 *to++='\'';                                  }
                                 break;                                  *to++=*from++;
                         }                          }
                         *to++=*from++;                          return result;
                 }                  } else // estimate mode
                 return result;                          return length*2;
         }          }
         void query(          void query(
                 SQL_Driver_services& services, void *connection,                   SQL_Driver_services& services, void *connection, 

Removed from v.1.2  
changed lines
  Added in v.1.7


E-mail: