Changeset: 7656d09286fb for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7656d09286fb
Modified Files:
sql/backends/monet5/sql_gencode.c
Branch: Nov2019
Log Message:
Disable type checking for now on monet5_resolve_function. There are more
exceptions than rules
diffs (55 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
@@ -878,40 +878,42 @@ monet5_resolve_function(ptr M, sql_func
InstrPtr sig = getSignature(s);
int argc = sig->argc - sig->retc, nfargs =
list_length(f->ops), nfres = list_length(f->res);
- if ((sig->varargs & VARARGS) == VARARGS && f->vararg)
+ if ((sig->varargs & VARARGS) == VARARGS || f->vararg ||
f->varres)
return 1;
- else if (nfargs == argc && nfres == sig->retc) { /*
check for types of inputs and outputs */
+ else if (nfargs == argc && (nfres == sig->retc ||
(sig->retc == 1 && (IS_FILT(f) || IS_PROC(f))))) {
+ /* I removed this code because, it was
triggering many errors on te SQL <-> MAL translation */
+ /* Check for types of inputs and outputs. SQL
procedures and filter functions always return 1 value in the MAL implementation
bool all_match = true;
- if (nfres != 0) { /* if function has output
variables, test types are equivalent */
+ if (nfres != 0) { if function has output
variables, test types are equivalent
int i = 0;
for (node *n = f->res->h; n &&
all_match; n = n->next, i++) {
sql_arg *arg = (sql_arg *)
n->data;
int nsql_tpe =
arg->type.type->localtype;
int nmal_tpe =
getArgType(s->def, sig, i);
- if (isaBatType(nmal_tpe))
+ if (isaBatType(nmal_tpe) ||
(nmal_tpe & 0377) == TYPE_any) any type is excluded from isaBatType
nmal_tpe =
getBatType(nmal_tpe);
- /* any/void types allways match
*/
+ any/void types allways match
if (nsql_tpe != TYPE_any &&
nmal_tpe != TYPE_any && nsql_tpe != TYPE_void && nmal_tpe != TYPE_void)
all_match = nsql_tpe ==
nmal_tpe;
}
}
- if (all_match && nfargs != 0) { /* if function
has arguments, test types are equivalent */
+ if (all_match && nfargs != 0) { if function
has arguments, test types are equivalent
int i = sig->retc;
for (node *n = f->ops->h; n &&
all_match; n = n->next, i++) {
sql_arg *arg = (sql_arg *)
n->data;
int nsql_tpe =
arg->type.type->localtype;
int nmal_tpe =
getArgType(s->def, sig, i);
- if (isaBatType(nmal_tpe))
+ if (isaBatType(nmal_tpe) ||
(nmal_tpe & 0377) == TYPE_any) any type is excluded from isaBatType
nmal_tpe =
getBatType(nmal_tpe);
- /* any/void types allways match
*/
+ any/void types allways match
if (nsql_tpe != TYPE_any &&
nmal_tpe != TYPE_any && nsql_tpe != TYPE_void && nmal_tpe != TYPE_void)
all_match = nsql_tpe ==
nmal_tpe;
}
}
- if (all_match)
+ if (all_match)*/
return 1;
}
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list