Changeset: e1f9874ac167 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e1f9874ac167
Modified Files:
        sql/src/server/rel_bin.mx
Branch: Oct2010
Log Message:

Fix for bug 2589.
The problem is as follows.
The "operation successful" message is triggered by the code "&3" which comes
from the server.  The server sends this code in the function
mvc_export_operation().  This function is called from the MAL statement
sql.exportOperation() which is generated in the function backend_dumpstmt().
The problem is that in the case of a CREATE TABLE ... WITH DATA query, the
generation of the sql.exportOperation() call is skipped.
This skipping happens when the type of operation is not Q_SCHEMA or Q_TRANS
(which are resultset-less operations).
The reason why the type is not Q_SCHEMA (which one would expect) is because
during the semantic analysis phase, the server sees that a table is being used,
and so it sets the type of the query to Q_TABLE (in function subrel_bin()).  At
the start of the analysis, the type was still Q_SCHEMA.
We now reset the type to Q_SCHEMA after subrel_bin has done its work
(if that is what the type was, of course).


diffs (29 lines):

diff -r cefea1559ac5 -r e1f9874ac167 sql/src/server/rel_bin.mx
--- a/sql/src/server/rel_bin.mx Fri Oct 08 09:31:18 2010 +0200
+++ b/sql/src/server/rel_bin.mx Wed Oct 06 14:05:26 2010 +0200
@@ -3875,8 +3875,12 @@
 {
        node *n;
        list *refs = list_create(NULL);
+       int sqltype = sql->type;
        stmt *s = subrel_bin( sql, rel, refs);
 
+       if (sqltype == Q_SCHEMA)
+               sql->type = sqltype;  /* reset */
+
        /* clean stmts properly (but don't touch the rels) ! */
        for (n = refs->h; n; n = n->next->next) 
                stmt_destroy(n->next->data);
@@ -3894,8 +3898,12 @@
 output_rel_bin(mvc *sql, sql_rel *rel ) 
 {
        list *refs = list_create(NULL);
+       int sqltype = sql->type;
        stmt *s = subrel_bin( sql, rel, refs);
 
+       if (sqltype == Q_SCHEMA)
+               sql->type = sqltype;  /* reset */
+
        if (!is_ddl(rel->op) && s && s->type != st_none && sql->type == Q_TABLE)
                s = stmt_output(s);
        list_destroy(refs);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to