Code for tests storing data in multiple AVLs.

(note: unretrievable data as implemented)
This commit is contained in:
Celine Mercier
2016-03-11 15:34:55 +01:00
parent 21d1b2ed3e
commit 545ed8111a
6 changed files with 205 additions and 17 deletions

View File

@ -521,7 +521,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
OBIDMS_column_p new_column;
OBIDMS_column_directory_p column_directory;
OBIDMS_column_header_p header;
OBIDMS_avl_p avl;
OBIDMS_avl_p* avl;
size_t file_size;
obiversion_t version_number;
char* column_file_name;
@ -723,7 +723,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
// If the data type is OBI_STR or OBI_SEQ, the associated obi_avl is opened or created
if ((returned_data_type == OBI_STR) || (returned_data_type == OBI_SEQ))
{
avl = obi_avl(dms, avl_name);
avl = obi_create_avl_in_64_parts(dms, avl_name);
if (avl == NULL)
{
obidebug(1, "\nError opening or creating the aVL tree associated with a column");
@ -732,7 +732,7 @@ OBIDMS_column_p obi_create_column(OBIDMS_p dms,
free(new_column);
return NULL;
}
new_column->avl = avl;
memcpy(new_column->avl, avl, 64*sizeof(OBIDMS_avl_p));
strncpy(header->avl_name, avl_name, AVL_MAX_NAME);
}
@ -886,7 +886,7 @@ OBIDMS_column_p obi_open_column(OBIDMS_p dms,
free(column);
return NULL;
}
column->avl = avl;
//column->avl = avl; TODO
}
close(column_file_descriptor);
@ -1020,12 +1020,12 @@ int obi_close_column(OBIDMS_column_p column)
}
}
// If the data type is OBI_STR or OBI_SEQ, the associated AVL tree is closed
if (((column->header)->returned_data_type == OBI_STR) || ((column->header)->returned_data_type == OBI_SEQ))
{
if (obi_close_avl(column->avl) < 0)
return -1;
}
// If the data type is OBI_STR or OBI_SEQ, the associated AVL tree is closed TODO
// if (((column->header)->returned_data_type == OBI_STR) || ((column->header)->returned_data_type == OBI_SEQ))
// {
// if (obi_close_avl(column->avl) < 0)
// return -1;
// }
// Munmap data
if (munmap(column->data, (column->header)->data_size) < 0)