Changeset: 09db8a46c67e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=09db8a46c67e Modified Files: sql/src/server/rel_semantic.mx sql/src/storage/sql_catalog.mx sql/src/storage/store.mx Branch: default Log Message:
Merged from Jun2010 diffs (138 lines): diff -r 091e939109be -r 09db8a46c67e sql/src/server/rel_semantic.mx --- a/sql/src/server/rel_semantic.mx Wed Jul 14 11:08:54 2010 +0200 +++ b/sql/src/server/rel_semantic.mx Wed Jul 14 12:40:13 2010 +0200 @@ -315,7 +315,7 @@ } stack_pop_frame(sql); return r; - } + } case SQL_PREP: { dnode *d = s->data.lval->h; diff -r 091e939109be -r 09db8a46c67e sql/src/server/sql_psm.mx --- a/sql/src/server/sql_psm.mx Wed Jul 14 11:08:54 2010 +0200 +++ b/sql/src/server/sql_psm.mx Wed Jul 14 12:40:13 2010 +0200 @@ -536,7 +536,7 @@ if (sname && !(s = mvc_bind_schema(sql, sname))) return sql_error(sql, 02, "CREATE %s: no such schema '%s'", F, sname); - if(s == NULL) + if (s == NULL) s = cur_schema(sql); if (res) @@ -573,7 +573,9 @@ list_destroy(type_list); if (create && !schema_privs(sql->role_id, s)) { - return sql_error(sql, 02, "CREATE FUNCTION: insufficient privileges for user '%s' in schema '%s'", stack_get_string(sql, "current_user"), s->base.name); + return sql_error(sql, 02, "CREATE %s: insufficient privileges " + "for user '%s' in schema '%s'", F, + stack_get_string(sql, "current_user"), s->base.name); } else { if (params) for (n = params->h; n; n = n->next) { @@ -601,12 +603,14 @@ if (is_func && restype && !has_return(b)) { sql_destroy_params(sql); list_destroy(l); - return sql_error(sql, 01, "Missing return statement"); + return sql_error(sql, 01, + "CREATE %s: missing return statement", F); } if (!is_func && !restype && has_return(b)) { sql_destroy_params(sql); list_destroy(l); - return sql_error(sql, 01, "It is a procedure so it cannot have a return statement!!"); + return sql_error(sql, 01, "CREATE %s: procedures " + "cannot have return statements", F); } /* in execute mode we instantiate the function */ @@ -616,15 +620,19 @@ list_destroy(l); return b; } else if (create) { - f = mvc_create_func(sql, sql->session->schema, fname, l, restype, TRUE, is_aggr, "user", q, is_func); + f = mvc_create_func(sql, sql->session->schema, fname, + l, restype, TRUE, is_aggr, "user", q, is_func); if (b) { id_col_l = stmt_list_dependencies(b, COLUMN_DEPENDENCY); id_func_l = stmt_list_dependencies(b, FUNC_DEPENDENCY); view_id_l = stmt_list_dependencies(b, VIEW_DEPENDENCY); - mvc_create_dependencies(sql, id_col_l, f->base.id, f->is_func ? FUNC_DEPENDENCY : PROC_DEPENDENCY); - mvc_create_dependencies(sql, id_func_l, f->base.id, f->is_func ? FUNC_DEPENDENCY : PROC_DEPENDENCY); - mvc_create_dependencies(sql, view_id_l, f->base.id, f->is_func ? FUNC_DEPENDENCY : PROC_DEPENDENCY); + mvc_create_dependencies(sql, id_col_l, f->base.id, + f->is_func ? FUNC_DEPENDENCY : PROC_DEPENDENCY); + mvc_create_dependencies(sql, id_func_l, f->base.id, + f->is_func ? FUNC_DEPENDENCY : PROC_DEPENDENCY); + mvc_create_dependencies(sql, view_id_l, f->base.id, + f->is_func ? FUNC_DEPENDENCY : PROC_DEPENDENCY); list_destroy(id_col_l); list_destroy(id_func_l); @@ -636,7 +644,8 @@ } else { char *fmod = qname_module(ext_name); char *fnme = qname_fname(ext_name); - mvc_create_func(sql, sql->session->schema, fname, l, restype, FALSE, is_aggr, fmod, fnme, is_func); + mvc_create_func(sql, sql->session->schema, fname, l, restype, + FALSE, is_aggr, fmod, fnme, is_func); sql_destroy_params(sql); list_destroy(l); } diff -r 091e939109be -r 09db8a46c67e sql/src/storage/sql_catalog.mx --- a/sql/src/storage/sql_catalog.mx Wed Jul 14 11:08:54 2010 +0200 +++ b/sql/src/storage/sql_catalog.mx Wed Jul 14 12:40:13 2010 +0200 @@ -303,19 +303,20 @@ list *l = s->funcs.set, *res = NULL; node *n = NULL; - if (l) - for (n = l->h; n; n = n->next) { - sql_base *b = n->data; - sql_func *f = n->data; + if (l) { + for (n = l->h; n; n = n->next) { + sql_base *b = n->data; + sql_func *f = n->data; - /* check if names match */ - if (f->is_func == is_func && name[0] == b->name[0] && strcmp(name, b->name) == 0) { + /* check if names match */ + if (f->is_func == is_func && name[0] == b->name[0] && strcmp(name, b->name) == 0) { if (!res) - res = list_create((fdestroy) NULL); + res = list_create((fdestroy)NULL); list_append(res, n->data); - } - } - return res; + } + } + } + return res; } sql_func * diff -r 091e939109be -r 09db8a46c67e sql/src/storage/store.mx --- a/sql/src/storage/store.mx Wed Jul 14 11:08:54 2010 +0200 +++ b/sql/src/storage/store.mx Wed Jul 14 12:40:13 2010 +0200 @@ -1366,12 +1366,12 @@ bootstrap_create_column(tr, t, "cacheinc", "bigint", 64); bootstrap_create_column(tr, t, "cycle", "boolean", 1); - t = bootstrap_create_table(tr, s, "dependencies"); + t = bootstrap_create_table(tr, s, "dependencies"); bootstrap_create_column(tr, t, "id", "int", 32); bootstrap_create_column(tr, t, "depend_id", "int", 32); bootstrap_create_column(tr, t, "depend_type", "smallint", 16); - t = bootstrap_create_table(tr, s, "connections"); + t = bootstrap_create_table(tr, s, "connections"); bootstrap_create_column(tr, t, "id", "int", 32); bootstrap_create_column(tr, t, "server", "char", 1024); bootstrap_create_column(tr, t, "port", "int", 32); _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list