Diff for /sql/pgsql/parser3pgsql.C between versions 1.12.6.1 and 1.13

version 1.12.6.1, 2003/03/26 14:09:06 version 1.13, 2003/07/24 10:09:40
Line 239  public: Line 239  public:
                 for(int i=0; i<column_count; i++){                  for(int i=0; i<column_count; i++){
                         char *name=PQfname(res, i);                          char *name=PQfname(res, i);
                         size_t size=strlen(name);                          size_t size=strlen(name);
                         void *ptr=services.malloc(size);                          char* str=(char*)services.malloc(size+1);
                         memcpy(ptr, name, size);                          memcpy(str, name, size+1);
                         CHECK(handlers.add_column(sql_error, ptr, size));                          CHECK(handlers.add_column(sql_error, str, size));
                 }                  }
   
                 CHECK(handlers.before_rows(sql_error));                  CHECK(handlers.before_rows(sql_error));
Line 252  public: Line 252  public:
                                 for(int i=0; i<column_count; i++){                                  for(int i=0; i<column_count; i++){
                                         const char *cell=PQgetvalue(res, r, i);                                          const char *cell=PQgetvalue(res, r, i);
                                         size_t size;                                          size_t size;
                                         void *ptr;                                          char* str;
                                         if(PQftype(res, i)==OIDOID) {                                          if(PQftype(res, i)==OIDOID) {
                                                 // ObjectID column, read object bytes                                                  // ObjectID column, read object bytes
   
Line 273  public: Line 273  public:
                                                         size=(size_t)size_tell;                                                          size=(size_t)size_tell;
                                                         if(size) {                                                          if(size) {
                                                                 // read                                                                   // read 
                                                                 ptr=services.malloc(size);                                                                  str=(char*)services.malloc(size+1);
                                                                 if(!lo_read_ex(conn, fd, (const char *)ptr, size_tell))                                                                  if(!lo_read_ex(conn, fd, str, size_tell))
                                                                         PQclear_throw("lo_read can not read all bytes of object");                                                                          PQclear_throw("lo_read can not read all bytes of object");
                                                                   str[size]=0;
                                                         } else                                                          } else
                                                                 ptr=0;                                                                  str=0;
                                                         if(lo_close(conn, fd)<0)                                                          if(lo_close(conn, fd)<0)
                                                                 PQclear_throwPQerror;                                                                  PQclear_throwPQerror;
                                                 } else                                                  } else
Line 286  public: Line 287  public:
                                                 // normal column, read it normally                                                  // normal column, read it normally
                                                 size=(size_t)PQgetlength(res, r, i);                                                  size=(size_t)PQgetlength(res, r, i);
                                                 if(size) {                                                  if(size) {
                                                         ptr=services.malloc(size);                                                          str=(char*)services.malloc(size+1);
                                                         memcpy(ptr, cell, size);                                                          memcpy(str, cell, size+1);
                                                 } else                                                  } else
                                                         ptr=0;                                                          str=0;
                                         }                                          }
                                         CHECK(handlers.add_row_cell(sql_error, ptr, size));                                          CHECK(handlers.add_row_cell(sql_error, str, size));
                                 }                                  }
                         }                          }
 cleanup:  cleanup:

Removed from v.1.12.6.1  
changed lines
  Added in v.1.13


E-mail: