Commit 9dbeb988 authored by unknown's avatar unknown

MDEV-4993:Impossible to free a dynamic column

Fix of API of dynamic columns (it made uniform and real function used to free the string).
parent ce0d5539
......@@ -126,11 +126,11 @@ dynamic_column_get(DYNAMIC_COLUMN *org, uint column_nr,
/* new functions */
enum enum_dyncol_func_result
mariadb_dyncol_create_many(DYNAMIC_COLUMN *str,
uint column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values,
my_bool new_string);
mariadb_dyncol_create_many_num(DYNAMIC_COLUMN *str,
uint column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values,
my_bool new_string);
enum enum_dyncol_func_result
mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
uint column_count,
......@@ -140,10 +140,10 @@ mariadb_dyncol_create_many_named(DYNAMIC_COLUMN *str,
enum enum_dyncol_func_result
mariadb_dyncol_update_many(DYNAMIC_COLUMN *str,
uint add_column_count,
uint *column_keys,
DYNAMIC_COLUMN_VALUE *values);
mariadb_dyncol_update_many_num(DYNAMIC_COLUMN *str,
uint add_column_count,
uint *column_keys,
DYNAMIC_COLUMN_VALUE *values);
enum enum_dyncol_func_result
mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
uint add_column_count,
......@@ -152,13 +152,13 @@ mariadb_dyncol_update_many_named(DYNAMIC_COLUMN *str,
enum enum_dyncol_func_result
mariadb_dyncol_exists(DYNAMIC_COLUMN *org, uint column_nr);
mariadb_dyncol_exists_num(DYNAMIC_COLUMN *org, uint column_nr);
enum enum_dyncol_func_result
mariadb_dyncol_exists_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name);
/* List of not NULL columns */
enum enum_dyncol_func_result
mariadb_dyncol_list(DYNAMIC_COLUMN *str, uint *count, uint **nums);
mariadb_dyncol_list_num(DYNAMIC_COLUMN *str, uint *count, uint **nums);
enum enum_dyncol_func_result
mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count,
MYSQL_LEX_STRING **names);
......@@ -167,8 +167,8 @@ mariadb_dyncol_list_named(DYNAMIC_COLUMN *str, uint *count,
if the column do not exists it is NULL
*/
enum enum_dyncol_func_result
mariadb_dyncol_get(DYNAMIC_COLUMN *org, uint column_nr,
DYNAMIC_COLUMN_VALUE *store_it_here);
mariadb_dyncol_get_num(DYNAMIC_COLUMN *org, uint column_nr,
DYNAMIC_COLUMN_VALUE *store_it_here);
enum enum_dyncol_func_result
mariadb_dyncol_get_named(DYNAMIC_COLUMN *str, MYSQL_LEX_STRING *name,
DYNAMIC_COLUMN_VALUE *store_it_here);
......@@ -181,8 +181,8 @@ mariadb_dyncol_check(DYNAMIC_COLUMN *str);
enum enum_dyncol_func_result
mariadb_dyncol_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)
#define mariadb_dyncol_init(A) memset((A), 0, sizeof(*(A)))
void mariadb_dyncol_free(DYNAMIC_COLUMN *str);
/* conversion of values to 3 base types */
enum enum_dyncol_func_result
......
......@@ -223,15 +223,16 @@ dynamic_column_exists
dynamic_column_list
dynamic_column_get
dynamic_column_prepare_decimal
mariadb_dyncol_create_many
mariadb_dyncol_create_many_num
mariadb_dyncol_create_many_named
mariadb_dyncol_update_many
mariadb_dyncol_update_many_num
mariadb_dyncol_update_many_named
mariadb_dyncol_exists
mariadb_dyncol_exists_num
mariadb_dyncol_exists_named
mariadb_dyncol_list
mariadb_dyncol_free
mariadb_dyncol_list_num
mariadb_dyncol_list_named
mariadb_dyncol_get
mariadb_dyncol_get_num
mariadb_dyncol_get_named
mariadb_dyncol_has_names
mariadb_dyncol_check
......
......@@ -1632,7 +1632,7 @@ dynamic_new_column_store(DYNAMIC_COLUMN *str,
}
else
{
dynamic_column_initialize(str);
mariadb_dyncol_init(str);
}
}
else
......@@ -1789,7 +1789,7 @@ dynamic_column_create_many_internal_fmt(DYNAMIC_COLUMN *str,
if (new_str)
{
/* to make dynstr_free() working in case of errors */
bzero(str, sizeof(DYNAMIC_COLUMN));
mariadb_dyncol_init(str);
}
if ((rc= calc_var_sizes(&header, column_count, column_keys, values)) < 0)
......@@ -1838,13 +1838,13 @@ dynamic_column_create_many(DYNAMIC_COLUMN *str,
*/
enum enum_dyncol_func_result
mariadb_dyncol_create_many(DYNAMIC_COLUMN *str,
uint column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values,
my_bool new_string)
mariadb_dyncol_create_many_num(DYNAMIC_COLUMN *str,
uint column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values,
my_bool new_string)
{
DBUG_ENTER("mariadb_dyncol_create_many");
DBUG_ENTER("mariadb_dyncol_create_many_num");
DBUG_RETURN(dynamic_column_create_many_internal_fmt(str, column_count,
column_numbers, values,
new_string, FALSE));
......@@ -2199,8 +2199,8 @@ dynamic_column_get(DYNAMIC_COLUMN *str, uint column_nr,
}
enum enum_dyncol_func_result
mariadb_dyncol_get(DYNAMIC_COLUMN *str, uint column_nr,
DYNAMIC_COLUMN_VALUE *store_it_here)
mariadb_dyncol_get_num(DYNAMIC_COLUMN *str, uint column_nr,
DYNAMIC_COLUMN_VALUE *store_it_here)
{
return dynamic_column_get_internal(str, store_it_here, column_nr, NULL);
}
......@@ -2328,7 +2328,7 @@ dynamic_column_exists(DYNAMIC_COLUMN *str, uint column_nr)
}
enum enum_dyncol_func_result
mariadb_dyncol_exists(DYNAMIC_COLUMN *str, uint column_nr)
mariadb_dyncol_exists_num(DYNAMIC_COLUMN *str, uint column_nr)
{
return dynamic_column_exists_internal(str, column_nr, NULL);
}
......@@ -2438,7 +2438,7 @@ dynamic_column_list(DYNAMIC_COLUMN *str, DYNAMIC_ARRAY *array_of_uint)
@return ER_DYNCOL_* return code
*/
enum enum_dyncol_func_result
mariadb_dyncol_list(DYNAMIC_COLUMN *str, uint *count, uint **nums)
mariadb_dyncol_list_num(DYNAMIC_COLUMN *str, uint *count, uint **nums)
{
DYN_HEADER header;
uchar *read;
......@@ -2841,11 +2841,11 @@ dynamic_column_update_copy(DYNAMIC_COLUMN *str, PLAN *plan,
}
}
}
dynamic_column_column_free(str);
mariadb_dyncol_free(str);
*str= tmp;
return ER_DYNCOL_OK;
err:
dynamic_column_column_free(&tmp);
mariadb_dyncol_free(&tmp);
return ER_DYNCOL_FORMAT;
}
......@@ -3257,10 +3257,10 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
}
enum enum_dyncol_func_result
mariadb_dyncol_update_many(DYNAMIC_COLUMN *str,
uint add_column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values)
mariadb_dyncol_update_many_num(DYNAMIC_COLUMN *str,
uint add_column_count,
uint *column_numbers,
DYNAMIC_COLUMN_VALUE *values)
{
return dynamic_column_update_many_fmt(str, add_column_count, column_numbers,
values, FALSE);
......@@ -4336,3 +4336,12 @@ mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count)
*column_count= header.column_count;
return rc;
}
/**
Free dynamic column
@param str The packed string
*/
void mariadb_dyncol_free(DYNAMIC_COLUMN *str)
{
dynstr_free(str);
}
......@@ -6309,7 +6309,7 @@ longlong Item_func_dyncol_exists::val_int()
/* We do not change the string, so could do this trick */
col.str= (char *)str->ptr();
rc= ((name == NULL) ?
mariadb_dyncol_exists(&col, (uint) num) :
mariadb_dyncol_exists_num(&col, (uint) num) :
mariadb_dyncol_exists_named(&col, name));
if (rc < 0)
{
......
......@@ -4220,11 +4220,11 @@ String *Item_func_dyncol_create::val_str(String *str)
if ((rc= ((names || force_names) ?
mariadb_dyncol_create_many_named(&col, column_count, keys_str,
vals, TRUE) :
mariadb_dyncol_create_many(&col, column_count, keys_num,
vals, TRUE))))
mariadb_dyncol_create_many_num(&col, column_count, keys_num,
vals, TRUE))))
{
dynamic_column_error_message(rc);
dynamic_column_column_free(&col);
mariadb_dyncol_free(&col);
res= NULL;
null_value= TRUE;
}
......@@ -4363,11 +4363,11 @@ String *Item_func_dyncol_add::val_str(String *str)
if ((rc= ((names || force_names) ?
mariadb_dyncol_update_many_named(&col, column_count,
keys_str, vals) :
mariadb_dyncol_update_many(&col, column_count,
keys_num, vals))))
mariadb_dyncol_update_many_num(&col, column_count,
keys_num, vals))))
{
dynamic_column_error_message(rc);
dynamic_column_column_free(&col);
mariadb_dyncol_free(&col);
goto null;
}
......@@ -4470,7 +4470,7 @@ bool Item_dyncol_get::get_dyn_value(DYNAMIC_COLUMN_VALUE *val, String *tmp)
dyn_str.str= (char*) res->ptr();
dyn_str.length= res->length();
if ((rc= ((name == NULL) ?
mariadb_dyncol_get(&dyn_str, (uint) num, val) :
mariadb_dyncol_get_num(&dyn_str, (uint) num, val) :
mariadb_dyncol_get_named(&dyn_str, name, val))))
{
dynamic_column_error_message(rc);
......
......@@ -42,17 +42,17 @@ void test_value_single_null()
val.type= DYN_COL_NULL;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= (res.type == DYN_COL_NULL);
err:
ok(rc, "%s", "NULL");
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
void test_value_single_uint(ulonglong num, const char *name)
......@@ -66,18 +66,18 @@ void test_value_single_uint(ulonglong num, const char *name)
val.x.ulong_value= num;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= (res.type == DYN_COL_UINT) && (res.x.ulong_value == num);
num= res.x.ulong_value;
err:
ok(rc, "%s - %llu", name, num);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
void test_value_single_sint(longlong num, const char *name)
......@@ -91,18 +91,18 @@ void test_value_single_sint(longlong num, const char *name)
val.x.long_value= num;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= (res.type == DYN_COL_INT) && (res.x.long_value == num);
num= res.x.ulong_value;
err:
ok(rc, "%s - %lld", name, num);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
......@@ -117,18 +117,18 @@ void test_value_single_double(double num, const char *name)
val.x.double_value= num;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= (res.type == DYN_COL_DOUBLE) && (res.x.double_value == num);
num= res.x.ulong_value;
err:
ok(rc, "%s - %lf", name, num);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
void test_value_single_decimal(const char *num)
......@@ -148,11 +148,11 @@ void test_value_single_decimal(const char *num)
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= ((res.type == DYN_COL_DECIMAL) &&
(decimal_cmp(&res.x.decimal.value, &val.x.decimal.value) == 0));
......@@ -160,7 +160,7 @@ void test_value_single_decimal(const char *num)
err:
ok(rc, "%s - %s", num, buff);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
static CHARSET_INFO *charset_list[]=
......@@ -223,11 +223,11 @@ void test_value_single_string(const char *string, size_t len,
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= ((res.type == DYN_COL_STRING) &&
(res.x.string.value.length == len) &&
......@@ -239,7 +239,7 @@ void test_value_single_string(const char *string, size_t len,
(uint)res.x.string.charset->number, res.x.string.charset->name);
/* cleanup */
val.x.string.value.str= NULL; // we did not allocated it
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
void test_value_single_date(uint year, uint month, uint day, const char *name)
......@@ -256,11 +256,11 @@ void test_value_single_date(uint year, uint month, uint day, const char *name)
val.x.time_value.day= day;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= ((res.type == DYN_COL_DATE) &&
(res.x.time_value.time_type == MYSQL_TIMESTAMP_DATE) &&
......@@ -270,7 +270,7 @@ void test_value_single_date(uint year, uint month, uint day, const char *name)
err:
ok(rc, "%s - %04u-%02u-%02u", name, year, month, day);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
void test_value_single_time(uint neg, uint hour, uint minute, uint second,
......@@ -290,11 +290,11 @@ void test_value_single_time(uint neg, uint hour, uint minute, uint second,
val.x.time_value.second_part= mic;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= ((res.type == DYN_COL_TIME) &&
(res.x.time_value.time_type == MYSQL_TIMESTAMP_TIME) &&
......@@ -307,7 +307,7 @@ void test_value_single_time(uint neg, uint hour, uint minute, uint second,
ok(rc, "%s - %c%02u:%02u:%02u.%06u", name, (neg ? '-' : '+'),
hour, minute, second, mic);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
......@@ -332,11 +332,11 @@ void test_value_single_datetime(uint neg, uint year, uint month, uint day,
val.x.time_value.second_part= mic;
mariadb_dyncol_value_init(&res);
/* create column */
if (mariadb_dyncol_create_many(&str, 1, ids, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, ids, &val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
if (mariadb_dyncol_get(&str, 1, &res))
if (mariadb_dyncol_get_num(&str, 1, &res))
goto err;
rc= ((res.type == DYN_COL_DATETIME) &&
(res.x.time_value.time_type == MYSQL_TIMESTAMP_DATETIME) &&
......@@ -352,7 +352,7 @@ void test_value_single_datetime(uint neg, uint year, uint month, uint day,
ok(rc, "%s - %c %04u-%02u-%02u %02u:%02u:%02u.%06u", name, (neg ? '-' : '+'),
year, month, day, hour, minute, second, mic);
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
......@@ -415,12 +415,12 @@ void test_value_multi(ulonglong num0,
for (i= 0; i < 9; i++)
mariadb_dyncol_value_init(res + i);
/* create column */
if (mariadb_dyncol_create_many(&str, 9, column_numbers, val, 1))
if (mariadb_dyncol_create_many_num(&str, 9, column_numbers, val, 1))
goto err;
dynstr_append(&str, "\1"); str.length--; //check for overflow
/* read column */
for (i= 0; i < 9; i++)
if (mariadb_dyncol_get(&str, column_numbers[i], res + i))
if (mariadb_dyncol_get_num(&str, column_numbers[i], res + i))
goto err;
rc= ((res[0].type == DYN_COL_UINT) &&
(res[0].x.ulong_value == num0) &&
......@@ -461,7 +461,7 @@ void test_value_multi(ulonglong num0,
ok(rc, "%s", name);
/* cleanup */
val[4].x.string.value.str= NULL; // we did not allocated it
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
......@@ -476,13 +476,13 @@ void test_value_multi_same_num()
for (i= 0; i < 5; i++)
val[i].type= DYN_COL_NULL;
/* create column */
if (!mariadb_dyncol_create_many(&str, 5, column_numbers, val, 1))
if (!mariadb_dyncol_create_many_num(&str, 5, column_numbers, val, 1))
goto err;
rc= TRUE;
err:
ok(rc, "%s", "same column numbers check");
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
......@@ -496,38 +496,38 @@ void test_update_multi(uint *column_numbers, uint *column_values,
val.type= DYN_COL_UINT;
val.x.ulong_value= column_values[0];
if (mariadb_dyncol_create_many(&str, 1, column_numbers, &val, 1))
if (mariadb_dyncol_create_many_num(&str, 1, column_numbers, &val, 1))
goto err;
for (i= 1; i < all; i++)
{
val.type= (null_values[i] ? DYN_COL_NULL : DYN_COL_UINT);
val.x.ulong_value= column_values[i];
if (mariadb_dyncol_update_many(&str, 1, column_numbers +i, &val))
if (mariadb_dyncol_update_many_num(&str, 1, column_numbers +i, &val))
goto err;
/* check value(s) */
for (j= i; j >= (i < only_add ? 0 : i); j--)
{
if (mariadb_dyncol_get(&str, column_numbers[j], &val))
if (mariadb_dyncol_get_num(&str, column_numbers[j], &val))
goto err;
if (null_values[j])
{
if (val.type != DYN_COL_NULL ||
mariadb_dyncol_exists(&str, column_numbers[j]) == ER_DYNCOL_YES)
mariadb_dyncol_exists_num(&str, column_numbers[j]) == ER_DYNCOL_YES)
goto err;
}
else
{
if (val.type != DYN_COL_UINT ||
val.x.ulong_value != column_values[j] ||
mariadb_dyncol_exists(&str, column_numbers[j]) == ER_DYNCOL_NO)
mariadb_dyncol_exists_num(&str, column_numbers[j]) == ER_DYNCOL_NO)
goto err;
}
}
if (i < only_add)
{
uint elements, *num;
if (mariadb_dyncol_list(&str, &elements, &num))
if (mariadb_dyncol_list_num(&str, &elements, &num))
{
my_free(num);
goto err;
......@@ -566,7 +566,7 @@ void test_update_multi(uint *column_numbers, uint *column_values,
err:
ok(rc, "%s", "add/delete/update");
/* cleanup */
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
void test_empty_string()
......@@ -581,29 +581,29 @@ void test_empty_string()
/* empty string */
bzero(&str, sizeof(str));
rc= mariadb_dyncol_get(&str, 1, &res);
rc= mariadb_dyncol_get_num(&str, 1, &res);
ok( (rc == ER_DYNCOL_OK) && (res.type == DYN_COL_NULL), "%s", "empty get");
vals[0].type= DYN_COL_NULL;
rc= mariadb_dyncol_update_many(&str, 1, ids, vals);
rc= mariadb_dyncol_update_many_num(&str, 1, ids, vals);
ok( (rc == ER_DYNCOL_OK) && (str.str == 0), "%s", "empty delete");
rc= mariadb_dyncol_exists(&str, 1);
rc= mariadb_dyncol_exists_num(&str, 1);
ok( (rc == ER_DYNCOL_NO), "%s", "empty exists");
rc= mariadb_dyncol_list(&str, &number_of_uint, &array_of_uint);
rc= mariadb_dyncol_list_num(&str, &number_of_uint, &array_of_uint);
ok( (rc == ER_DYNCOL_OK) && (number_of_uint == 0) && (str.str == 0),
"%s", "empty list");
val.type= DYN_COL_UINT;
val.x.ulong_value= 1212;
rc= mariadb_dyncol_update_many(&str, 1, ids, &val);
rc= mariadb_dyncol_update_many_num(&str, 1, ids, &val);
if (rc == ER_DYNCOL_OK)
rc= mariadb_dyncol_get(&str, 1, &res);
rc= mariadb_dyncol_get_num(&str, 1, &res);
ok( (rc == ER_DYNCOL_OK) && (str.str != 0) &&
(res.type == DYN_COL_UINT) && (res.x.ulong_value == val.x.ulong_value),
"%s", "empty update");
dynamic_column_column_free(&str);
mariadb_dyncol_free(&str);
}
static void test_mdev_4994()
......@@ -615,10 +615,10 @@ static void test_mdev_4994()
val.type= DYN_COL_NULL;
dynamic_column_initialize(&dyncol);
mariadb_dyncol_init(&dyncol);
rc= mariadb_dyncol_create_many_named(&dyncol, 1, &key, &val, 0); /* crash */
ok( (rc == ER_DYNCOL_OK), "%s", "test_mdev_4994");
dynamic_column_column_free(&dyncol);
mariadb_dyncol_free(&dyncol);
}
static void test_mdev_4995()
......@@ -627,7 +627,7 @@ static void test_mdev_4995()
uint column_count= 5;
int rc;
dynamic_column_initialize(&dyncol);
mariadb_dyncol_init(&dyncol);
rc= mariadb_dyncol_column_count(&dyncol,&column_count);
ok( (rc == ER_DYNCOL_OK), "%s", "test_mdev_4995");
......@@ -674,11 +674,11 @@ void test_update_many(uint *column_numbers, uint *column_values,
res[i].type= DYN_COL_UINT;
res[i].x.ulong_value= result_values[i];
}
if (mariadb_dyncol_create_many(&str1, column_count, column_numbers, val, 1))
if (mariadb_dyncol_create_many_num(&str1, column_count, column_numbers, val, 1))
goto err;
if (mariadb_dyncol_update_many(&str1, update_count, update_numbers, upd))
if (mariadb_dyncol_update_many_num(&str1, update_count, update_numbers, upd))
goto err;
if (mariadb_dyncol_create_many(&str2, result_count, result_numbers, res, 1))
if (mariadb_dyncol_create_many_num(&str2, result_count, result_numbers, res, 1))
goto err;
if (str1.length == str2.length &&
memcmp(str1.str, str2.str, str1.length) ==0)
......@@ -687,8 +687,8 @@ void test_update_many(uint *column_numbers, uint *column_values,
err:
ok(rc, "%s", "update_many");
/* cleanup */
dynamic_column_column_free(&str1);
dynamic_column_column_free(&str2);
mariadb_dyncol_free(&str1);
mariadb_dyncol_free(&str2);
}
int main(int argc __attribute__((unused)), char **argv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment