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

Modified Files:
        sql_server.mx sql_session.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_session.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_session.mx,v
retrieving revision 1.221
retrieving revision 1.222
diff -u -d -r1.221 -r1.222
--- sql_session.mx      2 Feb 2007 19:49:55 -0000       1.221
+++ sql_session.mx      20 Feb 2007 11:50:45 -0000      1.222
@@ -373,7 +373,7 @@
 
                        assert(in->pos == in->len);
 
-                       if (in->eof || !isa_block_stream(in->s)) {
+                       if (in->eof) {
                                language = (sql->console) ? 'S' : 0;
 
                                /* auto_commit on end of statement */
@@ -387,7 +387,7 @@
                                        }
                                }
 
-                               if ( (!isa_block_stream(in->s) && 
stream_write(out, PROMPT1, sizeof(PROMPT1) - 1, 1) != 1) || stream_flush(out)) {
+                               if (stream_flush(out)) {
                                        go = FALSE;
                                        break;
                                }
@@ -914,7 +914,7 @@
        char *schema;
        Variable v;
 
-       rs = bstream_create(fc->c->fdin, fc->c->blocked ? (128 * BLOCK) : 0);
+       rs = bstream_create(fc->c->fdin, 128 * BLOCK);
        mvc_reset(m, rs, fc->c->fdout, SQLdebug, 10);
        schema = mvc_login(m, fc->c->user, fc->c->passwd);
        if (!schema) {

Index: sql_server.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_server.mx,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -d -r1.157 -r1.158
--- sql_server.mx       3 Jan 2007 12:39:25 -0000       1.157
+++ sql_server.mx       20 Feb 2007 11:50:45 -0000      1.158
@@ -77,6 +77,9 @@
        .COMMAND mvc_next_value( mvc m, str sequence ) : lng = mvc_next_value;
                "return the next value of the sequence"
 
+       .COMMAND mvc_get_value( mvc m, str sequence ) : lng = mvc_get_value;
+               "return the current value of the sequence"
+
        .COMMAND mvc_restart_seq( mvc m, str sequence, lng start ) : lng = 
mvc_restart_seq;
                "restart the sequence with value start"
 @-
@@ -425,6 +428,20 @@
        }
        return GDK_FAIL;
 }
+int
+mvc_get_value(lng *res, mvc *C, str seqname)
+{
+       mvc *c = *(mvc**)C;
+       sql_schema *s = c->session->schema;
+
+       if (s) {
+               sql_sequence *seq = find_sql_sequence(s, seqname);
+
+               if (seq && seq_get_value(seq, res))
+                       return GDK_SUCCEED;
+       }
+       return GDK_FAIL;
+}
 
 int
 mvc_restart_seq(lng *res, mvc *C, str seqname, lng *start)
@@ -1367,6 +1384,9 @@
 proc next_value( str v ) : lng {
        return mvc_next_value(myc, v);
 }
+proc get_value( str v ) : lng {
+       return mvc_get_value(myc, v);
+}
 proc restart( str seq, lng v ) : lng {
        return mvc_restart_seq(myc, seq, v);
 }


-------------------------------------------------------------------------
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