Changeset: 45d29531e420 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=45d29531e420
Modified Files:
        sql/src/server/sql_psm.c
Branch: default
Log Message:

Merged from Oct2010


diffs (242 lines):

diff -r bc43c7fcc7b1 -r 45d29531e420 sql/src/backends/monet5/sql_gencode.mx
--- a/sql/src/backends/monet5/sql_gencode.mx    Wed Nov 10 14:01:20 2010 +0100
+++ b/sql/src/backends/monet5/sql_gencode.mx    Wed Nov 10 14:10:53 2010 +0100
@@ -2318,19 +2318,22 @@
        Symbol backup = NULL;
        stmt *s;
        int i, retseen =0, sideeffects =0;
-       sql_allocator *sa = sa_create();        /* NIELS: leaks, will be 
resolved once we keep rel,sa,mb (for recompiles) */
+       sql_allocator *sa, *osa = m->sa;
 
        /* nothing to do for internal and ready (not recompiling) functions */
        if (!f->sql || f->sql > 1)
                return;
        f->sql++;
+       sa = sa_create();
        s = sql_parse(m, sa, f->imp, m_instantiate);
        if (!s) {
                fputs(m->errstr, stderr);
+               sa_destroy(sa);
                return;
        } else {
                stmt *opt;
 
+               m->sa = sa;
                opt = rel2bin(m, s);
                stmt_destroy(s);
                s = bin_optimizer(m, opt);
@@ -2400,6 +2403,11 @@
        /* SQL function definitions meant for inlineing should not be optimized 
before */
        varSetProp(curBlk, getArg(curInstr, 0), sqlfunctionProp, op_eq, NULL);
        stmt_destroy(s);
+       /* Because types (tables) are allocated using the sql-allocator, we
+          cannot destroy it here "LEAKS" 
+       sa_destroy(sa); 
+       */
+       m->sa = osa;
        addQueryToCache(c);
        if (backup) 
                c->curprg = backup;
diff -r bc43c7fcc7b1 -r 45d29531e420 sql/src/server/sql_psm.c
--- a/sql/src/server/sql_psm.c  Wed Nov 10 14:01:20 2010 +0100
+++ b/sql/src/server/sql_psm.c  Wed Nov 10 14:10:53 2010 +0100
@@ -517,6 +517,9 @@
        int create = (!instantiate && !deps);
        char *F = is_aggr?"AGGREGATE":(is_func?"FUNCTION":"PROCEDURE");
 
+       if (STORE_READONLY(active_store_type) && create) 
+               return sql_error(sql, 06, "schema statements cannot be executed 
on a readonly database.");
+                       
        if (sname && !(s = mvc_bind_schema(sql, sname)))
                return sql_error(sql, 02, "CREATE %s: no such schema '%s'", F, 
sname);
        if (s == NULL)
@@ -779,9 +782,6 @@
                int is_func = (s->token == SQL_CREATE_FUNC);
                int is_aggr = (s->token == SQL_CREATE_AGGR);
 
-               if (STORE_READONLY(active_store_type)) 
-                       return sql_error(sql, 06, "schema statements cannot be 
executed on a readonly database.");
-                       
                ret = create_func(sql, l->h->data.lval, l->h->next->data.lval, 
l->h->next->next->data.sym, l->h->next->next->next->data.lval, 
l->h->next->next->next->next->data.lval, is_func, is_aggr);
                sql->type = Q_SCHEMA;
        }       break;
diff -r bc43c7fcc7b1 -r 45d29531e420 sql/src/test/BugTracker-2010/Tests/All
--- a/sql/src/test/BugTracker-2010/Tests/All    Wed Nov 10 14:01:20 2010 +0100
+++ b/sql/src/test/BugTracker-2010/Tests/All    Wed Nov 10 14:10:53 2010 +0100
@@ -71,3 +71,4 @@
 distinct-order-by-limit.Bug-2691
 join_problem.Bug-2694
 TypeException_with_missing_function.Bug-2674
+join-and-like.Bug-2715
diff -r bc43c7fcc7b1 -r 45d29531e420 
sql/src/test/BugTracker-2010/Tests/join-and-like.Bug-2715.sql
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/BugTracker-2010/Tests/join-and-like.Bug-2715.sql     Wed Nov 
10 14:10:53 2010 +0100
@@ -0,0 +1,21 @@
+START TRANSACTION;
+
+CREATE TABLE table2715a(id INT, a1 string, a2 string);
+INSERT INTO table2715a VALUES (1,'kind','a1');
+INSERT INTO table2715a VALUES (2,'kind','b4');
+INSERT INTO table2715a VALUES (1,'family','xx');
+INSERT INTO table2715a VALUES (2,'family','yy');
+INSERT INTO table2715a VALUES (1,'country','EP');
+INSERT INTO table2715a VALUES (2,'country','US');
+
+
+CREATE TABLE table2715b(b1 string, b2 string);
+INSERT INTO table2715b VALUES ('country', 'EP');
+
+
+SELECT *
+FROM   table2715a,table2715b
+WHERE  table2715a.a1 = table2715b.b1
+AND    table2715a.a2 LIKE table2715b.b2;
+
+ROLLBACK;
diff -r bc43c7fcc7b1 -r 45d29531e420 
sql/src/test/BugTracker-2010/Tests/join-and-like.Bug-2715.stable.err
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/BugTracker-2010/Tests/join-and-like.Bug-2715.stable.err      
Wed Nov 10 14:10:53 2010 +0100
@@ -0,0 +1,79 @@
+stderr of test 'join-and-like.Bug-2715` in directory 
'src/test/BugTracker-2010` itself:
+
+
+# 12:53:10 >  
+# 12:53:10 >   mserver5 
"--config=/ufs/sjoerd/Monet-candidate/etc/monetdb5.conf" --debug=10 --set 
gdk_nr_threads=0 --set 
"monet_mod_path=/ufs/sjoerd/Monet-candidate/lib64/MonetDB5:/ufs/sjoerd/Monet-candidate/lib64/MonetDB5/lib:/ufs/sjoerd/Monet-candidate/lib64/MonetDB5/bin"
 --set "gdk_dbfarm=/ufs/sjoerd/Monet-candidate/var/MonetDB5/dbfarm"  --set 
mapi_open=true --set xrpc_open=true --set mapi_port=34294 --set xrpc_port=42466 
--set monet_prompt= --trace --forcemito --set mal_listing=2  
"--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo 
Over..
+# 12:53:10 >  
+
+# builtin opt  gdk_arch = 64bitx86_64-unknown-linux-gnu
+# builtin opt  gdk_version = 1.40.1
+# builtin opt  prefix = /ufs/sjoerd/Monet-candidate
+# builtin opt  exec_prefix = ${prefix}
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_alloc_map = no
+# builtin opt  gdk_vmtrim = yes
+# builtin opt  monet_admin = adm
+# builtin opt  monet_prompt = >
+# builtin opt  monet_welcome = yes
+# builtin opt  monet_mod_path = ${exec_prefix}/lib64/MonetDB
+# builtin opt  monet_daemon = no
+# builtin opt  host = localhost
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_clients = 2
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  default_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# builtin opt  minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# builtin opt  standoff_ns = 
+# builtin opt  standoff_start = start
+# builtin opt  standoff_end = end
+# config opt   prefix = /ufs/sjoerd/Monet-candidate
+# config opt   config = ${prefix}/etc/monetdb5.conf
+# config opt   prefix = /ufs/sjoerd/Monet-candidate
+# config opt   exec_prefix = ${prefix}
+# config opt   gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm
+# config opt   monet_mod_path = 
${exec_prefix}/lib64/MonetDB5:${exec_prefix}/lib64/MonetDB5/lib:${exec_prefix}/lib64/MonetDB5/bin
+# config opt   mero_pidfile = ${prefix}/var/run/MonetDB/merovingian.pid
+# config opt   mero_controlport = 50001
+# config opt   no_mitosis_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   sequential_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,history,multiplex,garbageCollector
+# config opt   nov2009_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   replication_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector
+# config opt   accumulator_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,accumulators,dataflow,history,multiplex,garbageCollector
+# config opt   recycler_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,deadcode,recycle,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   cracker_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,selcrack,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   sidcrack_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,sidcrack,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   datacell_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,datacell,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   octopus_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,constants,commonTerms,joinPath,octopus,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   datacyclotron_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,datacyclotron,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector
+# config opt   derive_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,derivePath,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   dictionary_pipe = 
inline,remap,dictionary,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   compression_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,compression,dataflow,history,multiplex,garbageCollector
+# cmdline opt  config = /ufs/sjoerd/Monet-candidate/etc/monetdb5.conf
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  monet_mod_path = 
/ufs/sjoerd/Monet-candidate/lib64/MonetDB5:/ufs/sjoerd/Monet-candidate/lib64/MonetDB5/lib:/ufs/sjoerd/Monet-candidate/lib64/MonetDB5/bin
+# cmdline opt  gdk_dbfarm = /ufs/sjoerd/Monet-candidate/var/MonetDB5/dbfarm
+# cmdline opt  mapi_open = true
+# cmdline opt  xrpc_open = true
+# cmdline opt  mapi_port = 34294
+# cmdline opt  xrpc_port = 42466
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_src_test_BugTracker-2010
+# cmdline opt  mal_listing = 0
+#warning: please don't forget to set your vault key!
+#(see /ufs/sjoerd/Monet-candidate/etc/monetdb5.conf)
+
+# 12:53:10 >  
+# 12:53:10 >  mclient -lsql -ftest -i -e --host=ottar --port=34294 
+# 12:53:10 >  
+
+
+# 12:53:11 >  
+# 12:53:11 >  Done.
+# 12:53:11 >  
+
diff -r bc43c7fcc7b1 -r 45d29531e420 
sql/src/test/BugTracker-2010/Tests/join-and-like.Bug-2715.stable.out
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sql/src/test/BugTracker-2010/Tests/join-and-like.Bug-2715.stable.out      
Wed Nov 10 14:10:53 2010 +0100
@@ -0,0 +1,60 @@
+stdout of test 'join-and-like.Bug-2715` in directory 
'src/test/BugTracker-2010` itself:
+
+
+# 12:53:10 >  
+# 12:53:10 >   mserver5 
"--config=/ufs/sjoerd/Monet-candidate/etc/monetdb5.conf" --debug=10 --set 
gdk_nr_threads=0 --set 
"monet_mod_path=/ufs/sjoerd/Monet-candidate/lib64/MonetDB5:/ufs/sjoerd/Monet-candidate/lib64/MonetDB5/lib:/ufs/sjoerd/Monet-candidate/lib64/MonetDB5/bin"
 --set "gdk_dbfarm=/ufs/sjoerd/Monet-candidate/var/MonetDB5/dbfarm"  --set 
mapi_open=true --set xrpc_open=true --set mapi_port=34294 --set xrpc_port=42466 
--set monet_prompt= --trace --forcemito --set mal_listing=2  
"--dbname=mTests_src_test_BugTracker-2010" --set mal_listing=0 ; echo ; echo 
Over..
+# 12:53:10 >  
+
+# MonetDB server v5.22.1, based on kernel v1.40.1
+# Not released
+# Serving database 'mTests_src_test_BugTracker-2010', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 7.750 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2010 MonetDB B.V., all rights reserved
+# Visit http://monetdb.cwi.nl/ for further information
+# Listening for connection requests on mapi:monetdb://ottar.ins.cwi.nl:34294/
+# MonetDB/SQL module v2.40.1 loaded
+# MonetDB/GIS module v0.20.1 loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+
+Over..
+
+# 12:53:10 >  
+# 12:53:10 >  mclient -lsql -ftest -i -e --host=ottar --port=34294 
+# 12:53:10 >  
+
+#START TRANSACTION;
+#CREATE TABLE table2715a(id INT, a1 string, a2 string);
+#INSERT INTO table2715a VALUES (1,'kind','a1');
+[ 1    ]
+#INSERT INTO table2715a VALUES (2,'kind','b4');
+[ 1    ]
+#INSERT INTO table2715a VALUES (1,'family','xx');
+[ 1    ]
+#INSERT INTO table2715a VALUES (2,'family','yy');
+[ 1    ]
+#INSERT INTO table2715a VALUES (1,'country','EP');
+[ 1    ]
+#INSERT INTO table2715a VALUES (2,'country','US');
+[ 1    ]
+#CREATE TABLE table2715b(b1 string, b2 string);
+#INSERT INTO table2715b VALUES ('country', 'EP');
+[ 1    ]
+#SELECT *
+#FROM   table2715a,table2715b
+#WHERE  table2715a.a1 = table2715b.b1
+#AND    table2715a.a2 LIKE table2715b.b2;
+% sys.table2715a,      sys.table2715a, sys.table2715a, sys.table2715b, 
sys.table2715b # table_name
+% id,  a1,     a2,     b1,     b2 # name
+% int, clob,   clob,   clob,   clob # type
+% 1,   7,      2,      7,      2 # length
+[ 1,   "country",      "EP",   "country",      "EP"    ]
+#ROLLBACK;
+
+# 12:53:11 >  
+# 12:53:11 >  Done.
+# 12:53:11 >  
+
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to