Changeset: 45a4e2205363 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=45a4e2205363
Modified Files:
        sql/backends/monet5/sql.mx
        sql/scripts/15_querylog.sql
        sql/scripts/16_tracelog.sql
        sql/scripts/22_clients.sql
        sql/scripts/25_debug.sql
        sql/scripts/26_sysmon.sql
        sql/scripts/75_storagemodel.sql
        
sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.stable.out
        
sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--optimizers.stable.out
        
sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--performance.stable.out
        sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908.stable.out
        sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
        
sql/test/BugTracker-2009/Tests/name_clash_with_dump.SF-2780395.stable.out
        
sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.stable.out
        sql/test/BugTracker-2011/Tests/mclient-lsql-d.Bug-2861.stable.out
        sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.err
        sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out
        sql/test/BugTracker/Tests/multi-column-constraint.SF-1964587.stable.out
        sql/test/Dump/Tests/dump-empty.stable.out
        sql/test/Dump/Tests/dump.stable.out
        sql/test/Tests/systemfunctions.stable.out
        sql/test/UserDump/Tests/create.stable.out
Branch: default
Log Message:

update the SQL catalog description.
The SQL catalog descriptions have been added to the website.
All table creating functions visible to the user are also
turned into a view.
[a few more tests may have to be approved, i.e. those with counts]


diffs (truncated from 466 to 300 lines):

diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -456,21 +456,6 @@ function sql_environment{inline}()(name:
        return (name,value) := (name,value);
 end sql_environment;
 
-function clients{inline}()( user:bat[:oid,:str], login:bat[:oid,:str], 
lastcommand:bat[:oid,:str], actions:bat[:oid,:int], seconds:bat[:oid,:lng]);
-       U:= clients.getUsers();
-       u:= algebra.markH(U);
-       (Z,L):= clients.getLogins();
-       U1:= algebra.join(Z,U);
-       l:= algebra.markH(L);
-       C:= clients.getLastCommand();
-       c:= algebra.markH(C);
-       A:= clients.getActions();
-       a:= algebra.markH(A);
-       T:= clients.getTime();
-       t:= algebra.markH(T);
-       return (U1,l,c,a,t);
-end clients;
-
 function bbp{inline}()( id:bat[:oid,:int], name:bat[:oid,:str], 
htype:bat[:oid,:str], ttype:bat[:oid,:str], count:bat[:oid,:lng], 
refcnt:bat[:oid,:int], lrefcnt:bat[:oid,:int], location:bat[:oid,:str], 
heat:bat[:oid,:int], dirty:bat[:oid,:str], status:bat[:oid,:str], 
kind:bat[:oid,:str]);
 
        (ns,iht,itt,icnt,irefcnt,ilrefcnt,ilocation,iheat,idirty,istatus,ikind) 
:= bbp.get();
diff --git a/sql/scripts/15_querylog.sql b/sql/scripts/15_querylog.sql
--- a/sql/scripts/15_querylog.sql
+++ b/sql/scripts/15_querylog.sql
@@ -60,6 +60,21 @@ returns table(
 )
 external name sql.querylog_calls;
 
+-- create table views for convenience
+create view sys.querylog_catalog as select * from sys.querylog_catalog();
+
+update sys._tables
+    set system = true
+    where name = 'querylog_catalog'
+        and schema_id = (select id from sys.schemas where name = 'sys');
+
+create view sys.querylog_calls as select * from sys.querylog_calls();
+
+update sys._tables
+    set system = true
+    where name = 'querylog_calls'
+        and schema_id = (select id from sys.schemas where name = 'sys');
+
 create view sys.querylog_history as
 select qd.*, ql."start",ql."stop", ql.arguments, ql.tuples, ql.run, ql.ship, 
ql.cpu, ql.space, ql.io 
 from sys.querylog_catalog() qd, sys.querylog_calls() ql
@@ -69,6 +84,11 @@ update sys._tables
        where name = 'querylog_history'
                and schema_id = (select id from sys.schemas where name = 'sys');
 
+update sys._tables
+    set system = true
+    where name = 'querylog_history'
+        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;
diff --git a/sql/scripts/16_tracelog.sql b/sql/scripts/16_tracelog.sql
--- a/sql/scripts/16_tracelog.sql
+++ b/sql/scripts/16_tracelog.sql
@@ -15,7 +15,7 @@
 -- All Rights Reserved.
 
 -- make the offline tracing table available for inspection
-create function tracelog() 
+create function sys.tracelog() 
        returns table (
                event integer,          -- event counter
                clk varchar(20),        -- wallclock, no mtime in kernel
@@ -32,3 +32,8 @@ create function tracelog()
        )
        external name sql.dump_trace;
 
+create view sys.tracelog as select * from sys.tracelog();
+update sys._tables
+    set system = true
+    where name = 'tracelog'
+        and schema_id = (select id from sys.schemas where name = 'sys');
diff --git a/sql/scripts/22_clients.sql b/sql/scripts/22_clients.sql
--- a/sql/scripts/22_clients.sql
+++ b/sql/scripts/22_clients.sql
@@ -14,11 +14,6 @@
 -- Copyright August 2008-2013 MonetDB B.V.
 -- All Rights Reserved.
 
-create function clients () 
-       returns table ("user" string, login string, lastcommand string,
-                actions int, seconds BIGINT) 
-       external name sql.clients;
-
 create function password_hash (username string) 
        returns string 
        external name sql.password;
diff --git a/sql/scripts/25_debug.sql b/sql/scripts/25_debug.sql
--- a/sql/scripts/25_debug.sql
+++ b/sql/scripts/25_debug.sql
@@ -15,7 +15,7 @@
 -- All Rights Reserved.
 
 -- show the optimizer statistics maintained by the SQL frontend
-create function optimizer_stats () 
+create function sys.optimizer_stats () 
        returns table (rewrite string, count int) 
        external name sql.dump_opt_stats;
 
@@ -23,32 +23,44 @@ create function optimizer_stats ()
 -- SQL QUERY CACHE
 -- The SQL query cache returns a table with the query plans kept
 
-create function queryCache() 
+create function sys.queryCache() 
        returns table (query string, count int) 
        external name sql.dump_cache;
 
 -- Trace the SQL input
-create procedure querylog(filename string) 
+create procedure sys.querylog(filename string) 
        external name sql.logfile;
 
 -- MONETDB KERNEL SECTION
 -- optimizer pipe catalog
-create function optimizers () 
+create function sys.optimizers () 
        returns table (name string, def string, status string)
        external name sql.optimizers;
+create view sys.optimizers as select * from sys.optimizers();
+
+update sys._tables
+    set system = true
+    where name = 'optimizers'
+        and schema_id = (select id from sys.schemas where name = 'sys');
 
 -- The environment table
-create function environment()
+create function sys.environment()
        returns table ("name" string, value string)
        external name sql.sql_environment;
+create view sys.environment as select * from sys.environment();
+
+update sys._tables
+    set system = true
+    where name = 'environment'
+        and schema_id = (select id from sys.schemas where name = 'sys');
 
 -- The BAT buffer pool overview
-create function bbp () 
+create function sys.bbp () 
        returns table (id int, name string, htype string, 
                ttype string, count BIGINT, refcnt int, lrefcnt int, 
                location string, heat int, dirty string, 
                status string, kind string) 
        external name sql.bbp;
 
-create procedure evalAlgebra( ra_stmt string, opt bool)
+create procedure sys.evalAlgebra( ra_stmt string, opt bool)
        external name sql."evalAlgebra";
diff --git a/sql/scripts/26_sysmon.sql b/sql/scripts/26_sysmon.sql
--- a/sql/scripts/26_sysmon.sql
+++ b/sql/scripts/26_sysmon.sql
@@ -30,6 +30,12 @@ returns table(
 )
 external name sql.sysmon_queue;
 
+create view sys.queue as select * from sys.queue();
+update sys._tables
+    set system = true
+    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;
diff --git a/sql/scripts/75_storagemodel.sql b/sql/scripts/75_storagemodel.sql
--- a/sql/scripts/75_storagemodel.sql
+++ b/sql/scripts/75_storagemodel.sql
@@ -32,6 +32,8 @@ create function sys.storage()
 returns table ("schema" string, "table" string, "column" string, "type" 
string, location string, "count" bigint, typewidth int, columnsize bigint, 
heapsize bigint, indices bigint, sorted boolean)
 external name sql.storage;
 
+create view sys.storage as select * from sys.storage();
+
 -- To determine the footprint of an arbitrary database, we first have
 -- to define its schema, followed by an indication of the properties of each 
column.
 -- A storage model input table for the size prediction is shown below:
@@ -145,7 +147,7 @@ begin
        I.sorted
        from sys.storagemodelinput I;
 end;
-
+create view sys.storagemodel as select * from sys.storagemodel();
 -- A summary of the table storage requirement is is available as a table view.
 -- The auxillary column denotes the maximum space if all non-sorted columns
 -- would be augmented with a hash (rare situation)
diff --git 
a/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.stable.out 
b/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.stable.out
--- a/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.stable.out
+++ b/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.stable.out
@@ -114,6 +114,8 @@ Ready.
 
 START TRANSACTION;
 SET SCHEMA "sys";
+create view sys.storage as select * from sys.storage();
+create view sys.storagemodel as select * from sys.storagemodel();
 CREATE TABLE "sys"."allnewtriples" (
        "id" INTEGER NOT NULL,
        "subject" INTEGER NOT NULL,
diff --git 
a/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--optimizers.stable.out
 
b/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--optimizers.stable.out
--- 
a/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--optimizers.stable.out
+++ 
b/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--optimizers.stable.out
@@ -24,6 +24,8 @@ Ready.
 # 12:59:51 >  mclient -lsql -umonetdb -Pmonetdb --host=rig --port=33577 
 # 12:59:51 >  
 
+VIEW  sys.storage
+VIEW  sys.storagemodel
 CREATE TABLE "sys"."triggers" (
        "id"          INTEGER,
        "name"        VARCHAR(1024),
diff --git 
a/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--performance.stable.out
 
b/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--performance.stable.out
--- 
a/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--performance.stable.out
+++ 
b/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908--performance.stable.out
@@ -24,6 +24,8 @@ Ready.
 # 20:57:34 >  mclient -lsql -ftest -i -e --host=alf --port=32448 
 # 20:57:34 >  
 
+VIEW  sys.storage
+VIEW  sys.storagemodel
 CREATE TABLE "sys"."triggers" (
        "id"          INTEGER,
        "name"        VARCHAR(1024),
diff --git 
a/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908.stable.out 
b/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908.stable.out
--- a/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908.stable.out
+++ b/sql/test/BugTracker-2009/Tests/dumping_tables.SF-2776908.stable.out
@@ -29,6 +29,8 @@ Ready.
 # 20:57:34 >  Mtimeout -timeout 60 mclient -lsql -ftest -i -e --host=alf 
--port=32448  -i < 
/net/alf.ins.cwi.nl/export/scratch1/niels/rc/MonetDB/sql/src/test/BugTracker-2009/Tests/../dumping_tables.SF-2776908.sql
 # 20:57:34 >  
 
+VIEW  sys.storage
+VIEW  sys.storagemodel
 CREATE TABLE "sys"."triggers" (
        "id"          INTEGER,
        "name"        VARCHAR(1024),
diff --git a/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out 
b/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
--- a/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
+++ b/sql/test/BugTracker-2009/Tests/mclient-lsql-D.stable.out
@@ -31,6 +31,8 @@ Ready.
 
 START TRANSACTION;
 SET SCHEMA "sys";
+create view sys.storage as select * from sys.storage();
+create view sys.storagemodel as select * from sys.storagemodel();
 CREATE TABLE "sys"."table_a" (
        "table_a_id" INTEGER       NOT NULL,
        "value_a"    INTEGER       NOT NULL,
diff --git 
a/sql/test/BugTracker-2009/Tests/name_clash_with_dump.SF-2780395.stable.out 
b/sql/test/BugTracker-2009/Tests/name_clash_with_dump.SF-2780395.stable.out
--- a/sql/test/BugTracker-2009/Tests/name_clash_with_dump.SF-2780395.stable.out
+++ b/sql/test/BugTracker-2009/Tests/name_clash_with_dump.SF-2780395.stable.out
@@ -26,6 +26,8 @@ Ready.
 
 START TRANSACTION;
 SET SCHEMA "sys";
+create view sys.storage as select * from sys.storage();
+create view sys.storagemodel as select * from sys.storagemodel();
 CREATE TABLE "sys"."tf" (
        "a" INTEGER
 );
diff --git 
a/sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.stable.out 
b/sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.stable.out
--- 
a/sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.stable.out
+++ 
b/sql/test/BugTracker-2011/Tests/interrupted-initialization.Bug-2875.stable.out
@@ -17,6 +17,9 @@ stdout of test 'interrupted-initializati
 # MonetDB/GIS module loaded
 # MonetDB/SQL module loaded
 START TRANSACTION;
+SET SCHEMA "sys";
+create view sys.storage as select * from sys.storage();
+create view sys.storagemodel as select * from sys.storagemodel();
 COMMIT;
 # MonetDB 5 server v11.5.8
 # This is an unreleased version
diff --git a/sql/test/BugTracker-2011/Tests/mclient-lsql-d.Bug-2861.stable.out 
b/sql/test/BugTracker-2011/Tests/mclient-lsql-d.Bug-2861.stable.out
--- a/sql/test/BugTracker-2011/Tests/mclient-lsql-d.Bug-2861.stable.out
+++ b/sql/test/BugTracker-2011/Tests/mclient-lsql-d.Bug-2861.stable.out
@@ -27,13 +27,15 @@ Ready.
 # 10:06:13 >  
 
 
-# 10:06:13 >  
-# 10:06:13 >  Mtimeout -timeout 60 mclient -lsql -ftest -i -e --host=volund 
--port=31159  -e -i < 
/net/volund.ins.cwi.nl/export/scratch1/fabian/monetdb/Aug2011/hgrepo/sql/test/BugTracker-2011/Tests/../mclient-lsql-d.Bug-2861.sql
-# 10:06:13 >  
-
+VIEW  sys.storage
+VIEW  sys.storagemodel
 #create table bug2861 (id int);
 TABLE       sys.bug2861
+VIEW   sys.storage
+VIEW   sys.storagemodel
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to