kylemaxxwell / rpostgresql

Automatically exported from code.google.com/p/rpostgresql
0 stars 0 forks source link

dbConnect() shuts down R when used with null or incorrect parameters #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

 Using dbConnect() with null or incorrect parameters forces R to shutdown
unexpectedly without issuing any error message. Example:

library(RPostgreSQL)
db.driver<-dbDriver("PostgreSQL")
db.con<-dbConnect(db.driver,user=NULL,password=NULL,dbname=NULL)

 I'm using R 2.8.1 on a WinXP 32-bit machine.

Original issue reported on code.google.com by joao...@gmail.com on 4 Apr 2009 at 11:06

GoogleCodeExporter commented 9 years ago

Original comment by ne...@neiltiffin.com on 30 Sep 2009 at 5:14

GoogleCodeExporter commented 9 years ago
I am now catching these NULLs at the R level before we call Pg thus avoiding 
any 
segfaults.   It is somewhat of a border case -- what exactly did you expect for 
NULL 
values to happen?  Still, segfaults are almost always wrong.

Original comment by dirk.eddelbuettel on 3 Oct 2009 at 10:27

GoogleCodeExporter commented 9 years ago
I agree this is a borderline situation nevertheless the result shouldn't be a
complete R shutdown with no message being issued (except those from windows 
which are
useless - sorry for the redundancy).
This incorrect/defective connection parametrization should be caught earlier 
and an
error/warning message should be raised, alerting the user to bad parameter set 
or any
other kind of informative feedback. 

Original comment by joao...@gmail.com on 5 Oct 2009 at 5:31

GoogleCodeExporter commented 9 years ago
This is fixed in SVn and will make to 0.1-5 which should be out in a few days.  

Original comment by dirk.eddelbuettel on 10 Oct 2009 at 4:45