Update of /cvsroot/monetdb/sql/src/server
In directory sc8-pr-cvs16:/tmp/cvs-serv1518

Modified Files:
        sql_mvc.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 t
hem and also to help in the dependencies check.



Index: sql_mvc.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/server/sql_mvc.mx,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- sql_mvc.mx  28 Apr 2007 11:19:55 -0000      1.181
+++ sql_mvc.mx  3 May 2007 23:36:03 -0000       1.182
@@ -137,8 +137,7 @@
 extern sql_type *mvc_bind_type(mvc *sql, char *name);
 extern sql_type *schema_bind_type(mvc *sql, sql_schema * s, char *name);
 extern sql_func *mvc_bind_func(mvc *sql, char *name);
-extern list *schema_bind_func(mvc *sql, sql_schema * s, char *name);
-extern sql_func *schema_bind_func_types(mvc *sql, sql_schema * s, char *name, 
list *typelist);
+extern list *schema_bind_func(mvc *sql, sql_schema * s, char *name, int 
is_func);
 
 extern sql_schema *mvc_bind_schema(mvc *c, char *sname);
 extern sql_table *mvc_bind_table(mvc *c, sql_schema *s, char *tname);
@@ -150,7 +149,7 @@
 extern sql_trigger *mvc_bind_trigger(mvc *c, sql_schema *s, char *tname);
 
 extern sql_type *mvc_create_type(mvc *sql, sql_schema *s, char *sqlname, int 
digits, int scale, int radix, char *impl);
-extern sql_func *mvc_create_func(mvc *sql, sql_schema *s, char *name, list 
*args, sql_subtype *res, bit issql, bit aggr, char *mod, char *impl);
+extern sql_func *mvc_create_func(mvc *sql, sql_schema *s, char *name, list 
*args, sql_subtype *res, bit issql, bit aggr, char *mod, char *impl, int 
is_func);
 extern void mvc_drop_func(mvc *c, sql_schema *s, sql_func * func, int 
drop_action);
 extern void mvc_drop_all_func(mvc *c, sql_schema *s, list *list_func, int 
drop_action);
 
@@ -721,9 +720,9 @@
 }
 
 list *
-schema_bind_func(mvc *sql, sql_schema * s, char *name)
+schema_bind_func(mvc *sql, sql_schema * s, char *name, int is_func)
 {
-       list *func_list = find_all_sql_func(s, name);
+       list *func_list = find_all_sql_func(s, name, is_func);
 
        (void) sql;
        if (!func_list)
@@ -733,45 +732,6 @@
        return func_list;
 }
 
-sql_func *
-schema_bind_func_types(mvc *sql, sql_schema * s, char *name, list * typelist)
-{
-       list *func_list = find_all_sql_func(s, name);
-       sql_func * f = NULL;
-       sql_subtype arg_subtype;
-       node *npar = NULL, *narg = NULL;
-
-       (void) sql;
-       if (!func_list)
-               return NULL;
-       else {
-               f = (sql_func *) func_list->h->data;
-
-               if (f->ops->h)
-                       narg = f->ops->h;
-
-               for (npar = typelist->h; npar; npar = npar->next) {
-                       if (!narg)
-                               return NULL;
-
-                       arg_subtype = *(sql_subtype*) narg->data;
-
-                       if (strcmp((char *) npar->data, 
arg_subtype.type->base.name) != 0)
-                               return NULL;
-                       
-                        narg = narg->next;
-               }
-               
-               if (npar || narg)
-                       return NULL;
-       }
-       
-       if (mvc_debug)
-               fprintf(stderr, "schema_bind_func_types %s\n", name);
-       
-       return f;
-}
-
 sql_schema *
 mvc_bind_schema(mvc *m, char *sname)
 {
@@ -957,14 +917,14 @@
 }
 
 sql_func *
-mvc_create_func(mvc *sql, sql_schema * s, char *name, list *args, sql_subtype 
*res, bit issql, bit aggr, char *mod, char *impl)
+mvc_create_func(mvc *sql, sql_schema * s, char *name, list *args, sql_subtype 
*res, bit issql, bit aggr, char *mod, char *impl, int is_func)
 {
        sql_func *f = NULL;
 
        if (mvc_debug)
                fprintf(stderr, "mvc_create_func %s\n", name);
 
-       f = sql_trans_create_func(sql->session->tr, s, name, args, res, issql, 
aggr, mod, impl);
+       f = sql_trans_create_func(sql->session->tr, s, name, args, res, issql, 
aggr, mod, impl, is_func);
        sql->type = Q_SCHEMA;
        return f;
 }


-------------------------------------------------------------------------
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

Reply via email to