Changeset: b4f130649207 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b4f130649207
Modified Files:
        sql/server/rel_updates.c
        sql/test/sciql/Tests/04_insert_02.stable.out
        sql/test/sciql/Tests/07_tiling_03.stable.out
        sql/test/sciql/Tests/All
Branch: sciql
Log Message:

Label columns that don't have a table name to avoid ambiguity.

This fixes the problem with INSERT INTO ary with a subquery that the cell 
values are not updated.

Enables the insert test that now works.

approved new stable.out


diffs (98 lines):

diff --git a/sql/server/rel_updates.c b/sql/server/rel_updates.c
--- a/sql/server/rel_updates.c
+++ b/sql/server/rel_updates.c
@@ -340,9 +340,13 @@ rel_insert_array(mvc *sql, sql_table *t,
                sql_column *c = m->data; /* column from base array */
                sql_exp *eOld = NULL, *eNew = NULL, *e = n->data; /* column exp 
in INSERT stmt */
 
+               if(!exp_relname(e))
+                       exp_label(sql->sa, e, ++sql->label);
                if (!(e->type == e_atom && !e->name && ((atom*)e->l)->isnull)) {
                        eOld = exp_column(sql->sa, c->t->base.name, 
c->base.name, &c->type, CARD_MULTI, 0, 0);
                        eNew = exp_column(sql->sa, exp_relname(e), exp_name(e), 
exp_subtype(e), ins->card, has_nil(e), is_intern(e));
+                       if(!exp_relname(eNew))
+                               exp_label(sql->sa, eNew, ++sql->label);
 
                        if (c->dim) {
                                rel_join_add_exp(sql->sa, jn, 
exp_compare(sql->sa, eOld, eNew, cmp_equal));
diff --git a/sql/test/sciql/Tests/04_insert_02.stable.out 
b/sql/test/sciql/Tests/04_insert_02.stable.out
--- a/sql/test/sciql/Tests/04_insert_02.stable.out
+++ b/sql/test/sciql/Tests/04_insert_02.stable.out
@@ -20,18 +20,16 @@ stdout of test '04_insert_02` in directo
 Ready.
 # SQL catalog created, loading sql scripts once
 
-Over..
+# 22:43:33 >  
+# 22:43:33 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=jarl" 
"--port=30950"
+# 22:43:33 >  
 
-# 15:18:50 >  
-# 15:18:50 >  mclient -lsql -ftest -i -e --host=jarl --port=35912 
-# 15:18:50 >  
-
-#CREATE ARRAY matrix (x INT DIMENSION[4], y INT DIMENSION[4], v FLOAT DEFAULT 
3.3);
-#SELECT * FROM matrix;
-% sys.matrix,  sys.matrix,     sys.matrix # table_name
+#CREATE ARRAY matrix_0402 (x INT DIMENSION[4], y INT DIMENSION[4], v FLOAT 
DEFAULT 0.0);
+#SELECT * FROM matrix_0402;
+% sys.matrix_0402,     sys.matrix_0402,        sys.matrix_0402 # table_name
 % x,   y,      v # name
 % int, int,    double # type
-% 1,   1,      22 # length
+% 1,   1,      24 # length
 [ 0,   0,      0       ]
 [ 0,   1,      0       ]
 [ 0,   2,      0       ]
@@ -48,13 +46,13 @@ Over..
 [ 3,   1,      0       ]
 [ 3,   2,      0       ]
 [ 3,   3,      0       ]
-#INSERT INTO matrix SELECT x, y, 3.3 FROM matrix WHERE x = 3;
-[ 8    ]
-#SELECT * FROM matrix;
-% sys.matrix,  sys.matrix,     sys.matrix # table_name
+#INSERT INTO matrix_0402 SELECT x, y, 3.3 FROM matrix_0402 WHERE x = 3;
+[ 4    ]
+#SELECT * FROM matrix_0402;
+% sys.matrix_0402,     sys.matrix_0402,        sys.matrix_0402 # table_name
 % x,   y,      v # name
 % int, int,    double # type
-% 1,   1,      22 # length
+% 1,   1,      24 # length
 [ 0,   0,      0       ]
 [ 0,   1,      0       ]
 [ 0,   2,      0       ]
diff --git a/sql/test/sciql/Tests/07_tiling_03.stable.out 
b/sql/test/sciql/Tests/07_tiling_03.stable.out
--- a/sql/test/sciql/Tests/07_tiling_03.stable.out
+++ b/sql/test/sciql/Tests/07_tiling_03.stable.out
@@ -50,7 +50,7 @@ Ready.
 [ 9    ]
 #select x,y, avg(f * f) from a group by a[x:x+2][y:y+2];
 % sys.a,       sys.a,  sys. # table_name
-% x,   y,      L34 # name
+% x,   y,      L42 # name
 % int, int,    table # type
 % 1,   1,      0 # length
 [ 0,   0,      0.38500000000000001     ]
@@ -64,7 +64,7 @@ Ready.
 [ 2,   2,      0.040000000000000008    ]
 #select x,y, f, avg(f * f) from a group by a[x:x+2][y:y+2];
 % sys.a,       sys.a,  sys.a,  sys. # table_name
-% x,   y,      f,      L35 # name
+% x,   y,      f,      L43 # name
 % int, int,    double, table # type
 % 1,   1,      24,     0 # length
 [ 0,   0,      0.2,    0.38500000000000001     ]
diff --git a/sql/test/sciql/Tests/All b/sql/test/sciql/Tests/All
--- a/sql/test/sciql/Tests/All
+++ b/sql/test/sciql/Tests/All
@@ -37,7 +37,7 @@ 02_update_01
 03_delete_01
 
 #04_insert_01
-#04_insert_02
+04_insert_02
 #04_insert_03
 #04_insert_04
 #04_insert_05
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to