Added check to prevent views from having the name 'taxonomy' (used for
URIs)
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user