Skip to content

Commit

Permalink
version 0.1-3
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel authored and gaborcsardi committed Dec 13, 2008
1 parent de008a2 commit 26846d2
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 12 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Package: RPostgreSQL
Version: 0.1-2
Version: 0.1-3
Date: $Date: 2008-12-13 07:47:48 -0600 (Sat, 13 Dec 2008) $
Title: R interface to the PostgreSQL database system
Author: Sameer Kumar Prayaga <sameer.bits@gmail.com> with mentor Dirk Eddelbuettel <edd@debian.org>
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Expand All @@ -11,4 +12,4 @@ Depends: R (>= 2.7.0), methods, DBI (>= 0.1-4)
License: GPL-2
URL: http://www.stat.bell-labs.com/RS-DBI, http://www.postgresql.org
Collate: S4R.R zzz.R PostgreSQLSupport.R dbObjectId.R PostgreSQL.R
Packaged: Sun Nov 2 20:49:40 2008; edd
Packaged: Sat Dec 13 10:55:07 2008; edd
12 changes: 11 additions & 1 deletion inst/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
2008-12-12 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION: CRAN release 0.1-3

* src/RS-DBI.c: Fixed to small memory leaks, with thanks to
Jeff Horner for a small patch to which we added a similar
fix

* tests/*: Corrected a small typo in env.var

2008-11-02 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION: CRAN release 0.1-2

* tests/*: Even more small fixes
* tests/*: Even more small fixes

* configure.win: Test for $PG_HOME

Expand Down
9 changes: 6 additions & 3 deletions man/PostgreSQL.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ to multiple host servers and run multiple connections on each server
simultaneously.
}
\section{User authentication}{
The passed string can be empty to use all default parameters, or it can contain one or more parameter settings separated by comma. Each parameter setting is in the form parameter = "value". Spaces around the equal sign are optional.
The passed string can be empty to use all default parameters, or it can
contain one or more parameter settings separated by comma. Each
parameter setting is in the form parameter = "value". Spaces around the
equal sign are optional.

The most important parameters are \code{user}, \code{password}, \code{host}, \code{dbname}, \code{port}, \code{tty} and \code{options}
}
The most important parameters are \code{user}, \code{password},
\code{host}, \code{dbname}, \code{port}, \code{tty} and \code{options}.
}
\author{David A. James}
\section{References}{
Expand Down
15 changes: 13 additions & 2 deletions src/RS-DBI.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* RS-DBI.c
*
* Last Modified: $Date: 2008-10-08 20:31:37 -0500 (Wed, 08 Oct 2008) $
* Last Modified: $Date: 2008-12-12 20:09:19 -0600 (Fri, 12 Dec 2008) $
*
* This package was developed as a part of Summer of Code program organized by Google.
* Thanks to David A. James & Saikat DebRoy, the authors of RMySQL package.
Expand Down Expand Up @@ -67,11 +67,13 @@ RS_DBI_allocManager(const char *drvName, Sint max_con,
mgr->connections = (RS_DBI_connection **)
calloc((size_t) max_con, sizeof(RS_DBI_connection));
if(!mgr->connections){
free(mgr->drvName);
free(mgr);
RS_DBI_errorMessage("could not calloc RS_DBI_connections", RS_DBI_ERROR);
}
mgr->connectionIds = (Sint *) calloc((size_t)max_con, sizeof(Sint));
if(!mgr->connectionIds){
free(mgr->drvName);
free(mgr->connections);
free(mgr);
RS_DBI_errorMessage("could not calloc vector of connection Ids",
Expand Down Expand Up @@ -115,6 +117,10 @@ RS_DBI_freeManager(Mgr_Handle *mgrHandle)
mgr->drvName = (char *) NULL;
}
if(mgr->connections) {
for (int i=0; i < mgr->num_con; i++) {
if (mgr->connections[i])
free(mgr->connections[i]);
}
free(mgr->connections);
mgr->connections = (RS_DBI_connection **) NULL;
}
Expand Down Expand Up @@ -360,7 +366,12 @@ RS_DBI_allocFields(int num_fields)
void
RS_DBI_freeFields(RS_DBI_fields *flds)
{
if(flds->name) free(flds->name);
int i;
if (flds->name) { /* (as per Jeff Horner's patch) */
for (i = 0; i < flds->num_fields; i++)
if (flds->name[i]) free(flds->name[i]);
free(flds->name);
}
if(flds->type) free(flds->type);
if(flds->length) free(flds->length);
if(flds->precision) free(flds->precision);
Expand Down
2 changes: 1 addition & 1 deletion tests/dataTypeTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if ((Sys.getenv("POSTGRES_USER") != "") &
user=Sys.getenv("POSTGRES_USER"),
password=Sys.getenv("POSTGRES_PASSWD"),
host=Sys.getenv("POSTGRES_HOST"),
dbname=Sys.getenv("POSTGRES_DATABSE"))
dbname=Sys.getenv("POSTGRES_DATABASE"))

if (dbExistsTable(con, "tempostgrestable"))
dbRemoveTable(con, "tempostgrestable")
Expand Down
2 changes: 1 addition & 1 deletion tests/dataTypeTests.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Type 'q()' to quit R.
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABSE"))
+ dbname=Sys.getenv("POSTGRES_DATABASE"))
+
+ if (dbExistsTable(con, "tempostgrestable"))
+ dbRemoveTable(con, "tempostgrestable")
Expand Down
2 changes: 1 addition & 1 deletion tests/datetimeTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if ((Sys.getenv("POSTGRES_USER") != "") &
user=Sys.getenv("POSTGRES_USER"),
password=Sys.getenv("POSTGRES_PASSWD"),
host=Sys.getenv("POSTGRES_HOST"),
dbname=Sys.getenv("POSTGRES_DATABSE"))
dbname=Sys.getenv("POSTGRES_DATABASE"))

dbTypeTests(con, "timestamp")
dbTypeTests(con, "timestamp with time zone")
Expand Down
2 changes: 1 addition & 1 deletion tests/datetimeTests.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Type 'q()' to quit R.
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABSE"))
+ dbname=Sys.getenv("POSTGRES_DATABASE"))
+
+ dbTypeTests(con, "timestamp")
+ dbTypeTests(con, "timestamp with time zone")
Expand Down

0 comments on commit 26846d2

Please sign in to comment.