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

Modified Files:
        sql_session.mx 
Log Message:
fix [ 1724151 ] mixing auto-commit with explicit transactions
recognise the special multi line mode of mapiclient file.


Index: sql_session.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet4/sql_session.mx,v
retrieving revision 1.226
retrieving revision 1.227
diff -u -d -r1.226 -r1.227
--- sql_session.mx      22 May 2007 10:59:03 -0000      1.226
+++ sql_session.mx      29 May 2007 07:48:47 -0000      1.227
@@ -369,6 +369,24 @@
        while (go) {
                int pstatus = 0;
 
+               /* Different kinds of supported statements sequences
+                       A;      -- single line                  s
+                       A \n B; -- multi line                   S
+                       A; B;   -- compound single block        s
+                       A;      -- many multi line 
+                       B \n C; -- statements in one block      S
+               */
+               /* auto_commit on end of statement */
+               if (m->scanner.mode == LINE_N && m->session->auto_commit && 
m->session->active) {
+                       if (mvc_status(m) < 0) {
+                               mvc_rollback(m, 0, NULL);
+                       } else if (mvc_commit(m, 0, NULL) < 0) {
+                               go = handle_error(m, out, pstatus);
+                               if (!go)
+                                       break;
+                       }
+               }
+
                if (in->pos >= in->len) {
                        ssize_t rd;
 
@@ -377,7 +395,7 @@
                        if (in->eof) {
                                language = (sql->console) ? 'S' : 0;
 
-                               /* auto_commit on end of statement */
+                               /* auto_commit on end of statement (s A;B; 
case)*/
                                if (m->session->auto_commit && 
m->session->active) {
                                        if (mvc_status(m) < 0) {
                                                mvc_rollback(m, 0, NULL);
@@ -435,6 +453,9 @@
                if (language == 'X') {
                        int n, v, off, len;
 
+                       if (m->scanner.log) 
+                               stream_write(m->scanner.log, in->buf+in->pos, 
in->len - in->pos, 1);
+
                        n = sscanf(in->buf + in->pos, "export %d %d %d", &v, 
&off, &len);
 
                        if (n == 2 || n == 3) {


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to