Changeset: b802bfdf32b1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b802bfdf32b1
Modified Files:
gdk/gdk_heap.c
sql/test/BugTracker-2012/Tests/All
sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.sql.in
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out
Branch: default
Log Message:
Merge with Jan2014 branch.
diffs (truncated from 435 to 300 lines):
diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c
--- a/gdk/gdk_heap.c
+++ b/gdk/gdk_heap.c
@@ -100,10 +100,6 @@ decompose_filename(str nme)
int
HEAPalloc(Heap *h, size_t nitems, size_t itemsize)
{
- char nme[PATHLENGTH];
- size_t minsize = GDK_mmap_minsize;
- struct stat st;
-
h->base = NULL;
h->size = 1;
h->copied = 0;
@@ -115,16 +111,19 @@ HEAPalloc(Heap *h, size_t nitems, size_t
if (itemsize && nitems > (h->size / itemsize))
return -1;
- if (h->filename == NULL || h->size < minsize) {
+ if (h->filename == NULL || h->size < GDK_mmap_minsize) {
h->storage = STORE_MEM;
h->base = (char *) GDKmallocmax(h->size, &h->size, 0);
HEAPDEBUG fprintf(stderr, "#HEAPalloc " SZFMT " " PTRFMT "\n",
h->size, PTRFMTCAST h->base);
}
if (h->filename && h->base == NULL) {
- char *of = h->filename;
+ char nme[PATHLENGTH];
+ struct stat st;
+ char *of;
+ of = h->filename;
h->filename = NULL;
-
+ GDKfilepath(nme, BATDIR, of, NULL);
if (stat(nme, &st) < 0) {
h->storage = STORE_MMAP;
h->base = HEAPcreatefile(&h->size, of);
diff --git a/sql/test/BugTracker-2012/Tests/All
b/sql/test/BugTracker-2012/Tests/All
--- a/sql/test/BugTracker-2012/Tests/All
+++ b/sql/test/BugTracker-2012/Tests/All
@@ -1,9 +1,9 @@
# tests related to bug reports:
# <descriptive-name>.Bug-<bug-report-id>
#
+aggregate_vs_positional_column_crash.Bug-3085
time-export-bug.Bug-2963
sticky-precision.Bug-2969
-url_script_test.Bug-2972
date_script_test.Bug-2973
nested-select-crash.Bug-3009
combination_of_theta_and_equijoins.Bug-3004
@@ -39,7 +39,6 @@ grant_on_qname.Bug-2958
bug_large-insert-Bug.2960
any_null.Bug-2594
float-mod.Bug-3086
-aggregate_vs_positional_column_crash.Bug-3085
predicate_select.Bug-3090
hash_join_crash.Bug-3089
row-number-nyi.Bug-3087
@@ -84,3 +83,4 @@ inet-casts.Bug-3205
fixed_limit_for_prepare.Bug-3208
exp_bin_assertion.Bug-3209
querycache.Bug-3212.sql
+url_script_test.Bug-2972
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.py
@@ -4,12 +4,6 @@ try:
except ImportError:
import process
-
-currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
-
-#SQL command for checking the localtime
-sqlcommand = "select (localtime() - time '%s' < time '00:00:20') and (time
'%s' - localtime() < time '00:00:20');" %(currenttime, currenttime)
-
def server_start():
sys.stderr.write('#mserver\n')
sys.stderr.flush()
@@ -17,17 +11,20 @@ def server_start():
stdout = process.PIPE, stderr = process.PIPE)
return srv
-def client(lang, sqlCommand, user = 'monetdb', passwd = 'monetdb'):
+def client(lang, user = 'monetdb', passwd = 'monetdb'):
sys.stderr.write('#client\n')
sys.stderr.flush()
clt = process.client(lang, user = user, passwd = passwd,
stdin = process.PIPE,
stdout = process.PIPE, stderr = process.PIPE)
- return clt.communicate(sqlCommand)
+ currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
+ #SQL command for checking the localtime
+ sqlcommand = "select (localtime() - time '%s' < time '00:00:20') and (time
'%s' - localtime() < time '00:00:20');" % (currenttime, currenttime)
+ return clt.communicate(sqlcommand)
def main():
srv = server_start()
- out, err = client('sql',sqlcommand)
+ out, err = client('sql')
sys.stdout.write(out)
sys.stderr.write(err)
diff --git a/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.sql.in
b/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.sql.in
--- a/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.sql.in
+++ b/sql/test/BugTracker-2012/Tests/url_script_test.Bug-2972.sql.in
@@ -1,3 +1,5 @@
+start transaction;
+
create table t2972(u url);
insert into t2972 values('http://www.cwi.nl/~mk/vision2011.pdf');
insert into t2972 values('http://www.monetdb.com?x=2');
@@ -44,3 +46,5 @@ insert into t2972 values ('$UTSTSRCDIR/u
select getContent(u) from t2972;
drop table t2972;
+
+rollback;
diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
@@ -29,28 +29,6 @@ update sys._tables set system = false wh
drop view sys.queryLog;
drop table sys.callHistory;
drop table sys.queryHistory;
--- The contents of this file are subject to the MonetDB Public License
--- Version 1.1 (the "License"); you may not use this file except in
--- compliance with the License. You may obtain a copy of the License at
--- http://www.monetdb.org/Legal/MonetDBLicense
---
--- Software distributed under the License is distributed on an "AS IS"
--- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
--- License for the specific language governing rights and limitations
--- under the License.
---
--- The Original Code is the MonetDB Database System.
---
--- The Initial Developer of the Original Code is CWI.
--- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
--- Copyright August 2008-2014 MonetDB B.V.
--- All Rights Reserved.
-
--- QUERY HISTORY
--- The query history mechanism of MonetDB/SQL relies on a few hooks.
--- The most important one is a global system variable which controls
--- monitoring of all sessions.
-
create function sys.querylog_catalog()
returns table(
id oid,
@@ -63,20 +41,6 @@ returns table(
)
external name sql.querylog_catalog;
--- Each query call is stored in the table calls
--- At regular intervals the query history table should be cleaned.
--- This can be done manually on the SQL console, or be integrated
--- in the keepQuery and keepCall upon need.
--- The parameters are geared at understanding the resource claims
--- They reflect the effect of the total workload mix during execution.
--- The 'cpu' gives the average cpu load percentage over all cores on the
--- server during execution phase.
--- increasing cpu load indicates better use of multi-cores.
--- The 'io' indicate IOs during complete query run.
--- The 'space' is the total amount of intermediates created in MB.
--- Reducing the space component improves performance/
--- All timing in usec and all storage in bytes.
-
create function sys.querylog_calls()
returns table(
id oid, -- references query plan
@@ -92,7 +56,6 @@ returns table(
)
external name sql.querylog_calls;
--- create table views for convenience
create view sys.querylog_catalog as select * from sys.querylog_catalog();
create view sys.querylog_calls as select * from sys.querylog_calls();
create view sys.querylog_history as
@@ -105,11 +68,9 @@ update sys._tables
where name in ('querylog_history', 'querylog_calls', 'querylog_catalog')
and schema_id = (select id from sys.schemas where name = 'sys');
--- reset history for a particular user
create procedure sys.querylog_empty()
external name sql.querylog_empty;
--- manipulate the query logger
create procedure sys.querylog_enable()
external name sql.querylog_enable;
create procedure sys.querylog_enable(threshold smallint)
@@ -127,26 +88,6 @@ create procedure sys.settimeout("query"
create procedure sys.setsession("timeout" bigint) external name sql.setsession;
create view sys.optimizers as select * from sys.optimizers();
create view sys.environment as select * from sys.environment();
--- The contents of this file are subject to the MonetDB Public License
--- Version 1.1 (the "License"); you may not use this file except in
--- compliance with the License. You may obtain a copy of the License at
--- http://www.monetdb.org/Legal/MonetDBLicense
---
--- Software distributed under the License is distributed on an "AS IS"
--- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
--- License for the specific language governing rights and limitations
--- under the License.
---
--- The Original Code is the MonetDB Database System.
---
--- The Initial Developer of the Original Code is CWI.
--- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
--- Copyright August 2008-2014 MonetDB B.V.
--- All Rights Reserved.
-
--- System monitoring
-
--- show status of all active SQL queries.
create function sys.queue()
returns table(
qtag bigint,
@@ -166,7 +107,6 @@ update sys._tables
where name = 'queue'
and schema_id = (select id from sys.schemas where name = 'sys');
--- operations to manipulate the state of havoc queries
create procedure sys.pause(tag int)
external name sql.sysmon_pause;
create procedure sys.resume(tag int)
@@ -180,11 +120,6 @@ create procedure sys.resume(tag bigint)
external name sql.sysmon_resume;
create procedure sys.stop(tag bigint)
external name sql.sysmon_stop;
-
---create function sysmon.connections()
---returns table(
---)
---external name sql.sql_sysmon_connections;
create aggregate quantile(val TINYINT, q DOUBLE) returns TINYINT external name
"aggr"."quantile";
create aggregate quantile(val SMALLINT, q DOUBLE) returns SMALLINT external
name "aggr"."quantile";
create aggregate quantile(val INTEGER, q DOUBLE) returns INTEGER external name
"aggr"."quantile";
@@ -199,29 +134,6 @@ create aggregate quantile(val TIMESTAMP,
create aggregate median(val DECIMAL) returns DECIMAL external name
"aggr"."median";
create view sys.storage as select * from sys.storage();
create view sys.storagemodel as select * from sys.storagemodel();
--- The contents of this file are subject to the MonetDB Public License
--- Version 1.1 (the "License"); you may not use this file except in
--- compliance with the License. You may obtain a copy of the License at
--- http://www.monetdb.org/Legal/MonetDBLicense
---
--- Software distributed under the License is distributed on an "AS IS"
--- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
--- License for the specific language governing rights and limitations
--- under the License.
---
--- The Original Code is the MonetDB Database System.
---
--- The Initial Developer of the Original Code is CWI.
--- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
--- Copyright August 2008-2014 MonetDB B.V.
--- All Rights Reserved.
-
-
--- Author M.Kersten
--- This script gives the database administrator insight in the actual
--- value distribution over all tables in the database.
-
-
CREATE TABLE sys.statistics(
"schema" string,
"table" string,
@@ -254,7 +166,6 @@ external name sql.analyze;
create procedure analyze(sch string, tbl string, col string)
external name sql.analyze;
--- control the sample size
create procedure analyze("sample" bigint)
external name sql.analyze;
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.stable.out
b/sql/test/testdb-upgrade/Tests/upgrade.stable.out
--- a/sql/test/testdb-upgrade/Tests/upgrade.stable.out
+++ b/sql/test/testdb-upgrade/Tests/upgrade.stable.out
@@ -25,28 +25,6 @@ update sys._tables set system = false wh
drop view sys.queryLog;
drop table sys.callHistory;
drop table sys.queryHistory;
--- The contents of this file are subject to the MonetDB Public License
--- Version 1.1 (the "License"); you may not use this file except in
--- compliance with the License. You may obtain a copy of the License at
--- http://www.monetdb.org/Legal/MonetDBLicense
---
--- Software distributed under the License is distributed on an "AS IS"
--- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
--- License for the specific language governing rights and limitations
--- under the License.
---
--- The Original Code is the MonetDB Database System.
---
--- The Initial Developer of the Original Code is CWI.
--- Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
--- Copyright August 2008-2014 MonetDB B.V.
--- All Rights Reserved.
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list