Changeset: dcc52208263a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dcc52208263a
Modified Files:
sql/backends/monet5/sql.c
Branch: default
Log Message:
return null if check constraint not found
diffs (23 lines):
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -5260,13 +5260,17 @@ SQLcheck(Client cntxt, MalBlkPtr mb, Mal
sql_schema *s = mvc_bind_schema(m, sname);
if (s) {
sql_key *k = mvc_bind_key(m, s, cname);
- if (k->check) {
+ if (k && k->check) {
int pos = 0;
sql_rel *rel = rel_basetable(m, k->t, k->t->base.name);
sql_exp *exp = exp_read(m, rel, NULL, NULL,
sa_strdup(m->sa, k->check), &pos, 0);
- *r = GDKstrdup(exp2sql(m, exp));
+ if (!(*r = GDKstrdup(exp2sql(m, exp))))
+ throw(SQL, "SQLcheck", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
+ return MAL_SUCCEED;
}
}
+ if (!(*r = GDKstrdup(str_nil)))
+ throw(SQL, "SQLcheck", SQLSTATE(HY013) MAL_MALLOC_FAIL);
return MAL_SUCCEED;
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]