Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing an inconsistency in test mode and a windows dll issue.

  • Loading branch information...
commit 7e6a0caf1d8a85721ec10632b2735eaeb112093c 1 parent 0a2edbc
@jeffreyhorner jeffreyhorner authored
Showing with 6 additions and 4 deletions.
  1. +1 −1  DESCRIPTION
  2. +2 −2 R/zzz.R
  3. +3 −1 tests/tests.R
View
2  DESCRIPTION
@@ -1,5 +1,5 @@
Package: RMySQL
-Version: 0.9-0
+Version: 0.9-1
Date: 2012-01-12
Title: R interface to the MySQL database
Author: David A. James and Saikat DebRoy
View
4 R/zzz.R
@@ -42,7 +42,7 @@ if(.Platform$OS.type == "windows") {
ProgramFilesMySQL <- file.path(Sys.getenv("ProgramFiles"), "MySQL")
default.disks <- c("C:", "D:", "E:", "F:", "G:")
- default.dirs <- file.path(c("", "/Apps"), "MySQL")
+ default.dirs <- file.path(c("", "/xampp", "/Apps"), "MySQL")
g <- with(expand.grid(disk = default.disks, dir = default.dirs),
paste(disk, dir, sep = ""))
lookup.paths <- c(ProgramFilesMySQL, g)
@@ -73,7 +73,6 @@ if(.Platform$OS.type == "windows") {
if (Sys.getenv("MYSQL_HOME")=="") {
bin <- dir(path = mysql, pattern = "^bin$", recursive = TRUE,
full = TRUE, ignore.case = TRUE)
- bin <- tail(bin, 1)
cwd <- getwd()
setwd(bin)
setwd("..")
@@ -84,6 +83,7 @@ if(.Platform$OS.type == "windows") {
recursive = TRUE, full = TRUE, ignore.case = TRUE)
dll <- dir(path = mysql, pattern = "^libmysql.dll$",
recursive = TRUE, full = TRUE, ignore.case = TRUE)
+ dll <- dirname(dll)
include <- dir(path = mysql, pattern = "^include$", include.dirs = TRUE,
recursive = TRUE, full = TRUE, ignore.case = TRUE)
library.dynam("RMySQL", pkgname, libname, DLLpath = dll)
View
4 tests/tests.R
@@ -12,7 +12,9 @@ conn <- try(if (is.na(user) && is.na(password)) {
dbConnect(drv, dbname = dbname)
} else {
# in this leg they were specified via environment variables
- dbConnect(drv, user = user, password = password, dbname = dbname)
+ if (is.na(user)) dbConnect(drv, password = password, dbname = dbname)
+ else if (is.na(password)) dbConnect(drv, user = user, dbname = dbname)
+ else dbConnect(drv, user = user, password = password, dbname = dbname)
})
if (inherits(conn, "try-error")) {
cat("unable to connect to MySQL\n")
Please sign in to comment.
Something went wrong with that request. Please try again.