Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6798/src/backends/monet5

Modified Files:
        sql.mx sql_gencode.mx 
Log Message:
propagated changes of Sunday Feb 11 2007 - Tuesday Feb 20 2007
from the SQL_2-16 branch to the development trunk


Index: sql_gencode.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql_gencode.mx,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -d -r1.232 -r1.233
--- sql_gencode.mx      4 Feb 2007 22:55:17 -0000       1.232
+++ sql_gencode.mx      20 Feb 2007 11:50:46 -0000      1.233
@@ -317,7 +317,7 @@
                match = 1;
        if( (match && type <= TYPE_str) || match==2){
                q = newStmt1(mb, batcalcRef, name);
-               setVarType(mb,getArg(q,0), newBatType(TYPE_any,rtype));
+               /*setVarType(mb,getArg(q,0), newBatType(TYPE_any,rtype));*/
                freezeVarType(mb,getArg(q,0));
                q = pushArgument(mb, q, o1);
                q = pushArgument(mb, q, o2);

Index: sql.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/sql.mx,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -d -r1.209 -r1.210
--- sql.mx      1 Feb 2007 22:07:41 -0000       1.209
+++ sql.mx      20 Feb 2007 11:50:45 -0000      1.210
@@ -93,6 +93,10 @@
 address mvc_next_value
 comment "return the next value of the sequence";
 
+command get_value( sequence:str ):lng
+address mvc_get_value
+comment "return the current value of the sequence";
+
 command restart( sequence:str, start:lng ):lng
 address mvc_restart_seq
 comment "restart the sequence with value start";
@@ -583,6 +587,7 @@
 sql5_export str getVariable(MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 sql5_export str sql_variables(int *res);
 sql5_export str mvc_next_value(lng *res, str *seqname);
+sql5_export str mvc_get_value(lng *res, str *seqname);
 sql5_export str mvc_restart_seq(lng *res, str *seqname, lng *start);
 sql5_export str mvc_affected_rows_int(int *r, int *nr, str *w);
 sql5_export str zero_or_one(ptr ret, int *bid);
@@ -951,6 +956,25 @@
 }
 
 str
+mvc_get_value(lng *res, str *seqname)
+{
+       mvc *m = NULL;
+       str msg = getContext(&m, NULL);
+       sql_schema *s;
+
+       if (msg)
+               return msg;
+       s = m->session->schema;
+       if (s) {
+               sql_sequence *seq = find_sql_sequence(s, *seqname);
+
+               if (seq && seq_get_value(seq, res))
+                       return MAL_SUCCEED;
+       }
+       throw(SQL, "sql.get_value", "error");
+}
+
+str
 mvc_restart_seq(lng *res, str *seqname, lng *start)
 {
        mvc *m = NULL;


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to