Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31196
Modified Files:
sql.mx sql_gencode.mx sql_optimizer.mx
Log Message:
Include the transaction mode into the query plan to be used in
the octopus for abandoning the code production.
U sql_gencode.mx
Index: sql_gencode.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
retrieving revision 1.322
retrieving revision 1.323
diff -u -d -r1.322 -r1.323
--- sql_gencode.mx 2 Jun 2009 18:17:47 -0000 1.322
+++ sql_gencode.mx 7 Jun 2009 11:58:41 -0000 1.323
@@ -1869,6 +1869,9 @@
mvc *c = be->mvc;
InstrPtr q;
+ /* announce the transaction mode */
+ if ( c->session->auto_commit)
+ newFcnCall(mb,"sql","autoCommit");
(void)_dumpstmt(be, mb, s);
if (c->cache && (c->type == Q_SCHEMA || c->type == Q_TRANS)) {
q = newStmt2(mb, sqlRef, exportOperationRef);
@@ -2136,6 +2139,9 @@
setVarUDFtype(curBlk,varid);
}
}
+ /* announce the transaction mode */
+ if ( m->session->auto_commit)
+ newFcnCall(curBlk,"sql","autoCommit");
backend_dumpstmt(be, curBlk, s);
stmt_destroy(s);
addQueryToCache(c);
U sql_optimizer.mx
Index: sql_optimizer.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_optimizer.mx,v
retrieving revision 1.224
retrieving revision 1.225
diff -u -d -r1.224 -r1.225
--- sql_optimizer.mx 5 Jun 2009 08:20:45 -0000 1.224
+++ sql_optimizer.mx 7 Jun 2009 11:58:41 -0000 1.225
@@ -475,7 +475,7 @@
error++;
}
#endif
- if (mitosis == TRUE && mergetable == FALSE) {
+ if (optimizers[0] && mitosis == TRUE && mergetable == FALSE) {
showException(SQL,"optimizer"," 'mitosis' needs
'mergetable'\n");
error++;
}
@@ -484,7 +484,7 @@
showException(SQL,"optimizer"," 'multiplex' should be the
last\n");
error++;
}
- if (deadcode == FALSE ){
+ if (optimizers[0] && deadcode == FALSE ){
showException(SQL,"optimizer"," 'deadcode' should be used at
least once\n");
error++;
}
U sql.mx
Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.342
retrieving revision 1.343
diff -u -d -r1.342 -r1.343
--- sql.mx 5 Jun 2009 21:12:45 -0000 1.342
+++ sql.mx 7 Jun 2009 11:58:40 -0000 1.343
@@ -68,16 +68,6 @@
pattern assert{unsafe}(b:lng,msg:str):void
address SQLassertLng
comment "Generate an exception when b!=0";
-...@-
-...@{
-command startQuery(s:str):void
-address SQLstartQuery
-comment "Initialize tracing query performance";
-
-command exitQuery(s:str):void
-address SQLexitQuery
-comment "Finalize tracing query performance";
-...@}
@- The SQL multi-version catalog
This module also contains the definitions for managing an SQL database schema
in
version 5. It is an adaptation of the original V4.3 code base.
@@ -190,7 +180,6 @@
@-
The Monet 5 code generator uses several SQL specific wrapper functions.
-They are not present in V4
@mal
pattern resultSet{unsafe}( nr_cols:int, sep:str, rsep:str, ssep:str, ns:str,
order:any_1 ) :int
address mvc_result_file_wrap
@@ -283,9 +272,9 @@
command not_uniques( b:bat[:oid,:wrd]) :bat[:oid,:oid]
address not_unique_oids ;
-pattern sql.emptyset()
-address SQLemptyset
-comment "Symbolic evaluation of empty BAT expressions";
+pattern autoCommit{unsafe}()
+address SQLautoCommitFlag
+comment "Identifies autocommit transaction policy applies";
function times(elaps:int,inblock:lng, oublock:lng):void;
io.printf("#times %d ms",elaps);
@@ -914,6 +903,7 @@
sql5_export str SQLcommit(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
sql5_export str SQLrollback(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
+sql5_export str SQLautoCommitFlag(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
sql5_export str mvc_append_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
sql5_export str mvc_update_wrap(Client cntxt, MalBlkPtr mb, MalStkPtr stk,
InstrPtr pci);
@@ -1293,6 +1283,17 @@
return MAL_SUCCEED;
}
+str
+SQLautoCommitFlag(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+ /* just a marker for the optimizers */
+ (void) cntxt;
+ (void) mb;
+ (void) stk;
+ (void) pci;
+ return MAL_SUCCEED;
+}
+
/* setVariable(int *ret, str *name, any value) */
str
setVariable(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins