Changeset: a6c482ef248c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a6c482ef248c
Modified Files:
sql/backends/monet5/sql_gencode.c
Branch: arrays
Log Message:
fixing input of subselction in non-dimensions in more places + returing two
outputs when having subselect on non-dimensional column
diffs (58 lines):
diff --git a/sql/backends/monet5/sql_gencode.c
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -1315,6 +1315,7 @@ static int
char nme[SMALLBUFSIZ];
int uval = -1;
+ int outputsNum = 1; //I will use this when having an
array
if ((l = _dumpstmt(sql, mb, s->op1)) < 0)
return -1;
@@ -1464,6 +1465,8 @@ static int
q = pushReturn(mb, q,
newTmpVariable(mb, newBatType(TYPE_oid, TYPE_oid)));
q = pushArgument(mb, q,
l);
*/
+ //two outputs
+ outputsNum = 2;
} else
q = pushArgument(mb, q,
l);
@@ -1486,11 +1489,11 @@ static int
case cmp_gt:
case cmp_gte: {
q = newStmt2(mb, algebraRef,
cmd);
- if(s->op1->type ==
st_dimension) { //selection over a dimension, two outputs
- snprintf(nme,
SMALLBUFSIZ, "Y_%d", l);
- uval = findVariable(mb, nme);
-
- assert(uval >=0);
+//NOT NEEDED if(s->op1->type ==
st_dimension) { //selection over a dimension, two outputs
+ snprintf(nme, SMALLBUFSIZ,
"Y_%d", l);
+ uval = findVariable(mb, nme);
+
+ if(uval >=0) {
setVarType(mb,
getArg(q, 0), TYPE_ptr);
setVarUDFtype(mb,
getArg(q, 0));
@@ -1502,7 +1505,9 @@ static int
setVarUDFtype(mb,
getArg(q, 0));
q = pushReturn(mb, q,
newTmpVariable(mb, newBatType(TYPE_oid, TYPE_oid)));
q = pushArgument(mb, q,
l);
-*/ } else
+*/ //two outputs
+ outputsNum = 2;
+ } else
q = pushArgument(mb, q,
l);
if(sub > 0) { //candidates
@@ -1547,7 +1552,8 @@ static int
}
if (q) {
s->nr = getDestVar(q);
- if(s->op1->type == st_dimension /*NOT NEEDED ||
(s->op1->type == st_join && s->op1->op2->type == st_bat &&
isArray(s->op1->op2->op4.cval->t))*/) {
+ // if(s->op1->type == st_dimension /*NOT NEEDED ||
(s->op1->type == st_join && s->op1->op2->type == st_bat &&
isArray(s->op1->op2->op4.cval->t))*/) {
+ if(outputsNum == 2) {
/* rename second result */
renameVariable(mb, getArg(q, 1),
"Y_%d", s->nr);
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list