Skip to content
Snippets Groups Projects
Commit 9b8c3949 authored by Vladimir Davydov's avatar Vladimir Davydov
Browse files

tuple: zap tuple_format_dup

This function was only used for creating a format for tuples with column
mask in vinyl. Not needed anymore and can be removed.

Anyway, it doesn't make much sense to duplciate a tuple format, because
it can be referenced instead. Besides, once JSON indexes are introcued,
duplicating a tuple format will be really painful. One more reason to
drop it now.
parent 08afd57f
No related branches found
No related tags found
No related merge requests found
......@@ -324,28 +324,6 @@ tuple_format1_can_store_format2_tuples(const struct tuple_format *format1,
return true;
}
struct tuple_format *
tuple_format_dup(struct tuple_format *src)
{
uint32_t total = sizeof(struct tuple_format) +
src->field_count * sizeof(struct tuple_field);
struct tuple_format *format = (struct tuple_format *) malloc(total);
if (format == NULL) {
diag_set(OutOfMemory, total, "malloc", "tuple format");
return NULL;
}
memcpy(format, src, total);
tuple_dictionary_ref(format->dict);
format->id = FORMAT_ID_NIL;
format->refs = 0;
if (tuple_format_register(format) != 0) {
tuple_format_destroy(format);
free(format);
return NULL;
}
return format;
}
/** @sa declaration for details. */
int
tuple_init_field_map(const struct tuple_format *format, uint32_t *field_map,
......
......@@ -232,16 +232,6 @@ bool
tuple_format1_can_store_format2_tuples(const struct tuple_format *format1,
const struct tuple_format *format2);
/**
* Register the duplicate of the specified format.
* @param src Original format.
*
* @retval not NULL Success.
* @retval NULL Memory or format register error.
*/
struct tuple_format *
tuple_format_dup(struct tuple_format *src);
/**
* Returns the total size of tuple metadata of this format.
* See @link struct tuple @endlink for explanation of tuple layout.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment