Changeset: 3141b26372b0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3141b26372b0
Modified Files:
clients/R/MonetDB.R/DESCRIPTION
clients/R/MonetDB.R/NEWS
clients/R/MonetDB.R/R/monetdb.R
clients/R/db.tests/monetdb.test.R
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures_gsl.stable.out
clients/Tests/MAL-signatures_nocfitsio.stable.out
clients/Tests/MAL-signatures_sphinxclient.stable.out
geom/monetdb5/geom.c
monetdb5/mal/Tests/All
monetdb5/mal/mal_authorize.c
monetdb5/mal/mal_instruction.c
monetdb5/mal/mal_interpreter.c
monetdb5/mal/mal_linker.c
monetdb5/mal/mal_listing.c
monetdb5/mal/mal_module.c
monetdb5/mal/mal_profiler.c
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/mtime.c
monetdb5/modules/kernel/array.c
monetdb5/modules/kernel/batstr.c
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/cluster.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/profiler.c
monetdb5/modules/mal/querylog.c
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/sysmon.c
monetdb5/modules/mal/tablet.c
monetdb5/optimizer/opt_pushselect.c
monetdb5/scheduler/run_octopus.c
monetdb5/tests/gdkTests/Tests/bat_insert.stable.out
monetdb5/tests/gdkTests/Tests/reload.stable.out
sql/backends/monet5/sql_scenario.c
Branch: bamloader
Log Message:
Merge with default branch.
diffs (truncated from 1976 to 300 lines):
diff --git a/clients/R/MonetDB.R/DESCRIPTION b/clients/R/MonetDB.R/DESCRIPTION
--- a/clients/R/MonetDB.R/DESCRIPTION
+++ b/clients/R/MonetDB.R/DESCRIPTION
@@ -1,6 +1,6 @@
Package: MonetDB.R
Version: 0.9.4
-Date: 2013-07-14
+Date: 2013-07-16
Title: Connect MonetDB to R
Authors@R: c(person("Hannes Muehleisen", role = c("aut", "cre"),email =
"[email protected]"),
person("Thomas Lumley", role = "ctb"),
diff --git a/clients/R/MonetDB.R/NEWS b/clients/R/MonetDB.R/NEWS
--- a/clients/R/MonetDB.R/NEWS
+++ b/clients/R/MonetDB.R/NEWS
@@ -1,5 +1,6 @@
0.9.4
- dbWriteTable overhaul (thanks, Anthony)
+- Fix for dbListTables for MonetDB versions after Jan2014
0.9.3
- Remove trailing slashes for monetdb.program.path parameter for
monetdb.server.setup (Thanks, Anthony!)
diff --git a/clients/R/MonetDB.R/R/monetdb.R b/clients/R/MonetDB.R/R/monetdb.R
--- a/clients/R/MonetDB.R/R/monetdb.R
+++ b/clients/R/MonetDB.R/R/monetdb.R
@@ -149,7 +149,7 @@ setMethod("dbDisconnect", "MonetDBConnec
setMethod("dbListTables", "MonetDBConnection", def=function(conn, ...,
sys_tables=F, schema_names=F, quote=F) {
q <- "select schemas.name as sn, tables.name as tn from tables join schemas
on tables.schema_id=schemas.id"
- if (!sys_tables) q <- paste0(q, " where system=false")
+ if (!sys_tables) q <- paste0(q, " where tables.system=false")
df <- dbGetQuery(conn, q)
if (quote) {
df$tn <- paste0("\"", df$tn, "\"")
@@ -275,8 +275,8 @@ setMethod("dbSendQuery", signature(conn=
# adapted from RMonetDB, very useful...
-setMethod("dbWriteTable", "MonetDBConnection", def=function(conn, name, value,
overwrite=FALSE, append=FALSE, insert=FALSE,
- ...) {
+setMethod("dbWriteTable", "MonetDBConnection", def=function(conn, name, value,
overwrite=FALSE,
+ append=FALSE, csvdump=FALSE, ...) {
if (is.vector(value) && !is.list(value)) value <- data.frame(x=value)
if (length(value)<1) stop("value must have at least one column")
if (is.null(names(value))) names(value) <- paste("V", 1:length(value),
sep='')
@@ -291,8 +291,9 @@ setMethod("dbWriteTable", "MonetDBConnec
qname <- make.db.names(conn, name, allow.keywords=FALSE)
if (dbExistsTable(conn, name)) {
if (overwrite) dbRemoveTable(conn, name)
- if (!overwrite && !append) stop("Table '", name, "' already exists. Set
overwrite=TRUE if you want to remove
- the existing table. Set append=TRUE if you would like to add the new
data to the existing table.")
+ if (!overwrite && !append) stop("Table '", name, "' already exists. Set
overwrite=TRUE if you want
+ to remove the existing table. Set append=TRUE if you would like to add
the new data to the
+ existing table.")
}
if (!dbExistsTable(conn, name)) {
fts <- sapply(value, dbDataType, dbObj=conn)
@@ -301,18 +302,24 @@ setMethod("dbWriteTable", "MonetDBConnec
dbSendUpdate(conn, ct)
}
if (length(value[[1]])) {
- if (insert) {
- inss <- paste("INSERT INTO ", qname, " VALUES (", paste(rep("?",
length(value)), collapse=', '),
- ")", sep='')
- dbTransaction(conn)
- for (j in 1:length(value[[1]])) dbSendUpdate(conn, inss,
list=as.list(value[j, ]))
- dbCommit(conn)
- } else {
+ if (csvdump) {
tmp <- tempfile(fileext = ".csv")
write.table(value, tmp, sep = ",", quote = TRUE,row.names = FALSE,
col.names = FALSE,na="")
dbSendQuery(conn, paste0("COPY ",format(nrow(value), scientific=FALSE),"
RECORDS INTO ", qname,
" FROM '", tmp, "' USING DELIMITERS ',','\\n','\"' NULL AS '' LOCKED"))
- file.remove(tmp)
+ file.remove(tmp)
+ } else {
+ vins <- paste("(", paste(rep("?", length(value)), collapse=', '), ")",
sep='')
+ dbTransaction(conn)
+ # chunk some inserts together so we do not need to do a round trip for
every one
+ splitlen <- 0:(nrow(value)-1) %/% getOption("monetdb.insert.splitsize",
1000)
+ lapply(split(value, splitlen),
+ function(valueck) {
+ bvins <- c()
+ for (j in 1:length(valueck[[1]])) bvins <-
c(bvins,.bindParameters(vins, as.list(valueck[j, ])))
+ dbSendUpdate(conn, paste0("INSERT INTO ", qname, " VALUES
",paste0(bvins, collapse=", ")))
+ })
+ dbCommit(conn)
}
}
return(invisible(TRUE))
@@ -324,7 +331,6 @@ setMethod("dbDataType", signature(dbObj=
else if (is.integer(obj)) "INTEGER"
else if (is.numeric(obj)) "DOUBLE PRECISION"
else if (is.raw(obj)) "BLOB"
-
else "STRING"
}, valueClass = "character")
diff --git a/clients/R/db.tests/monetdb.test.R
b/clients/R/db.tests/monetdb.test.R
--- a/clients/R/db.tests/monetdb.test.R
+++ b/clients/R/db.tests/monetdb.test.R
@@ -1,4 +1,5 @@
options(monetdb.debug.query=T)
+options(monetdb.insert.splitsize=10)
library(MonetDB.R)
diff --git a/clients/Tests/MAL-signatures.stable.out
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -32028,12 +32028,24 @@ pattern bat.new(b:bat[:oid,:any_1],size:
address CMDBATnewDerived;
pattern bat.new(b:bat[:oid,:any_1]):bat[:oid,:any_1]
address CMDBATnewDerived;
+pattern bat.new_persistent(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm and allocate space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm with sufficient space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new empty transient BAT in the persistent farm, with head-
and tail-types as indicated.
+
pattern bat.new(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
address CMDBATnew;
comment Creates a new BAT and allocate space.
pattern bat.new(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
-address CMDBATnewint;
+address CMDBATnew;
comment Creates a new BAT with sufficient space.
pattern bat.new(ht:oid,tt:any_1):bat[:oid,:any_1]
diff --git a/clients/Tests/MAL-signatures_gsl.stable.out
b/clients/Tests/MAL-signatures_gsl.stable.out
--- a/clients/Tests/MAL-signatures_gsl.stable.out
+++ b/clients/Tests/MAL-signatures_gsl.stable.out
@@ -32040,12 +32040,24 @@ pattern bat.new(b:bat[:oid,:any_1],size:
address CMDBATnewDerived;
pattern bat.new(b:bat[:oid,:any_1]):bat[:oid,:any_1]
address CMDBATnewDerived;
+pattern bat.new_persistent(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm and allocate space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm with sufficient space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new empty transient BAT in the persistent farm, with head-
and tail-types as indicated.
+
pattern bat.new(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
address CMDBATnew;
comment Creates a new BAT and allocate space.
pattern bat.new(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
-address CMDBATnewint;
+address CMDBATnew;
comment Creates a new BAT with sufficient space.
pattern bat.new(ht:oid,tt:any_1):bat[:oid,:any_1]
diff --git a/clients/Tests/MAL-signatures_nocfitsio.stable.out
b/clients/Tests/MAL-signatures_nocfitsio.stable.out
--- a/clients/Tests/MAL-signatures_nocfitsio.stable.out
+++ b/clients/Tests/MAL-signatures_nocfitsio.stable.out
@@ -32028,12 +32028,24 @@ pattern bat.new(b:bat[:oid,:any_1],size:
address CMDBATnewDerived;
pattern bat.new(b:bat[:oid,:any_1]):bat[:oid,:any_1]
address CMDBATnewDerived;
+pattern bat.new_persistent(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm and allocate space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm with sufficient space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new empty transient BAT in the persistent farm, with head-
and tail-types as indicated.
+
pattern bat.new(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
address CMDBATnew;
comment Creates a new BAT and allocate space.
pattern bat.new(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
-address CMDBATnewint;
+address CMDBATnew;
comment Creates a new BAT with sufficient space.
pattern bat.new(ht:oid,tt:any_1):bat[:oid,:any_1]
diff --git a/clients/Tests/MAL-signatures_sphinxclient.stable.out
b/clients/Tests/MAL-signatures_sphinxclient.stable.out
--- a/clients/Tests/MAL-signatures_sphinxclient.stable.out
+++ b/clients/Tests/MAL-signatures_sphinxclient.stable.out
@@ -32028,12 +32028,24 @@ pattern bat.new(b:bat[:oid,:any_1],size:
address CMDBATnewDerived;
pattern bat.new(b:bat[:oid,:any_1]):bat[:oid,:any_1]
address CMDBATnewDerived;
+pattern bat.new_persistent(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm and allocate space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new BAT in the persistent farm with sufficient space.
+
+pattern bat.new_persistent(ht:oid,tt:any_1):bat[:oid,:any_1]
+address CMDBATnew_persistent;
+comment Creates a new empty transient BAT in the persistent farm, with head-
and tail-types as indicated.
+
pattern bat.new(ht:oid,tt:any_1,size:lng):bat[:oid,:any_1]
address CMDBATnew;
comment Creates a new BAT and allocate space.
pattern bat.new(ht:oid,tt:any_1,size:int):bat[:oid,:any_1]
-address CMDBATnewint;
+address CMDBATnew;
comment Creates a new BAT with sufficient space.
pattern bat.new(ht:oid,tt:any_1):bat[:oid,:any_1]
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -166,13 +166,13 @@ mbrFROMSTR(char *src, int *len, mbr **at
if (!nil && strstr(src,"BOX") == src && (c = strstr(src,"(")) != NULL)
{
/* Parse the mbr */
if ((c - src) != 3 && (c - src) != 4) {
- GDKerror("ParseException: Expected a string like 'BOX(0
0,1 1)' or 'BOX (0 0,1 1)'");
+ GDKerror("ParseException: Expected a string like 'BOX(0
0,1 1)' or 'BOX (0 0,1 1)'\n");
return 0;
}
if (sscanf(c,"(%lf %lf,%lf %lf)", &xmin, &ymin, &xmax, &ymax)
!= 4) {
+ GDKerror("ParseException: Not enough coordinates.\n");
return 0;
- GDKerror("ParseException: Not enough coordinates.");
}
} else if (!nil && (geosMbr = GEOSGeomFromWKT(src)) == NULL)
return 0;
diff --git a/monetdb5/mal/Tests/All b/monetdb5/mal/Tests/All
--- a/monetdb5/mal/Tests/All
+++ b/monetdb5/mal/Tests/All
@@ -135,11 +135,13 @@ tst260
tst2570
# tst265 -- windowsum and slidingsum have been removed
tst267
-tst270
+# opens /tmp/MonetEvents, i.e. not on Windows:
+NOT_WIN32?tst270
tst272
tst273
tst274
-tst275
+# opens /tmp/MonetEvents, i.e. not on Windows:
+NOT_WIN32?tst275
tst277
tst280
tst292
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -593,7 +593,7 @@ AUTHgetPasswordHash(str *ret, Client *c,
/* decypher the password */
rethrow("changePassword", tmp, AUTHdecypherValue(&passwd, &tmp));
- *ret = GDKstrdup(passwd);
+ *ret = passwd;
return(NULL);
}
@@ -645,8 +645,7 @@ AUTHdecypherValue(str *ret, str *value)
*/
/* this is the XOR decypher implementation */
- str r = GDKmalloc(sizeof(char) * (strlen(*value) + 1));
- str w = r;
+ str r, w;
str s = *value;
char t = '\0';
int escaped = 0;
@@ -654,10 +653,11 @@ AUTHdecypherValue(str *ret, str *value)
* (a space would only uppercase the password) */
int keylen = 0;
+ if (vaultKey == NULL)
+ throw(MAL, "decypherValue", "The vault is still locked!");
+ w = r = GDKmalloc(sizeof(char) * (strlen(*value) + 1));
if( r == NULL)
throw(MAL, "decypherValue", MAL_MALLOC_FAIL);
- if (vaultKey == NULL)
- throw(MAL, "decypherValue", "The vault is still locked!");
keylen = (int) strlen(vaultKey);
@@ -688,17 +688,17 @@ AUTHdecypherValue(str *ret, str *value)
static str
AUTHcypherValue(str *ret, str *value) {
/* this is the XOR cypher implementation */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list