Changeset: 32900f6cf506 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32900f6cf506
Modified Files:
        sql/backends/monet5/sql_scenario.mx
Branch: Apr2011
Log Message:

redirect error from create scripts back to the first client
fixed bug 2813


diffs (48 lines):

diff --git a/sql/backends/monet5/sql_scenario.mx 
b/sql/backends/monet5/sql_scenario.mx
--- a/sql/backends/monet5/sql_scenario.mx
+++ b/sql/backends/monet5/sql_scenario.mx
@@ -407,6 +407,7 @@
 {
        mvc *m;
        str schema;
+       str msg = MAL_SUCCEED;
        backend *be;
        bstream *bfd = NULL;
        stream *fd = NULL;
@@ -480,7 +481,6 @@
                                        filename = p + 1;
 
                                if (fd) {
-                                       str msg = MAL_SUCCEED;
                                        bfd = bstream_create(fd, 128 * BLOCK);
                                        if (bfd && bstream_next(bfd) >= 0)
                                                msg = SQLstatementIntern(c, 
&bfd->buf, "sql.init", TRUE, FALSE);
@@ -488,10 +488,8 @@
                                        if (m->sa)
                                                sa_destroy(m->sa);
                                        m->sa = NULL;
-                                       if (msg) {
-                                               GDKfree(fullname);
-                                               return msg;
-                                       }
+                                       if (msg) 
+                                               p = NULL;
                                }
                        } while (p);
                        GDKfree(fullname);
@@ -500,7 +498,14 @@
        }
        fflush(stdout);
        fflush(stderr);
-       return MAL_SUCCEED;
+
+       /* send error from create scripts back to the first client */
+       if (msg) {
+               error(c->fdout, msg);
+               handle_error(m, c->fdout, 0);
+               sqlcleanup(m, mvc_status(m));
+       }
+       return msg;
 }
 
 str
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to