Prevent erroneous index creation for non-numerical attributes.
This commit is contained in:
parent
2a4b985d99
commit
b27fb1b697
|
@ -91,6 +91,11 @@ index_create(index_type_t index_type, relation_t *rel, attribute_t *attr)
|
||||||
return DB_STORAGE_ERROR;
|
return DB_STORAGE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(attr->domain != DOMAIN_INT && attr->domain != DOMAIN_LONG) {
|
||||||
|
PRINTF("DB: Cannot create an index for a non-number attribute!\n");
|
||||||
|
return DB_INDEX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
api = find_index_api(index_type);
|
api = find_index_api(index_type);
|
||||||
if(api == NULL) {
|
if(api == NULL) {
|
||||||
PRINTF("DB: No API for index type %d\n", (int)index_type);
|
PRINTF("DB: No API for index type %d\n", (int)index_type);
|
||||||
|
|
Loading…
Reference in a new issue