Changeset: f6b4565ffe98 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f6b4565ffe98
Modified Files:
sql/backends/monet5/sql.mx
Branch: Mar2011
Log Message:
rdf: cleanup, detypo, simplify
diffs (61 lines):
diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -5603,29 +5603,26 @@
mvc *m = NULL;
int id = 0;
oid rid = oid_nil;
-
- str msg = getContext(cntxt, mb, &m, NULL);
- if (msg)
- return msg;
-
- sch = mvc_bind_schema(m, *schema);
- if ( sch == NULL)
- throw(MAL,"sql.rdfSchred","Schema missing");
+ str msg;
+
+ rethrow("sql.rdfShred", msg, getContext(cntxt, mb, &m, NULL));
+
+ if ((sch = mvc_bind_schema(m, *schema)) == NULL)
+ throw(MAL, "sql.rdfShred", "schema missing");
+
g_tbl = mvc_bind_table(m, sch, "graph");
gname = mvc_bind_column(m, g_tbl, "gname");
gid = mvc_bind_column(m, g_tbl, "gid");
rid = table_funcs.column_find_row(m->session->tr, gname, *name, NULL);
- if (rid != oid_nil) {
- throw(SQL,"sql.rdfShred","graph name already exists in
rdf.graph");
- }
+ if (rid != oid_nil)
+ throw(SQL, "sql.rdfShred", "graph name already exists in
rdf.graph");
+
id = (int) store_funcs.count_col(gname);
store_funcs.append_col(m->session->tr, gname, *name, TYPE_str);
store_funcs.append_col(m->session->tr, gid, &id, TYPE_int);
- msg = RDFParser(&docbats, location, name, schema);
- if (msg)
- return msg;
+ rethrow("sql.rdfShred", msg, RDFParser(&docbats, location, name,
schema));
if (sizeof(oid) == 8) {
sql_find_subtype(&tpe, "oid", 31, 0);
@@ -5652,13 +5649,12 @@
sql_find_subtype(&tpe, "varchar", 1024, 0);
mvc_create_column(m, map_tbl, "lexical", &tpe);
- if ((graph = BATdescriptor(docbats)) == NULL) {
+ if ((graph = BATdescriptor(docbats)) == NULL)
throw(SQL, "sql.rdfShred", "docbat is missing");
- }
+
g = (bat *) Tloc(graph, BUNfirst(graph));
- s = BATdescriptor(g[MAP_LEX]);
- if ( s == NULL){
+ if ((s = BATdescriptor(g[MAP_LEX])) == NULL) {
BBPreleaseref(graph->batCacheid);
throw(SQL, "sql.rdfShred", "map_lex is missing");
}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list