Update of /cvsroot/monetdb/sql/src/common
In directory sc8-pr-cvs16:/tmp/cvs-serv25399
Modified Files:
sql_types.mx
Log Message:
All the features supported for functions are now supported for procedures.
However, procedure and functions differ in two aspects (well, maybe one):
Procedure do not have return type and no return statements in their
runtime_body.
A new field to the struct sql_func was added to simply the distinguish between
them and also to help in the dependencies check.
Index: sql_types.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/common/sql_types.mx,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- sql_types.mx 28 Apr 2007 19:53:15 -0000 1.84
+++ sql_types.mx 3 May 2007 23:29:28 -0000 1.85
@@ -731,7 +731,7 @@
while (n) {
sql_func *f = n->data;
- if (!f->res.type)
+ if (f->is_func && !f->res.type)
continue;
if (strcmp(f->base.name, name) == 0) {
if (list_cmp(f->ops, ops, (fcmp) &arg_subtype_cmp) ==
0) {
@@ -773,7 +773,7 @@
if (s->funcs.set) for (n=s->funcs.set->h; n; n = n->next) {
sql_func *f = n->data;
- if (!f->res.type)
+ if (f->is_func && !f->res.type)
continue;
if (strcmp(f->base.name, name) == 0) {
if (list_cmp(f->ops, ops, (fcmp)
&arg_subtype_cmp) == 0) {
@@ -790,9 +790,11 @@
if (a && a->scale > scale)
scale = a->scale;
}
- sql_init_subtype(&fres->res,
f->res.type, f->res.digits, scale);
- if (f->res.comp_type)
- fres->res.comp_type =
f->res.comp_type;
+ if (f->is_func) {
+ sql_init_subtype(&fres->res,
f->res.type, f->res.digits, scale);
+ if (f->res.comp_type)
+ fres->res.comp_type =
f->res.comp_type;
+ }
return fres;
}
}
@@ -1114,10 +1116,13 @@
t->imp = _strdup(imp);
t->mod = _strdup(mod);
t->ops = ops;
- if (res)
+ if (res) {
t->res = *res;
- else
+ t->is_func = 1;
+ } else {
t->res.type = NULL;
+ t->is_func = 0;
+ }
t->nr = list_length(funcs);
t->sql = 0;
t->aggr = 0;
@@ -1138,10 +1143,13 @@
t->imp = _strdup(imp);
t->mod = _strdup("SQL");
t->ops = ops;
- if (res)
+ if (res) {
t->res = *res;
- else
+ t->is_func = 1;
+ } else {
t->res.type = NULL;
+ t->is_func = 0;
+ }
t->nr = list_length(funcs);
t->sql = 1;
list_append(funcs, t);
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins