Revision: 270
Author:
tomo...@kenroku.kanazawa-u.ac.jp
Date: Sun Feb 9 12:31:30 2014 UTC
Log: separating run-time variation making tests to exttests
http://code.google.com/p/rpostgresql/source/detail?r=270
Added:
/trunk/exttests
/trunk/exttests/bytea.R
/trunk/exttests/bytea.Rout.save
/trunk/exttests/connectWithNull.R
/trunk/exttests/connectWithNull.Rout.save
/trunk/exttests/dbColumnInfo.R
/trunk/exttests/unknowntype.R
Deleted:
/trunk/RPostgreSQL/tests/connectWithNull.R
/trunk/RPostgreSQL/tests/connectWithNull.Rout.save
Modified:
/trunk/RPostgreSQL/tests/bytea.R
/trunk/RPostgreSQL/tests/bytea.Rout.save
/trunk/RPostgreSQL/tests/createTableMixedCaseTest.Rout.save
/trunk/RPostgreSQL/tests/dataTypeTests.Rout.save
/trunk/RPostgreSQL/tests/dateTZ.Rout.save
/trunk/RPostgreSQL/tests/datetimeTests.R
/trunk/RPostgreSQL/tests/datetimeTests.Rout.save
/trunk/RPostgreSQL/tests/datetimestampwrite.Rout.save
/trunk/RPostgreSQL/tests/dbColumnInfo.R
/trunk/RPostgreSQL/tests/dbColumnInfo.Rout.save
/trunk/RPostgreSQL/tests/dbExistsIssue.Rout.save
/trunk/RPostgreSQL/tests/dbExistsq.Rout.save
/trunk/RPostgreSQL/tests/dbExistsqc.Rout.save
/trunk/RPostgreSQL/tests/dbGetQueryParams.Rout.save
/trunk/RPostgreSQL/tests/dbListFields.Rout.save
/trunk/RPostgreSQL/tests/dbTransactionTests.Rout.save
/trunk/RPostgreSQL/tests/dbWriteTableFailTest.Rout.save
/trunk/RPostgreSQL/tests/dbWriteTableSchema.Rout.save
/trunk/RPostgreSQL/tests/dbWriteTableTest.Rout.save
/trunk/RPostgreSQL/tests/dbWriteTabletypes.Rout.save
/trunk/RPostgreSQL/tests/dbtemptable.Rout.save
/trunk/RPostgreSQL/tests/escape.R
/trunk/RPostgreSQL/tests/escape.Rout.save
/trunk/RPostgreSQL/tests/loadDriverAndConnect.Rout.save
/trunk/RPostgreSQL/tests/openSendQuery.Rout.save
/trunk/RPostgreSQL/tests/selectWhereZero.Rout.save
/trunk/RPostgreSQL/tests/selectWithAlias.Rout.save
/trunk/RPostgreSQL/tests/unknowntype.R
/trunk/RPostgreSQL/tests/unknowntype.Rout.save
/trunk/check_with_vars.sh
=======================================
--- /dev/null
+++ /trunk/exttests/bytea.R Sun Feb 9 12:31:30 2014 UTC
@@ -0,0 +1,66 @@
+## Test of bytea conversion with insert and retrieve to the db.
+##
+
+if ((Sys.getenv("POSTGRES_USER") != "") &
+ (Sys.getenv("POSTGRES_HOST") != "") &
+ (Sys.getenv("POSTGRES_DATABASE") != "")) {
+
+ ## try to load our module and abort if this fails
+ stopifnot(require(RPostgreSQL))
+
+ ## load the PostgresSQL driver
+ drv <- dbDriver("PostgreSQL")
+
+ ## connect to the default db
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+
+ if (dbExistsTable(con, "byteatable"))
+ dbRemoveTable(con, "byteatable")
+
+ sample.object <- list("one", "two");
+ ser <- serialize(sample.object, NULL, ascii=F);
+
+ ## Test the store/recovery of binary data
+ dbGetQuery(con, "CREATE TABLE byteatable (name text, val bytea)")
+ dbGetQuery(con, "set standard_conforming_strings to 'on'")
+ cat("Note the encoded string could differ depending on the server.\n")
+ cat("Show encoded string when standard_conforming_strings is on.\n")
+ print(postgresqlEscapeBytea(con, ser))
+ iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name1",
postgresqlEscapeBytea(con, ser))
+ dbGetQuery(con, iq)
+ rows<-dbGetQuery(con, "SELECT * from byteatable")
+ ser2<-postgresqlUnescapeBytea(rows[[2]])
+ if (identical(ser, ser2)) {
+ cat("PASS: Identical data was recovered\n")
+ }else{
+ cat("FAIL: The recovered data is not identical\n")
+ ser
+ ser2
+ }
+ dbGetQuery(con, "set standard_conforming_strings to 'off'")
+ dbGetQuery(con, "set escape_string_warning to 'off'")
+ cat("Show encoded string when standard_conforming_strings is off.\n")
+ print(postgresqlEscapeBytea(con, ser))
+ iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name2",
postgresqlEscapeBytea(con, ser))
+ dbGetQuery(con, iq)
+ rows<-dbGetQuery(con, "SELECT * from byteatable where name = 'name2'")
+ ser3<-postgresqlUnescapeBytea(rows[[2]])
+ if (identical(ser, ser3)) {
+ cat("PASS: Identical data was recovered\n")
+ }else{
+ cat("FAIL: The recovered data is not identical\n")
+ ser
+ ser2
+ }
+ dbRemoveTable(con, "byteatable")
+ dbDisconnect(con)
+ dbUnloadDriver(drv)
+ cat("DONE\n")
+}else{
+ cat("Skip because envirinmental variables are not set to tell the
connection params.\n")
+}
=======================================
--- /dev/null
+++ /trunk/exttests/bytea.Rout.save Sun Feb 9 12:31:30 2014 UTC
@@ -0,0 +1,97 @@
+
+R version 3.0.0 (2013-04-03) -- "Masked Marvel"
+Copyright (C) 2013 The R Foundation for Statistical Computing
+Platform: x86_64-unknown-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> ## Test of bytea conversion with insert and retrieve to the db.
+> ##
+>
+> if ((Sys.getenv("POSTGRES_USER") != "") &
++ (Sys.getenv("POSTGRES_HOST") != "") &
++ (Sys.getenv("POSTGRES_DATABASE") != "")) {
++
++ ## try to load our module and abort if this fails
++ stopifnot(require(RPostgreSQL))
++
++ ## load the PostgresSQL driver
++ drv <- dbDriver("PostgreSQL")
++
++ ## connect to the default db
++ con <- dbConnect(drv,
++ user=Sys.getenv("POSTGRES_USER"),
++ password=Sys.getenv("POSTGRES_PASSWD"),
++ host=Sys.getenv("POSTGRES_HOST"),
++ dbname=Sys.getenv("POSTGRES_DATABASE"),
++ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
++
++ if (dbExistsTable(con, "byteatable"))
++ dbRemoveTable(con, "byteatable")
++
++ sample.object <- list("one", "two");
++ ser <- serialize(sample.object, NULL, ascii=F);
++
++ ## Test the store/recovery of binary data
++ dbGetQuery(con, "CREATE TABLE byteatable (name text, val bytea)")
++ dbGetQuery(con, "set standard_conforming_strings to 'on'")
++ cat("Note the encoded string could differ depending on the
server.\n")
++ cat("Show encoded string when standard_conforming_strings is on.\n")
++ print(postgresqlEscapeBytea(con, ser))
++ iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name1",
postgresqlEscapeBytea(con, ser))
++ dbGetQuery(con, iq)
++ rows<-dbGetQuery(con, "SELECT * from byteatable")
++ ser2<-postgresqlUnescapeBytea(rows[[2]])
++ if (identical(ser, ser2)) {
++ cat("PASS: Identical data was recovered\n")
++ }else{
++ cat("FAIL: The recovered data is not identical\n")
++ ser
++ ser2
++ }
++ dbGetQuery(con, "set standard_conforming_strings to 'off'")
++ dbGetQuery(con, "set escape_string_warning to 'off'")
++ cat("Show encoded string when standard_conforming_strings is off.\n")
++ print(postgresqlEscapeBytea(con, ser))
++ iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name2",
postgresqlEscapeBytea(con, ser))
++ dbGetQuery(con, iq)
++ rows<-dbGetQuery(con, "SELECT * from byteatable where name
= 'name2'")
++ ser3<-postgresqlUnescapeBytea(rows[[2]])
++ if (identical(ser, ser3)) {
++ cat("PASS: Identical data was recovered\n")
++ }else{
++ cat("FAIL: The recovered data is not identical\n")
++ ser
++ ser2
++ }
++ dbRemoveTable(con, "byteatable")
++ dbDisconnect(con)
++ dbUnloadDriver(drv)
++ cat("DONE\n")
++ }else{
++ cat("Skip because envirinmental variables are not set to tell the
connection params.\n")
++ }
+Loading required package: RPostgreSQL
+Loading required package: DBI
+Note the encoded string could differ depending on the server.
+Show encoded string when standard_conforming_strings is on.
+[1] "X\\012\\000\\000\\000\\002\\000\\003\\000\\000\\000\\002\\003\\000\\000\\000\\000\\023\\000\\000\\000\\002\\000\\000\\000\\020\\000\\000\\000\\001\\000\\004\\000\\011\\000\\000\\000\\003one\\000\\000\\000\\020\\000\\000\\000\\001\\000\\004\\000\\011\\000\\000\\000\\003two"
+PASS: Identical data was recovered
+Show encoded string when standard_conforming_strings is off.
+[1] "X\\\\012\\\\000\\\\000\\\\000\\\\002\\\\000\\\\003\\\\000\\\\000\\\\000\\\\002\\\\003\\\\000\\\\000\\\\000\\\\000\\\\023\\\\000\\\\000\\\\000\\\\002\\\\000\\\\000\\\\000\\\\020\\\\000\\\\000\\\\000\\\\001\\\\000\\\\004\\\\000\\\\011\\\\000\\\\000\\\\000\\\\003one\\\\000\\\\000\\\\000\\\\020\\\\000\\\\000\\\\000\\\\001\\\\000\\\\004\\\\000\\\\011\\\\000\\\\000\\\\000\\\\003two"
+PASS: Identical data was recovered
+DONE
+>
+> proc.time()
+ user system elapsed
+ 0.420 0.041 0.522
=======================================
--- /dev/null
+++ /trunk/exttests/connectWithNull.R Sun Feb 9 12:31:30 2014 UTC
@@ -0,0 +1,100 @@
+## connectWithNull test
+##
+## test for the 'Issue 2' on the Google Code issue log
+## reported in April 2009, still open ?
+##
+## Assumes that
+## a) PostgreSQL is running, and
+## b) the current user can connect
+## both of which are not viable for release but suitable while we test
+##
+## Dirk Eddelbuettel, 03 Oct 2009
+
+## only run this if this env.var is set correctly
+if (Sys.getenv("POSTGRES_USER") != "" & Sys.getenv("POSTGRES_HOST") != ""
& Sys.getenv("POSTGRES_DATABASE") != "") {
+
+ ## try to load our module and abort if this fails
+ stopifnot(require(RPostgreSQL))
+ stopifnot(require(datasets))
+
+ ## load the PostgresSQL driver
+ drv <- dbDriver("PostgreSQL")
+
+ ## connect to the default db -- replacing any of these with NULL
+ ## should be treated as the default value.
+ ## Thus, success or failure depends on the environment.
+ ## Importantly, Segmentation fault should not happen.
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+
+ ## do we get here?
+ cat("Normal connection\n")
+ cat("Note connection handle will change every time\n")
+ print(con)
+ ## and disconnect
+ dbDisconnect(con)
+
+ cat("connection with user=NULL\n")
+ try({
+ con <- dbConnect(drv,
+ user=NULL,
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+ print(con)
+ dbDisconnect(con)
+ })
+ try({
+ cat("connection with password=NULL\n")
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=NULL,
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+ print(con)
+ dbDisconnect(con)
+ })
+ try({
+ cat("connection with host=NULL\n")
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=NULL,
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+ print(con)
+ dbDisconnect(con)
+ })
+ try({
+ cat("connection with dbname=NULL\n")
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=NULL,
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+ print(con)
+ dbDisconnect(con)
+ })
+ try({
+ cat("connection with port=NULL\n")
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=NULL)
+ print(con)
+ ## and disconnect
+ dbDisconnect(con)
+ })
+ cat("PASS: reached to the end of the test code without segmentation
fault\n")
+}else{
+ cat("Skip.\n")
+}
=======================================
--- /dev/null
+++ /trunk/exttests/connectWithNull.Rout.save Sun Feb 9 12:31:30 2014 UTC
@@ -0,0 +1,139 @@
+
+R version 3.0.0 (2013-04-03) -- "Masked Marvel"
+Copyright (C) 2013 The R Foundation for Statistical Computing
+Platform: x86_64-unknown-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> ## connectWithNull test
+> ##
+> ## test for the 'Issue 2' on the Google Code issue log
+> ## reported in April 2009, still open ?
+> ##
+> ## Assumes that
+> ## a) PostgreSQL is running, and
+> ## b) the current user can connect
+> ## both of which are not viable for release but suitable while we test
+> ##
+> ## Dirk Eddelbuettel, 03 Oct 2009
+>
+> ## only run this if this env.var is set correctly
+> if (Sys.getenv("POSTGRES_USER") != "" &
Sys.getenv("POSTGRES_HOST") != "" & Sys.getenv("POSTGRES_DATABASE") != "") {
++
++ ## try to load our module and abort if this fails
++ stopifnot(require(RPostgreSQL))
++ stopifnot(require(datasets))
++
++ ## load the PostgresSQL driver
++ drv <- dbDriver("PostgreSQL")
++
++ ## connect to the default db -- replacing any of these with NULL
++ ## should be treated as the default value.
++ ## Thus, success or failure depends on the environment.
++ ## Importantly, Segmentation fault should not happen.
++ con <- dbConnect(drv,
++ user=Sys.getenv("POSTGRES_USER"),
++ password=Sys.getenv("POSTGRES_PASSWD"),
++ host=Sys.getenv("POSTGRES_HOST"),
++ dbname=Sys.getenv("POSTGRES_DATABASE"),
++ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
++
++ ## do we get here?
++ cat("Normal connection\n")
++ cat("Note connection handle will change every time\n")
++ print(con)
++ ## and disconnect
++ dbDisconnect(con)
++
++ cat("connection with user=NULL\n")
++ try({
++ con <- dbConnect(drv,
++ user=NULL,
++ password=Sys.getenv("POSTGRES_PASSWD"),
++ host=Sys.getenv("POSTGRES_HOST"),
++ dbname=Sys.getenv("POSTGRES_DATABASE"),
++ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
++ print(con)
++ dbDisconnect(con)
++ })
++ try({
++ cat("connection with password=NULL\n")
++ con <- dbConnect(drv,
++ user=Sys.getenv("POSTGRES_USER"),
++ password=NULL,
++ host=Sys.getenv("POSTGRES_HOST"),
++ dbname=Sys.getenv("POSTGRES_DATABASE"),
++ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
++ print(con)
++ dbDisconnect(con)
++ })
++ try({
++ cat("connection with host=NULL\n")
++ con <- dbConnect(drv,
++ user=Sys.getenv("POSTGRES_USER"),
++ password=Sys.getenv("POSTGRES_PASSWD"),
++ host=NULL,
++ dbname=Sys.getenv("POSTGRES_DATABASE"),
++ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
++ print(con)
++ dbDisconnect(con)
++ })
++ try({
++ cat("connection with dbname=NULL\n")
++ con <- dbConnect(drv,
++ user=Sys.getenv("POSTGRES_USER"),
++ password=Sys.getenv("POSTGRES_PASSWD"),
++ host=Sys.getenv("POSTGRES_HOST"),
++ dbname=NULL,
++ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
++ print(con)
++ dbDisconnect(con)
++ })
++ try({
++ cat("connection with port=NULL\n")
++ con <- dbConnect(drv,
++ user=Sys.getenv("POSTGRES_USER"),
++ password=Sys.getenv("POSTGRES_PASSWD"),
++ host=Sys.getenv("POSTGRES_HOST"),
++ dbname=Sys.getenv("POSTGRES_DATABASE"),
++ port=NULL)
++ print(con)
++ ## and disconnect
++ dbDisconnect(con)
++ })
++ cat("PASS: reached to the end of the test code without segmentation
fault\n")
++ }else{
++ cat("Skip.\n")
++ }
+Loading required package: RPostgreSQL
+Loading required package: DBI
+Normal connection
+Note connection handle will change every time
+<PostgreSQLConnection:(15532,0)>
+connection with user=NULL
+<PostgreSQLConnection:(15532,1)>
+connection with password=NULL
+<PostgreSQLConnection:(15532,2)>
+connection with host=NULL
+<PostgreSQLConnection:(15532,3)>
+connection with dbname=NULL
+Error in postgresqlNewConnection(drv, ...) :
+ RS-DBI driver: (could not connect testuser@localhost on dbname "testuser"
+)
+connection with port=NULL
+<PostgreSQLConnection:(15532,4)>
+PASS: reached to the end of the test code without segmentation fault
+>
+> proc.time()
+ user system elapsed
+ 0.404 0.046 0.449
=======================================
--- /dev/null
+++ /trunk/exttests/dbColumnInfo.R Sun Feb 9 12:31:30 2014 UTC
@@ -0,0 +1,53 @@
+## dbColumnInfo test
+## This test confirms that dbColumnInfo() will not cause segfault under
gctorture()
+## Initial report was sporadic segfault (Issue 42)
+## and it was found reproducile under gctorture()
+##
+## Assumes that
+## a) PostgreSQL is running, and
+## b) the current user can connect
+## both of which are not viable for release but suitable while we test
+##
+## Dirk Eddelbuettel, 10 Sep 2009
+
+## only run this if this env.var is set correctly
+if (Sys.getenv("POSTGRES_USER") != "" & Sys.getenv("POSTGRES_HOST") != ""
& Sys.getenv("POSTGRES_DATABASE") != "") {
+
+ ## try to load our module and abort if this fails
+ stopifnot(require(RPostgreSQL))
+
+ ## load the PostgresSQL driver
+ drv <- dbDriver("PostgreSQL")
+
+ ## connect to the default db
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+
+
+ # create a table
+ res <- dbGetQuery(con, "CREATE TABLE aa (pk integer primary key, v1
float not null, v2 float)" )
+
+ ## run a simple query and show the query result
+ res <- dbGetQuery(con, "INSERT INTO aa VALUES(3, 2, NULL)" )
+ res <- dbSendQuery(con, "select pk, v1, v2, v1+v2 from aa")
+ cat("This would take a while due to gctorture()\n")
+ cat("dbColumnInfo\n")
+ gctorture()
+ print(dbColumnInfo(res))
+ print(dbColumnInfo(res))
+ cat("SELECT result\n")
+ df <- fetch(res, n=-1)
+ print(df)
+
+ ## cleanup
+ cat("Removing \"AA\"\n")
+ dbRemoveTable(con, "aa")
+ ## and disconnect
+ dbDisconnect(con)
+}else{
+ cat("Skip.\n")
+}
=======================================
--- /dev/null
+++ /trunk/exttests/unknowntype.R Sun Feb 9 12:31:30 2014 UTC
@@ -0,0 +1,59 @@
+## unknowntype test
+##
+## test for
+## Issue 5 comment #12
+## on the Google Code issue log
+##
+## Assumes that
+## a) PostgreSQL is running, and
+## b) the current user can connect
+## both of which are not viable for release but suitable while we test
+##
+## Dirk Eddelbuettel, 03 Oct 2009
+
+## only run this if this env.var is set correctly
+if (Sys.getenv("POSTGRES_USER") != "" & Sys.getenv("POSTGRES_HOST") != ""
& Sys.getenv("POSTGRES_DATABASE") != "") {
+
+ ## try to load our module and abort if this fails
+ stopifnot(require(RPostgreSQL))
+
+ ## load the PostgresSQL driver
+ drv <- dbDriver("PostgreSQL")
+
+ ## connect to the default db
+ con <- dbConnect(drv,
+ user=Sys.getenv("POSTGRES_USER"),
+ password=Sys.getenv("POSTGRES_PASSWD"),
+ host=Sys.getenv("POSTGRES_HOST"),
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+
+
+ if (dbExistsTable(con, "tmpirisdata")) {
+ print("Removing tmpirisdata\n")
+ dbRemoveTable(con, "tmpirisdata")
+ }
+
+
+ ## run a simple query and show the query result
+ res <- dbGetQuery(con, "create table tmpirisdata (ra REAL[])")
+ res <- dbSendQuery(con, "select ra from tmpirisdata")
+ cat("Note connection handle will change every time\n")
+ print(res)
+ type <- dbColumnInfo(res)
+ print(type)
+ data <- fetch(res, -1)
+ print(data)
+
+ ## cleanup
+ if (dbExistsTable(con, "tmpirisdata")) {
+ print("Removing tmpirisdata\n")
+ dbRemoveTable(con, "tmpirisdata")
+ }
+
+ ## and disconnect
+ dbDisconnect(con)
+ cat("PASS: reached to the end of the test code without segmentation
fault\n")
+}else{
+ cat("Skip.\n")
+}
=======================================
--- /trunk/RPostgreSQL/tests/connectWithNull.R Sat Feb 8 09:29:04 2014 UTC
+++ /dev/null
@@ -1,100 +0,0 @@
-## connectWithNull test
-##
-## test for the 'Issue 2' on the Google Code issue log
-## reported in April 2009, still open ?
-##
-## Assumes that
-## a) PostgreSQL is running, and
-## b) the current user can connect
-## both of which are not viable for release but suitable while we test
-##
-## Dirk Eddelbuettel, 03 Oct 2009
-
-## only run this if this env.var is set correctly
-if (Sys.getenv("POSTGRES_USER") != "" & Sys.getenv("POSTGRES_HOST") != ""
& Sys.getenv("POSTGRES_DATABASE") != "") {
-
- ## try to load our module and abort if this fails
- stopifnot(require(RPostgreSQL))
- stopifnot(require(datasets))
-
- ## load the PostgresSQL driver
- drv <- dbDriver("PostgreSQL")
-
- ## connect to the default db -- replacing any of these with NULL
- ## should be treated as the default value.
- ## Thus, success or failure depends on the environment.
- ## Importantly, Segmentation fault should not happen.
- con <- dbConnect(drv,
- user=Sys.getenv("POSTGRES_USER"),
- password=Sys.getenv("POSTGRES_PASSWD"),
- host=Sys.getenv("POSTGRES_HOST"),
- dbname=Sys.getenv("POSTGRES_DATABASE"),
- port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
-
- ## do we get here?
- cat("Normal connection\n")
- cat("Note connection handle will change every time\n")
- print(con)
- ## and disconnect
- dbDisconnect(con)
-
- cat("connection with user=NULL\n")
- try({
- con <- dbConnect(drv,
- user=NULL,
- password=Sys.getenv("POSTGRES_PASSWD"),
- host=Sys.getenv("POSTGRES_HOST"),
- dbname=Sys.getenv("POSTGRES_DATABASE"),
- port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
- print(con)
- dbDisconnect(con)
- })
- try({
- cat("connection with password=NULL\n")
- con <- dbConnect(drv,
- user=Sys.getenv("POSTGRES_USER"),
- password=NULL,
- host=Sys.getenv("POSTGRES_HOST"),
- dbname=Sys.getenv("POSTGRES_DATABASE"),
- port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
- print(con)
- dbDisconnect(con)
- })
- try({
- cat("connection with host=NULL\n")
- con <- dbConnect(drv,
- user=Sys.getenv("POSTGRES_USER"),
- password=Sys.getenv("POSTGRES_PASSWD"),
- host=NULL,
- dbname=Sys.getenv("POSTGRES_DATABASE"),
- port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
- print(con)
- dbDisconnect(con)
- })
- try({
- cat("connection with dbname=NULL\n")
- con <- dbConnect(drv,
- user=Sys.getenv("POSTGRES_USER"),
- password=Sys.getenv("POSTGRES_PASSWD"),
- host=Sys.getenv("POSTGRES_HOST"),
- dbname=NULL,
- port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
- print(con)
- dbDisconnect(con)
- })
- try({
- cat("connection with port=NULL\n")
- con <- dbConnect(drv,
- user=Sys.getenv("POSTGRES_USER"),
- password=Sys.getenv("POSTGRES_PASSWD"),
- host=Sys.getenv("POSTGRES_HOST"),
- dbname=Sys.getenv("POSTGRES_DATABASE"),
- port=NULL)
- print(con)
- ## and disconnect
- dbDisconnect(con)
- })
- cat("PASS: reached to the end of the test code without segmentation
fault\n")
-}else{
- cat("Skip.\n")
-}
=======================================
--- /trunk/RPostgreSQL/tests/connectWithNull.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /dev/null
@@ -1,139 +0,0 @@
-
-R version 3.0.0 (2013-04-03) -- "Masked Marvel"
-Copyright (C) 2013 The R Foundation for Statistical Computing
-Platform: x86_64-unknown-linux-gnu (64-bit)
-
-R is free software and comes with ABSOLUTELY NO WARRANTY.
-You are welcome to redistribute it under certain conditions.
-Type 'license()' or 'licence()' for distribution details.
-
-R is a collaborative project with many contributors.
-Type 'contributors()' for more information and
-'citation()' on how to cite R or R packages in publications.
-
-Type 'demo()' for some demos, 'help()' for on-line help, or
-'help.start()' for an HTML browser interface to help.
-Type 'q()' to quit R.
-
-> ## connectWithNull test
-> ##
-> ## test for the 'Issue 2' on the Google Code issue log
-> ## reported in April 2009, still open ?
-> ##
-> ## Assumes that
-> ## a) PostgreSQL is running, and
-> ## b) the current user can connect
-> ## both of which are not viable for release but suitable while we test
-> ##
-> ## Dirk Eddelbuettel, 03 Oct 2009
->
-> ## only run this if this env.var is set correctly
-> if (Sys.getenv("POSTGRES_USER") != "" &
Sys.getenv("POSTGRES_HOST") != "" & Sys.getenv("POSTGRES_DATABASE") != "") {
-+
-+ ## try to load our module and abort if this fails
-+ stopifnot(require(RPostgreSQL))
-+ stopifnot(require(datasets))
-+
-+ ## load the PostgresSQL driver
-+ drv <- dbDriver("PostgreSQL")
-+
-+ ## connect to the default db -- replacing any of these with NULL
-+ ## should be treated as the default value.
-+ ## Thus, success or failure depends on the environment.
-+ ## Importantly, Segmentation fault should not happen.
-+ con <- dbConnect(drv,
-+ user=Sys.getenv("POSTGRES_USER"),
-+ password=Sys.getenv("POSTGRES_PASSWD"),
-+ host=Sys.getenv("POSTGRES_HOST"),
-+ dbname=Sys.getenv("POSTGRES_DATABASE"),
-+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
-+
-+ ## do we get here?
-+ cat("Normal connection\n")
-+ cat("Note connection handle will change every time\n")
-+ print(con)
-+ ## and disconnect
-+ dbDisconnect(con)
-+
-+ cat("connection with user=NULL\n")
-+ try({
-+ con <- dbConnect(drv,
-+ user=NULL,
-+ password=Sys.getenv("POSTGRES_PASSWD"),
-+ host=Sys.getenv("POSTGRES_HOST"),
-+ dbname=Sys.getenv("POSTGRES_DATABASE"),
-+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
-+ print(con)
-+ dbDisconnect(con)
-+ })
-+ try({
-+ cat("connection with password=NULL\n")
-+ con <- dbConnect(drv,
-+ user=Sys.getenv("POSTGRES_USER"),
-+ password=NULL,
-+ host=Sys.getenv("POSTGRES_HOST"),
-+ dbname=Sys.getenv("POSTGRES_DATABASE"),
-+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
-+ print(con)
-+ dbDisconnect(con)
-+ })
-+ try({
-+ cat("connection with host=NULL\n")
-+ con <- dbConnect(drv,
-+ user=Sys.getenv("POSTGRES_USER"),
-+ password=Sys.getenv("POSTGRES_PASSWD"),
-+ host=NULL,
-+ dbname=Sys.getenv("POSTGRES_DATABASE"),
-+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
-+ print(con)
-+ dbDisconnect(con)
-+ })
-+ try({
-+ cat("connection with dbname=NULL\n")
-+ con <- dbConnect(drv,
-+ user=Sys.getenv("POSTGRES_USER"),
-+ password=Sys.getenv("POSTGRES_PASSWD"),
-+ host=Sys.getenv("POSTGRES_HOST"),
-+ dbname=NULL,
-+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
-+ print(con)
-+ dbDisconnect(con)
-+ })
-+ try({
-+ cat("connection with port=NULL\n")
-+ con <- dbConnect(drv,
-+ user=Sys.getenv("POSTGRES_USER"),
-+ password=Sys.getenv("POSTGRES_PASSWD"),
-+ host=Sys.getenv("POSTGRES_HOST"),
-+ dbname=Sys.getenv("POSTGRES_DATABASE"),
-+ port=NULL)
-+ print(con)
-+ ## and disconnect
-+ dbDisconnect(con)
-+ })
-+ cat("PASS: reached to the end of the test code without segmentation
fault\n")
-+ }else{
-+ cat("Skip.\n")
-+ }
-Loading required package: RPostgreSQL
-Loading required package: DBI
-Normal connection
-Note connection handle will change every time
-<PostgreSQLConnection:(24160,0)>
-connection with user=NULL
-<PostgreSQLConnection:(24160,1)>
-connection with password=NULL
-<PostgreSQLConnection:(24160,2)>
-connection with host=NULL
-<PostgreSQLConnection:(24160,3)>
-connection with dbname=NULL
-Error in postgresqlNewConnection(drv, ...) :
- RS-DBI driver: (could not connect testuser@localhost on dbname "testuser"
-)
-connection with port=NULL
-<PostgreSQLConnection:(24160,4)>
-PASS: reached to the end of the test code without segmentation fault
->
-> proc.time()
- user system elapsed
- 0.421 0.031 0.452
=======================================
--- /trunk/RPostgreSQL/tests/bytea.R Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/bytea.R Sun Feb 9 12:31:30 2014 UTC
@@ -30,7 +30,8 @@
dbGetQuery(con, "set standard_conforming_strings to 'on'")
cat("Note the encoded string could differ depending on the server.\n")
cat("Show encoded string when standard_conforming_strings is on.\n")
- print(postgresqlEscapeBytea(con, ser))
+# don't print the variable binary data in automatic test
+# print(postgresqlEscapeBytea(con, ser))
iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name1",
postgresqlEscapeBytea(con, ser))
dbGetQuery(con, iq)
rows<-dbGetQuery(con, "SELECT * from byteatable")
@@ -45,7 +46,8 @@
dbGetQuery(con, "set standard_conforming_strings to 'off'")
dbGetQuery(con, "set escape_string_warning to 'off'")
cat("Show encoded string when standard_conforming_strings is off.\n")
- print(postgresqlEscapeBytea(con, ser))
+# don't print the variable binary data in automatic test
+# print(postgresqlEscapeBytea(con, ser))
iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name2",
postgresqlEscapeBytea(con, ser))
dbGetQuery(con, iq)
rows<-dbGetQuery(con, "SELECT * from byteatable where name = 'name2'")
=======================================
--- /trunk/RPostgreSQL/tests/bytea.Rout.save Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/bytea.Rout.save Sun Feb 9 12:31:30 2014 UTC
@@ -47,7 +47,8 @@
+ dbGetQuery(con, "set standard_conforming_strings to 'on'")
+ cat("Note the encoded string could differ depending on the
server.\n")
+ cat("Show encoded string when standard_conforming_strings is on.\n")
-+ print(postgresqlEscapeBytea(con, ser))
++ # don't print the variable binary data in automatic test
++ # print(postgresqlEscapeBytea(con, ser))
+ iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name1",
postgresqlEscapeBytea(con, ser))
+ dbGetQuery(con, iq)
+ rows<-dbGetQuery(con, "SELECT * from byteatable")
@@ -62,7 +63,8 @@
+ dbGetQuery(con, "set standard_conforming_strings to 'off'")
+ dbGetQuery(con, "set escape_string_warning to 'off'")
+ cat("Show encoded string when standard_conforming_strings is off.\n")
-+ print(postgresqlEscapeBytea(con, ser))
++ # don't print the variable binary data in automatic test
++ # print(postgresqlEscapeBytea(con, ser))
+ iq <- sprintf("INSERT INTO byteatable values('%s', '%s');", "name2",
postgresqlEscapeBytea(con, ser))
+ dbGetQuery(con, iq)
+ rows<-dbGetQuery(con, "SELECT * from byteatable where name
= 'name2'")
@@ -85,13 +87,11 @@
Loading required package: DBI
Note the encoded string could differ depending on the server.
Show encoded string when standard_conforming_strings is on.
-[1] "X\\012\\000\\000\\000\\002\\000\\003\\000\\000\\000\\002\\003\\000\\000\\000\\000\\023\\000\\000\\000\\002\\000\\000\\000\\020\\000\\000\\000\\001\\000\\004\\000\\011\\000\\000\\000\\003one\\000\\000\\000\\020\\000\\000\\000\\001\\000\\004\\000\\011\\000\\000\\000\\003two"
PASS: Identical data was recovered
Show encoded string when standard_conforming_strings is off.
-[1] "X\\\\012\\\\000\\\\000\\\\000\\\\002\\\\000\\\\003\\\\000\\\\000\\\\000\\\\002\\\\003\\\\000\\\\000\\\\000\\\\000\\\\023\\\\000\\\\000\\\\000\\\\002\\\\000\\\\000\\\\000\\\\020\\\\000\\\\000\\\\000\\\\001\\\\000\\\\004\\\\000\\\\011\\\\000\\\\000\\\\000\\\\003one\\\\000\\\\000\\\\000\\\\020\\\\000\\\\000\\\\000\\\\001\\\\000\\\\004\\\\000\\\\011\\\\000\\\\000\\\\000\\\\003two"
PASS: Identical data was recovered
DONE
>
> proc.time()
user system elapsed
- 0.429 0.034 0.522
+ 0.429 0.035 0.536
=======================================
--- /trunk/RPostgreSQL/tests/createTableMixedCaseTest.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/createTableMixedCaseTest.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -113,4 +113,4 @@
>
> proc.time()
user system elapsed
- 0.452 0.030 0.501
+ 0.449 0.024 0.506
=======================================
--- /trunk/RPostgreSQL/tests/dataTypeTests.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/dataTypeTests.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -145,4 +145,4 @@
>
> proc.time()
user system elapsed
- 0.516 0.034 0.630
+ 0.516 0.035 0.649
=======================================
--- /trunk/RPostgreSQL/tests/dateTZ.Rout.save Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/dateTZ.Rout.save Sun Feb 9 12:31:30 2014 UTC
@@ -183,4 +183,4 @@
>
> proc.time()
user system elapsed
- 0.744 0.035 0.975
+ 0.753 0.037 0.982
=======================================
--- /trunk/RPostgreSQL/tests/datetimeTests.R Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/datetimeTests.R Sun Feb 9 12:31:30 2014 UTC
@@ -26,6 +26,8 @@
dbname=Sys.getenv("POSTGRES_DATABASE"),
port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="", p,
5432))
+ dbGetQuery(con, "SET TIMEZONE TO 'UTC'")
+
dbTypeTests <- function(con, dateclass="timestamp without time zone") {
cat("\n\n**** Trying with ", dateclass, "\n")
=======================================
--- /trunk/RPostgreSQL/tests/datetimeTests.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/datetimeTests.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -43,6 +43,8 @@
+ dbname=Sys.getenv("POSTGRES_DATABASE"),
+ port=ifelse((p<-Sys.getenv("POSTGRES_PORT"))!="",
p, 5432))
+
++ dbGetQuery(con, "SET TIMEZONE TO 'UTC'")
++
+ dbTypeTests <- function(con, dateclass="timestamp without time zone") {
+ cat("\n\n**** Trying with ", dateclass, "\n")
+
@@ -98,11 +100,11 @@
**** Trying with timestamp with time zone
tt zz
-1 2008-07-01 05:15:16 1
-2 2000-01-01 18:04:05 2
+1 2008-07-01 14:15:16 1
+2 2000-01-02 03:04:05 2
name Sclass type len precision scale nullOK
1 tt POSIXct TIMESTAMPTZOID 8 -1 -1 TRUE
-[1] "2008-07-01 05:15:16 UTC" "2000-01-01 18:04:05 UTC"
+[1] "2008-07-01 14:15:16 UTC" "2000-01-02 03:04:05 UTC"
[1] "POSIXct" "POSIXt"
Time difference of -3103.466 days
@@ -120,4 +122,4 @@
>
> proc.time()
user system elapsed
- 0.539 0.029 0.694
+ 0.537 0.036 0.768
=======================================
--- /trunk/RPostgreSQL/tests/datetimestampwrite.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/datetimestampwrite.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -109,4 +109,4 @@
>
> proc.time()
user system elapsed
- 0.475 0.030 0.553
+ 0.478 0.031 0.571
=======================================
--- /trunk/RPostgreSQL/tests/dbColumnInfo.R Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/dbColumnInfo.R Sun Feb 9 12:31:30 2014 UTC
@@ -1,7 +1,8 @@
## dbColumnInfo test
-## This test confirms that dbColumnInfo() will not cause segfault under
gctorture()
## Initial report was sporadic segfault (Issue 42)
## and it was found reproducile under gctorture()
+## However, test with gctorture() is moved outside the package
+## because its execution time is too long.
##
## Assumes that
## a) PostgreSQL is running, and
@@ -29,15 +30,13 @@
# create a table
+ dbGetQuery(con, "set client_min_messages to 'WARNING'")
res <- dbGetQuery(con, "CREATE TABLE aa (pk integer primary key, v1
float not null, v2 float)" )
## run a simple query and show the query result
res <- dbGetQuery(con, "INSERT INTO aa VALUES(3, 2, NULL)" )
res <- dbSendQuery(con, "select pk, v1, v2, v1+v2 from aa")
- cat("This would take a while due to gctorture()\n")
cat("dbColumnInfo\n")
- gctorture()
- print(dbColumnInfo(res))
print(dbColumnInfo(res))
cat("SELECT result\n")
df <- fetch(res, n=-1)
=======================================
--- /trunk/RPostgreSQL/tests/dbColumnInfo.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/dbColumnInfo.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -16,9 +16,10 @@
Type 'q()' to quit R.
> ## dbColumnInfo test
-> ## This test confirms that dbColumnInfo() will not cause segfault under
gctorture()
> ## Initial report was sporadic segfault (Issue 42)
> ## and it was found reproducile under gctorture()
+> ## However, test with gctorture() is moved outside the package
+> ## because its execution time is too long.
> ##
> ## Assumes that
> ## a) PostgreSQL is running, and
@@ -46,15 +47,13 @@
+
+
+ # create a table
++ dbGetQuery(con, "set client_min_messages to 'WARNING'")
+ res <- dbGetQuery(con, "CREATE TABLE aa (pk integer primary key, v1
float not null, v2 float)" )
+
+ ## run a simple query and show the query result
+ res <- dbGetQuery(con, "INSERT INTO aa VALUES(3, 2, NULL)" )
+ res <- dbSendQuery(con, "select pk, v1, v2, v1+v2 from aa")
-+ cat("This would take a while due to gctorture()\n")
+ cat("dbColumnInfo\n")
-+ gctorture()
-+ print(dbColumnInfo(res))
+ print(dbColumnInfo(res))
+ cat("SELECT result\n")
+ df <- fetch(res, n=-1)
@@ -70,14 +69,7 @@
+ }
Loading required package: RPostgreSQL
Loading required package: DBI
-NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "aa_pkey"
for table "aa"
-This would take a while due to gctorture()
dbColumnInfo
- name Sclass type len precision scale nullOK
-1 pk integer INTEGER 4 -1 -1 FALSE
-2 v1 double FLOAT8 8 -1 -1 FALSE
-3 v2 double FLOAT8 8 -1 -1 TRUE
-4 ?column? double FLOAT8 8 -1 -1 NA
name Sclass type len precision scale nullOK
1 pk integer INTEGER 4 -1 -1 FALSE
2 v1 double FLOAT8 8 -1 -1 FALSE
@@ -91,4 +83,4 @@
>
> proc.time()
user system elapsed
- 75.272 0.032 75.427
+ 0.391 0.039 0.488
=======================================
--- /trunk/RPostgreSQL/tests/dbExistsIssue.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/dbExistsIssue.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -79,4 +79,4 @@
>
> proc.time()
user system elapsed
- 0.464 0.026 0.555
+ 0.455 0.035 0.536
=======================================
--- /trunk/RPostgreSQL/tests/dbExistsq.Rout.save Sat Feb 8 09:29:04 2014
UTC
+++ /trunk/RPostgreSQL/tests/dbExistsq.Rout.save Sun Feb 9 12:31:30 2014
UTC
@@ -84,4 +84,4 @@
>
> proc.time()
user system elapsed
- 0.458 0.028 0.577
+ 0.456 0.037 0.543
=======================================
--- /trunk/RPostgreSQL/tests/dbExistsqc.Rout.save Sat Feb 8 09:29:04 2014
UTC
+++ /trunk/RPostgreSQL/tests/dbExistsqc.Rout.save Sun Feb 9 12:31:30 2014
UTC
@@ -127,4 +127,4 @@
>
> proc.time()
user system elapsed
- 0.535 0.034 0.718
+ 0.533 0.033 0.671
=======================================
--- /trunk/RPostgreSQL/tests/dbGetQueryParams.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/dbGetQueryParams.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -90,4 +90,4 @@
>
> proc.time()
user system elapsed
- 0.447 0.030 0.569
+ 0.444 0.028 0.560
=======================================
--- /trunk/RPostgreSQL/tests/dbListFields.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/dbListFields.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -85,4 +85,4 @@
>
> proc.time()
user system elapsed
- 0.426 0.027 0.500
+ 0.421 0.034 0.510
=======================================
--- /trunk/RPostgreSQL/tests/dbTransactionTests.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/dbTransactionTests.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -128,4 +128,4 @@
>
> proc.time()
user system elapsed
- 0.553 0.039 0.748
+ 0.553 0.032 0.749
=======================================
--- /trunk/RPostgreSQL/tests/dbWriteTableFailTest.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/dbWriteTableFailTest.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -105,4 +105,4 @@
>
> proc.time()
user system elapsed
- 0.453 0.028 0.565
+ 0.450 0.024 0.492
=======================================
--- /trunk/RPostgreSQL/tests/dbWriteTableSchema.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/dbWriteTableSchema.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -84,4 +84,4 @@
>
> proc.time()
user system elapsed
- 0.417 0.035 0.509
+ 0.434 0.029 0.518
=======================================
--- /trunk/RPostgreSQL/tests/dbWriteTableTest.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/dbWriteTableTest.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -95,4 +95,4 @@
>
> proc.time()
user system elapsed
- 0.469 0.040 0.587
+ 0.488 0.040 0.626
=======================================
--- /trunk/RPostgreSQL/tests/dbWriteTabletypes.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/dbWriteTabletypes.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -264,18 +264,10 @@
2 müß
[1] "Removing rockdata\n"
PASS: could write small umlaut u and ligature sz
-Error in postgresqlgetResult(new.con) :
- RS-DBI driver: (could not Retrieve the result : ERROR: character
0xe6bca2 of encoding "UTF8" has no equivalent in "WIN1252"
-CONTEXT: COPY rockdata, line 2
-)
-FAIL: could not write kanji.
- This might be no problem for you if you don't use multibyte
characters.
- Otherwise, please check for the server encoding.
- Database encoding is usually set at the time of createdb.
- You can see for more information on how to setup at
-
http://www.postgresql.org/docs/9.1/static/multibyte.html
-
+1 normal
+2 kanji漢字
[1] "Removing rockdata\n"
+PASS: could write kanji
Read Numeric values
PASS -- all integer is as expected
PASS integer value is preservedGOOD -- all numeric values are as expected
@@ -293,4 +285,4 @@
>
> proc.time()
user system elapsed
- 1.057 0.062 1.558
+ 1.053 0.046 1.580
=======================================
--- /trunk/RPostgreSQL/tests/dbtemptable.Rout.save Sat Feb 8 09:29:04 2014
UTC
+++ /trunk/RPostgreSQL/tests/dbtemptable.Rout.save Sun Feb 9 12:31:30 2014
UTC
@@ -70,4 +70,4 @@
>
> proc.time()
user system elapsed
- 0.372 0.037 0.465
+ 0.394 0.027 0.482
=======================================
--- /trunk/RPostgreSQL/tests/escape.R Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/escape.R Sun Feb 9 12:31:30 2014 UTC
@@ -33,8 +33,12 @@
print(st)
st2 <- (postgresqlEscapeStrings(con,"aa'a"))
print(st2)
+ dbGetQuery(con, "set standard_conforming_strings to 'on'")
st3 <- (postgresqlEscapeStrings(con,"aa\\a"))
print(st3)
+ dbGetQuery(con, "set standard_conforming_strings to 'off'")
+ st4 <- (postgresqlEscapeStrings(con,"aa\\a"))
+ print(st4)
## and disconnect
dbDisconnect(con)
=======================================
--- /trunk/RPostgreSQL/tests/escape.Rout.save Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/escape.Rout.save Sun Feb 9 12:31:30 2014 UTC
@@ -50,8 +50,12 @@
+ print(st)
+ st2 <- (postgresqlEscapeStrings(con,"aa'a"))
+ print(st2)
++ dbGetQuery(con, "set standard_conforming_strings to 'on'")
+ st3 <- (postgresqlEscapeStrings(con,"aa\\a"))
+ print(st3)
++ dbGetQuery(con, "set standard_conforming_strings to 'off'")
++ st4 <- (postgresqlEscapeStrings(con,"aa\\a"))
++ print(st4)
+
+ ## and disconnect
+ dbDisconnect(con)
@@ -63,9 +67,10 @@
Note the appropriate string may differ upon server setting and connection
state.
[1] "aaa"
[1] "aa''a"
+[1] "aa\\a"
[1] "aa\\\\a"
[1] TRUE
>
> proc.time()
user system elapsed
- 0.359 0.027 0.375
+ 0.363 0.032 0.385
=======================================
--- /trunk/RPostgreSQL/tests/loadDriverAndConnect.Rout.save Sat Feb 8
09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/loadDriverAndConnect.Rout.save Sun Feb 9
12:31:30 2014 UTC
@@ -62,4 +62,4 @@
>
> proc.time()
user system elapsed
- 0.360 0.035 0.387
+ 0.367 0.028 0.407
=======================================
--- /trunk/RPostgreSQL/tests/openSendQuery.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/openSendQuery.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -93,4 +93,4 @@
>
> proc.time()
user system elapsed
- 0.404 0.029 0.453
+ 0.410 0.033 0.458
=======================================
--- /trunk/RPostgreSQL/tests/selectWhereZero.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/selectWhereZero.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -87,4 +87,4 @@
>
> proc.time()
user system elapsed
- 0.438 0.032 0.552
+ 0.448 0.031 0.525
=======================================
--- /trunk/RPostgreSQL/tests/selectWithAlias.Rout.save Sat Feb 8 09:29:04
2014 UTC
+++ /trunk/RPostgreSQL/tests/selectWithAlias.Rout.save Sun Feb 9 12:31:30
2014 UTC
@@ -85,4 +85,4 @@
>
> proc.time()
user system elapsed
- 0.454 0.030 0.561
+ 0.437 0.034 0.532
=======================================
--- /trunk/RPostgreSQL/tests/unknowntype.R Sat Feb 8 09:29:04 2014 UTC
+++ /trunk/RPostgreSQL/tests/unknowntype.R Sun Feb 9 12:31:30 2014 UTC
@@ -39,7 +39,8 @@
res <- dbGetQuery(con, "create table tmpirisdata (ra REAL[])")
res <- dbSendQuery(con, "select ra from tmpirisdata")
cat("Note connection handle will change every time\n")
- print(res)
+# connection data are variable, so don't print
+# print(res)
type <- dbColumnInfo(res)
print(type)
data <- fetch(res, -1)
=======================================
--- /trunk/RPostgreSQL/tests/unknowntype.Rout.save Sat Feb 8 09:29:04 2014
UTC
+++ /trunk/RPostgreSQL/tests/unknowntype.Rout.save Sun Feb 9 12:31:30 2014
UTC
@@ -56,7 +56,8 @@
+ res <- dbGetQuery(con, "create table tmpirisdata (ra REAL[])")
+ res <- dbSendQuery(con, "select ra from tmpirisdata")
+ cat("Note connection handle will change every time\n")
-+ print(res)
++ # connection data are variable, so don't print
++ # print(res)
+ type <- dbColumnInfo(res)
+ print(type)
+ data <- fetch(res, -1)
@@ -77,7 +78,6 @@
Loading required package: RPostgreSQL
Loading required package: DBI
Note connection handle will change every time
-<PostgreSQLResult:(24570,0,4)>
name Sclass type len precision scale nullOK
1 ra character UNKNOWN -1 -1 -1 TRUE
data frame with 0 columns and 0 rows
@@ -89,4 +89,4 @@
>
> proc.time()
user system elapsed
- 0.401 0.033 0.485
+ 0.417 0.035 0.492
=======================================
--- /trunk/check_with_vars.sh Thu Aug 22 07:27:57 2013 UTC
+++ /trunk/check_with_vars.sh Sun Feb 9 12:31:30 2014 UTC
@@ -38,6 +38,12 @@
#R CMD check RPostgreSQL
+for f in exttests/*.R
+do
+ echo ""
+ echo "==== Running $f"
+R -d "valgrind --tool=memcheck --leak-check=full" --slave < $f
+done
for f in RPostgreSQL/tests/*.R
do
echo ""