Changeset: deea9c02ebbf for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=deea9c02ebbf Modified Files: sql/src/server/rel_schema.mx sql/src/test/BugTracker/Tests/caching.SF-1651599.stable.out Branch: default Log Message:
commit the merge...???? diffs (288 lines): diff -r 5788dc04c670 -r deea9c02ebbf MonetDB/HowToStart.rst --- a/MonetDB/HowToStart.rst Mon May 10 11:35:19 2010 +0200 +++ b/MonetDB/HowToStart.rst Mon May 10 12:30:52 2010 +0200 @@ -404,13 +404,17 @@ The disadvantage of running the systems interactively is that you don't get readline support (if available on your system). A more pleasant environment can be had by using the system as a server and -using ``mclient`` to interact with the system. For MonetDB4 use:: +using ``mclient`` to interact with the system. + +When MonetDB5 is started as above, it automatically starts the MAL +server in addition to the interactive "console". In case the +MonetDB/SQL package is also installed, MonetDB5 does automatically +load it and start the SQL server. + +In case of MonetDB4, to start only the MIL server use:: Mserver --dbinit 'module(mapi); mil_start();' -When MonetDB5 is started as above, it automatically starts the server -in addition to the interactive "console". - In order to use the XQuery back-end, which is only available with MonetDB4, start the server as follows:: @@ -421,18 +425,6 @@ Mserver --dbinit 'module(pathfinder); mil_start();' -In order to use the SQL back-end with MonetDB4, use:: - - Mserver --dbinit 'module(sql_server);' - -If you want to have a MIL server in addition to the SQL server, use:: - - Mserver --dbinit 'module(sql_server); mil_start();' - -In order to use the SQL back-end with MonetDB5, use:: - - mserver5 --dbinit 'include sql;' - Once the server is running, you can use ``mclient`` to interact with the server. ``mclient`` needs to be told which language you want to use, but it does not need to be told whether you're using diff -r 5788dc04c670 -r deea9c02ebbf MonetDB5/src/mal/mal_interpreter.mx --- a/MonetDB5/src/mal/mal_interpreter.mx Mon May 10 11:35:19 2010 +0200 +++ b/MonetDB5/src/mal/mal_interpreter.mx Mon May 10 12:30:52 2010 +0200 @@ -80,7 +80,7 @@ int stoppc, MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller); static void displayVolume(Client cntxt, lng vol); -#define MEMORY_THRESHOLD 0.9 +#define MEMORY_THRESHOLD 0.8 #define MAXHOT 16 static lng memorypool; /* memory claimed by concurrent threads */ diff -r 5788dc04c670 -r deea9c02ebbf MonetDB5/src/mal/mal_linker.mx --- a/MonetDB5/src/mal/mal_linker.mx Mon May 10 11:35:19 2010 +0200 +++ b/MonetDB5/src/mal/mal_linker.mx Mon May 10 12:30:52 2010 +0200 @@ -48,6 +48,7 @@ #include "mal_module.h" #define MAL_EXT ".mal" +#define SQL_EXT ".sql" #ifdef HAVE_DLFCN_H #include <dlfcn.h> @@ -378,7 +379,11 @@ char * MSP_locate_script(const char *filename) { - return locate_file(filename, MAL_EXT); + char *f; + f= locate_file(filename, MAL_EXT); + if ( f == NULL) + f= locate_file(filename, SQL_EXT); + return f; } char * diff -r 5788dc04c670 -r deea9c02ebbf MonetDB5/src/optimizer/opt_joinpath.mx --- a/MonetDB5/src/optimizer/opt_joinpath.mx Mon May 10 11:35:19 2010 +0200 +++ b/MonetDB5/src/optimizer/opt_joinpath.mx Mon May 10 12:30:52 2010 +0200 @@ -102,18 +102,15 @@ pattern algebra.joinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath -comment "internal routine to handle join paths. - The type analysis is rather tricky."; +comment "Routine to handle join paths. The type analysis is rather tricky."; pattern algebra.leftjoinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath -comment "internal routine to handle join paths. - The type analysis is rather tricky."; +comment "Routine to handle join paths. The type analysis is rather tricky."; pattern algebra.semijoinPath(l:bat[:any,:any]...):bat[:any,:any] address ALGjoinPath -comment "internal routine to handle join paths. - The type analysis is rather tricky."; +comment "Routine to handle join paths. The type analysis is rather tricky."; @h #ifndef _OPT_JOINPATH_ #define _OPT_JOINPATH_ @@ -577,11 +574,16 @@ may fire a BATproperty check in a few cases. In case a join fails, we may try another order first before abandoning the task. + +A left-join sequence only requires the result to be sorted +against the first operand. For all others operand pairs, the cheapest join suffice. @c switch(flag){ case 0: - b = BATleftjoin(joins[j], joins[j + 1], BATcount(joins[j])); - break; + if ( j == 0) { + b = BATleftjoin(joins[j], joins[j + 1], BATcount(joins[j])); + break; + } case 1: b = BATjoin(joins[j], joins[j + 1], (BATcount(joins[j]) < BATcount(joins[j + 1])? BATcount(joins[j]):BATcount(joins[ j + 1]))); break; diff -r 5788dc04c670 -r deea9c02ebbf sql/NT/MSQLserver.bat --- a/sql/NT/MSQLserver.bat Mon May 10 11:35:19 2010 +0200 +++ b/sql/NT/MSQLserver.bat Mon May 10 12:30:52 2010 +0200 @@ -10,6 +10,6 @@ rem start the real server -"%MONETDB%\M5server.bat" --dbinit="include sql;" %* +"%MONETDB%\M5server.bat" %* endlocal diff -r 5788dc04c670 -r deea9c02ebbf sql/src/backends/monet5/embeddedclient.c.in --- a/sql/src/backends/monet5/embeddedclient.c.in Mon May 10 11:35:19 2010 +0200 +++ b/sql/src/backends/monet5/embeddedclient.c.in Mon May 10 12:30:52 2010 +0200 @@ -101,7 +101,6 @@ out = ((stream **) arg)[1]; free(arg); snprintf(buf, sizeof(buf), - "include sql;\n" "in := \"" PTRFMT "\":streams;\n" "out := \"" PTRFMT "\":streams;\n" "mapi.malclient(in, out);\n", PTRFMTCAST in, PTRFMTCAST out); diff -r 5788dc04c670 -r deea9c02ebbf sql/src/backends/monet5/merovingian/merovingian_forkmserver.c --- a/sql/src/backends/monet5/merovingian/merovingian_forkmserver.c Mon May 10 11:35:19 2010 +0200 +++ b/sql/src/backends/monet5/merovingian/merovingian_forkmserver.c Mon May 10 12:30:52 2010 +0200 @@ -226,7 +226,7 @@ str master = NULL; str slave = NULL; str pipeline = NULL; - str argv[27]; /* for the exec arguments */ + str argv[26]; /* for the exec arguments */ confkeyval *ckv, *kv; int c = 0; @@ -292,7 +292,6 @@ argv[c++] = _mero_mserver; argv[c++] = conffile; argv[c++] = dbname; - argv[c++] = "--dbinit=include sql;"; /* yep, no quotes needed! */ argv[c++] = "--set"; argv[c++] = muri; if (mydoproxy == 1) { argv[c++] = "--set"; argv[c++] = "mapi_open=false"; diff -r 5788dc04c670 -r deea9c02ebbf sql/src/server/rel_schema.mx --- a/sql/src/server/rel_schema.mx Mon May 10 11:35:19 2010 +0200 +++ b/sql/src/server/rel_schema.mx Mon May 10 12:30:52 2010 +0200 @@ -130,6 +130,9 @@ { sql_rel *r = sq; + if (!r) + return NULL; + if (is_topn(r->op)) r = sq->l; diff -r 5788dc04c670 -r deea9c02ebbf sql/src/test/BugTracker/Tests/caching.SF-1651599.stable.out --- a/sql/src/test/BugTracker/Tests/caching.SF-1651599.stable.out Mon May 10 11:35:19 2010 +0200 +++ b/sql/src/test/BugTracker/Tests/caching.SF-1651599.stable.out Mon May 10 12:30:52 2010 +0200 @@ -2355,7 +2355,7 @@ % query, count # name % clob, int # type % 132, 3 # length -[ "select * from query_cache() cache;", 1 ] +[ "select * from querycache() cache;", 1 ] [ "insert into foo (foo1,foo2,foo3,foo4,foo5,foo6,foo7) select 3769.6344,4831.4100,127.4831,6344.4831,4100.127,9773.3297,3297.9773;", 1 ] [ "insert into foo (foo1,foo2,foo3,foo4,foo5,foo6,foo7) select 18.770,4097.692,5233.4097,770.4097,692.5233,2938.1311,1311.2938;", 1 ] [ "insert into foo (foo1,foo2,foo3,foo4,foo5,foo6,foo7) select 3813.416,4163.2094,6180.4163,416.4163,2094.6180,106.86,86.106;", 1 ] diff -r 5788dc04c670 -r deea9c02ebbf sql/src/test/Connections/run.all --- a/sql/src/test/Connections/run.all Mon May 10 11:35:19 2010 +0200 +++ b/sql/src/test/Connections/run.all Mon May 10 12:30:52 2010 +0200 @@ -28,8 +28,8 @@ #Generate Data... #Bulk-Load into SQL server... -mserver5 --dbname=demo --set mapi_port=50000 --dbinit="include sql;" --daemon=yes & -mserver5 --dbname=demo2 --set mapi_port=40000 --dbinit="include sql;" --daemon=yes & +mserver5 --dbname=demo --set mapi_port=50000 --daemon=yes & +mserver5 --dbname=demo2 --set mapi_port=40000 --daemon=yes & sleep 5 echo syntax diff -r 5788dc04c670 -r deea9c02ebbf sql/src/test/Update_Delete_action/run.all --- a/sql/src/test/Update_Delete_action/run.all Mon May 10 11:35:19 2010 +0200 +++ b/sql/src/test/Update_Delete_action/run.all Mon May 10 12:30:52 2010 +0200 @@ -20,7 +20,7 @@ PWD=`pwd` echo $PWD SQL='mclient -p$MAPIPORT -lsql -umonetdb -Pmonetdb' -M5='mserver5 --dbname=demo --set mapi_port=$MAPIPORT --dbinit="include sql;"' +M5='mserver5 --dbname=demo --set mapi_port=$MAPIPORT' if [ $# -eq 1 ]; then SQL=$1 fi diff -r 5788dc04c670 -r deea9c02ebbf testing/README --- a/testing/README Mon May 10 11:35:19 2010 +0200 +++ b/testing/README Mon May 10 12:30:52 2010 +0200 @@ -140,7 +140,7 @@ mclient -lsql < TST[_(s|p)XX].sql or TST.SQL.(sh|exe|com|bat|cmd) TST or python TST.SQL.py - * mserver5 --dbname=TSTDB --set mapi_port=$MAPIPORT --set xrpc_port=$XRPCPORT --dbinit="[<TST.dbinit5] include sql;" [TST.prologue5] & + * mserver5 --dbname=TSTDB --set mapi_port=$MAPIPORT --set xrpc_port=$XRPCPORT --dbinit="[<TST.dbinit5]" [TST.prologue5] & mclient -lsql < TST[_(s|p)XX].sql or TST.SQL.(sh|exe|com|bat|cmd) TST or python TST..SQL.py diff -r 5788dc04c670 -r deea9c02ebbf testing/src/Mtest.py.in --- a/testing/src/Mtest.py.in Mon May 10 11:35:19 2010 +0200 +++ b/testing/src/Mtest.py.in Mon May 10 12:30:52 2010 +0200 @@ -2324,7 +2324,9 @@ if SERVER == "SQL": lang="sql" if par['M5']: - Srvr = '%s --set mal_listing=0 "--dbinit=%s include sql;"' % (Srvr, DBINIT) + Srvr = '%s --set mal_listing=0' % Srvr + if DBINIT: + Srvr = '%s "--dbinit=%s"' % (Srvr, DBINIT) if par['M4']: Srvr = '%s "--dbinit=%s module(sql_server);"' % (Srvr, DBINIT) if SERVER == "XQUERY": @@ -3660,14 +3662,11 @@ MissingMods = CheckMods(env, '', 'SQL', '') if MissingMods: ErrXit('Stopping SQL testing as modules "%s" are missing!' % str(MissingMods)) - if par['M5']: - mod_name = 'sql' - mod_load = 'include %s;' % mod_name if par['M4']: mod_name = 'sql_server' mod_load = 'module(%s);' % mod_name - if Check('%s --dbname=%s "--dbinit=%s"' % (env['exe']['Mserver'][1], TSTPREF, mod_load), QUIT): - ErrXit('Stopping SQL testing as module "%s" fails to load!' % mod_name) + if Check('%s --dbname=%s "--dbinit=%s"' % (env['exe']['Mserver'][1], TSTPREF, mod_load), QUIT): + ErrXit('Stopping SQL testing as module "%s" fails to load!' % mod_name) is_pf = par['PACKAGE'] == 'monetdb-xquery' if not is_pf: diff -r 5788dc04c670 -r deea9c02ebbf testing/src/process.py --- a/testing/src/process.py Mon May 10 11:35:19 2010 +0200 +++ b/testing/src/process.py Mon May 10 12:30:52 2010 +0200 @@ -135,9 +135,7 @@ '--set', 'xrpc_open=true', '--set', 'monet_prompt=', '--trace']) if dbinit is None: - if lang == 'sql': - dbinit = 'include sql;' - elif lang == 'xquery': + if lang == 'xquery': dbinit = 'module(pathfinder);' if dbinit is not None: cmd.append('--dbinit') diff -r 5788dc04c670 -r deea9c02ebbf testing/src/quicktest --- a/testing/src/quicktest Mon May 10 11:35:19 2010 +0200 +++ b/testing/src/quicktest Mon May 10 12:30:52 2010 +0200 @@ -224,10 +224,6 @@ --set mapi_port=${port} --set monet_daemon=yes ) - [[ ${lang} == sql ]] && args=( - ${ar...@]} - --dbinit="include sql;" - ) echo "#" "${ar...@]}" > "${p}"/stdout echo "#" "${ar...@]}" > "${p}"/stderr "${ar...@]}" \ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list