Changeset: d65c71b1b58c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d65c71b1b58c
Modified Files:
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_gencode.h
sql/backends/monet5/sql_scenario.c
sql/common/sql_backend.h
Branch: unlock
Log Message:
readed check for modules
diffs (57 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
@@ -863,6 +863,19 @@ cleanup:
}
int
+monet5_has_module(ptr M, char *module)
+{
+ Client c;
+ int clientID = *(int*) M;
+ c = MCgetClient(clientID);
+
+ Module m = findModule(c->usermodule, putName(module));
+ if (m && m != c->usermodule)
+ return 1;
+ return 0;
+}
+
+int
monet5_resolve_function(ptr M, sql_func *f)
{
Client c;
diff --git a/sql/backends/monet5/sql_gencode.h
b/sql/backends/monet5/sql_gencode.h
--- a/sql/backends/monet5/sql_gencode.h
+++ b/sql/backends/monet5/sql_gencode.h
@@ -19,6 +19,7 @@
sql5_export Symbol backend_dumpproc(backend *be, Client c, cq *q, sql_rel *r);
sql5_export int backend_dumpstmt(backend *be, MalBlkPtr mb, sql_rel *r, int
top, int addend, const char *query);
+sql5_export int monet5_has_module(ptr M, char *module);
sql5_export int monet5_resolve_function(ptr M, sql_func *f);
sql5_export int backend_create_func(backend *be, sql_func *f, list *restypes,
list *ops);
extern int backend_create_subfunc(backend *be, sql_subfunc *f, list *ops);
diff --git a/sql/backends/monet5/sql_scenario.c
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -346,6 +346,7 @@ SQLinit(Client c)
be_funcs = (backend_functions) {
.fcode = &monet5_freecode,
.fresolve_function = &monet5_resolve_function,
+ .fhas_module_function = &monet5_has_module,
};
monet5_user_init(&be_funcs);
diff --git a/sql/common/sql_backend.h b/sql/common/sql_backend.h
--- a/sql/common/sql_backend.h
+++ b/sql/common/sql_backend.h
@@ -53,7 +53,7 @@ extern int backend_alter_user(ptr mvc, s
extern int backend_rename_user(ptr mvc, str olduser, str newuser);
extern void* backend_schema_user_dependencies(ptr trans, sqlid schema_id);
extern int backend_resolve_function(ptr trans, sql_func *f);
-extern int backend_has_module(ptr trans, char *name);
+extern int backend_has_module(ptr M, char *name);
extern backend_functions be_funcs;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list