Added check to prevent views from having the name 'taxonomy' (used for

URIs)
This commit is contained in:
Celine Mercier
2017-09-15 14:54:55 +02:00
parent 0e140df0fb
commit 7c57bd33e5
2 changed files with 15 additions and 7 deletions

View File

@ -1558,6 +1558,14 @@ Obiview_p obi_new_view(OBIDMS_p dms, const char* view_name, Obiview_p view_to_cl
return NULL;
}
// Check that the view name is not 'taxonomy' (used for URIs)
if (strcmp(view_name, "taxonomy") == 0)
{
obi_set_errno(OBIVIEW_ERROR);
obidebug(1, "\nView name can not be 'taxonomy'");
return NULL;
}
// Allocate memory for view structure
view = (Obiview_p) malloc(sizeof(Obiview_t));
if (view == NULL)
@ -1838,7 +1846,7 @@ Obiview_p obi_new_view_nuc_seqs(OBIDMS_p dms, const char* view_name, Obiview_p v
if (view_to_clone == NULL)
{
// Adding sequence column
if (obi_view_add_column(view, NUC_SEQUENCE_COLUMN, -1, NULL, OBI_SEQ, 0, 1, NULL, NULL, NULL, -1, "Nucleotide sequences", true) < 0)
if (obi_view_add_column(view, NUC_SEQUENCE_COLUMN, -1, NULL, OBI_SEQ, 0, 1, NULL, NULL, NULL, -1, "Nucleotide sequences", true) < 0) // discuss using same indexer "NUC_SEQ_INDEXER"
{
obidebug(1, "Error adding an obligatory column in a nucleotide sequences view");
return NULL;