From 7327cd9717f0b98499f0f5b19c84e5e3e48241df Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Sep 2012 14:01:17 +0300 Subject: =?UTF-8?q?MDEV-377=20Name=20support=20for=20dynamic=20columns=20M?= =?UTF-8?q?DEV-127=20Optimization=20of=20memory=20allocation=20MDEV-483=20?= =?UTF-8?q?Make=20column=5Fcheck=20function=20which=20che=D1=81ks=20dynami?= =?UTF-8?q?c=20columns=20integrit=20JSON=20conversion=20function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/ma_dyncol.h | 32 ++++++++++++++++++++++++++++++++ include/my_sys.h | 6 ++++++ 2 files changed, 38 insertions(+) (limited to 'include') diff --git a/include/ma_dyncol.h b/include/ma_dyncol.h index 6174328d62a..b4b9df7da19 100644 --- a/include/ma_dyncol.h +++ b/include/ma_dyncol.h @@ -102,6 +102,13 @@ dynamic_column_create_many(DYNAMIC_COLUMN *str, uint *column_numbers, DYNAMIC_COLUMN_VALUE *values); +enum enum_dyncol_func_result +dynamic_column_create_many_fmt(DYNAMIC_COLUMN *str, + uint column_count, + uchar *column_keys, + DYNAMIC_COLUMN_VALUE *values, + my_bool names); + enum enum_dyncol_func_result dynamic_column_update(DYNAMIC_COLUMN *org, uint column_nr, DYNAMIC_COLUMN_VALUE *value); @@ -110,16 +117,30 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str, uint add_column_count, uint *column_numbers, DYNAMIC_COLUMN_VALUE *values); +enum enum_dyncol_func_result +dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str, + uint add_column_count, + void *column_keys, + DYNAMIC_COLUMN_VALUE *values, + my_bool string_keys); enum enum_dyncol_func_result dynamic_column_delete(DYNAMIC_COLUMN *org, uint column_nr); enum enum_dyncol_func_result dynamic_column_exists(DYNAMIC_COLUMN *org, uint column_nr); +enum enum_dyncol_func_result +dynamic_column_exists_str(DYNAMIC_COLUMN *str, LEX_STRING *name); +enum enum_dyncol_func_result +dynamic_column_exists_fmt(DYNAMIC_COLUMN *str, void *key, my_bool string_keys); /* List of not NULL columns */ enum enum_dyncol_func_result dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint); +enum enum_dyncol_func_result +dynamic_column_list_str(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_lexstr); +enum enum_dyncol_func_result +dynamic_column_list_fmt(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array, my_bool string_keys); /* if the column do not exists it is NULL @@ -127,6 +148,17 @@ dynamic_column_list(DYNAMIC_COLUMN *org, DYNAMIC_ARRAY *array_of_uint); enum enum_dyncol_func_result dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr, DYNAMIC_COLUMN_VALUE *store_it_here); +enum enum_dyncol_func_result +dynamic_column_get_str(DYNAMIC_COLUMN *str, LEX_STRING *name, + DYNAMIC_COLUMN_VALUE *store_it_here); + +my_bool dynamic_column_has_names(DYNAMIC_COLUMN *str); + +enum enum_dyncol_func_result +dynamic_column_check(DYNAMIC_COLUMN *str); + +enum enum_dyncol_func_result +dynamic_column_json(DYNAMIC_COLUMN *str, DYNAMIC_STRING *json); #define dynamic_column_initialize(A) memset((A), 0, sizeof(*(A))) #define dynamic_column_column_free(V) dynstr_free(V) diff --git a/include/my_sys.h b/include/my_sys.h index a02c390fe4b..58a343bb789 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -793,12 +793,18 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append, size_t length); extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...); +extern my_bool dynstr_append_quoted(DYNAMIC_STRING *str, + const char *append, size_t len); extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str); extern my_bool dynstr_realloc(DYNAMIC_STRING *str, size_t additional_size); extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); extern void dynstr_free(DYNAMIC_STRING *str); extern void dynstr_reassociate(DYNAMIC_STRING *str, char **res, size_t *length, size_t *alloc_length); +extern uint32 copy_and_convert_extended(char *to, uint32 to_length, + CHARSET_INFO *to_cs, + const char *from, uint32 from_length, + CHARSET_INFO *from_cs, uint *errors); #ifdef HAVE_MLOCK extern void *my_malloc_lock(size_t length,myf flags); extern void my_free_lock(void *ptr); -- cgit v1.2.1