The default name of an AVL is now the column name + '_indexer', and when
an AVL is opened (as opposed to created), it is read-only
This commit is contained in:
@ -535,6 +535,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
|
||||
index_t minimum_line_count;
|
||||
OBIType_t returned_data_type;
|
||||
OBIType_t stored_data_type;
|
||||
char final_indexer_name[INDEXER_MAX_NAME];
|
||||
|
||||
new_column = NULL;
|
||||
|
||||
@ -554,11 +555,13 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
|
||||
obidebug(1, "\nCan't create column because of invalid data type");
|
||||
return NULL;
|
||||
}
|
||||
if (((data_type == OBI_STR) || (data_type == OBI_SEQ)) && (indexer_name == NULL))
|
||||
{
|
||||
obidebug(1, "\nCan't create column because of empty indexer name");
|
||||
return NULL;
|
||||
if (((data_type == OBI_STR) || (data_type == OBI_SEQ)) && (strcmp(indexer_name, "") == 0))
|
||||
{ // TODO make function in obiblob_indexer.c and discuss the fact that it's here
|
||||
strcpy(final_indexer_name, column_name);
|
||||
strcat(final_indexer_name, "_indexer");
|
||||
}
|
||||
else
|
||||
strcpy(final_indexer_name, indexer_name);
|
||||
|
||||
returned_data_type = data_type;
|
||||
if ((data_type == OBI_STR) || (data_type == OBI_SEQ))
|
||||
@ -727,7 +730,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
|
||||
// If the data type is OBI_STR or OBI_SEQ, the associated obi_indexer is opened or created
|
||||
if ((returned_data_type == OBI_STR) || (returned_data_type == OBI_SEQ))
|
||||
{
|
||||
new_column->indexer = obi_indexer(dms, indexer_name);
|
||||
new_column->indexer = obi_indexer(dms, final_indexer_name);
|
||||
if (new_column->indexer == NULL)
|
||||
{
|
||||
obidebug(1, "\nError opening or creating the indexer associated with a column");
|
||||
@ -736,7 +739,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
|
||||
free(new_column);
|
||||
return NULL;
|
||||
}
|
||||
strncpy(header->indexer_name, indexer_name, INDEXER_MAX_NAME);
|
||||
strncpy(header->indexer_name, final_indexer_name, INDEXER_MAX_NAME);
|
||||
}
|
||||
|
||||
// Fill the data with NA values
|
||||
|
Reference in New Issue
Block a user