Commit 1fa1ea0f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5404 Can't free data returned by mariadb_dyncol_unpack on windows

add mariadb_dyncol_unpack_free()
parent e853b6cc
......@@ -220,6 +220,9 @@ mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
uint *count,
MYSQL_LEX_STRING **names, DYNAMIC_COLUMN_VALUE **vals);
void mariadb_dyncol_unpack_free(MYSQL_LEX_STRING *names,
DYNAMIC_COLUMN_VALUE *vals);
int mariadb_dyncol_column_cmp_named(const MYSQL_LEX_STRING *s1,
const MYSQL_LEX_STRING *s2);
......
......@@ -248,6 +248,7 @@ mariadb_dyncol_val_str
mariadb_dyncol_val_long
mariadb_dyncol_val_double
mariadb_dyncol_unpack
mariadb_dyncol_unpack_free
mariadb_dyncol_column_cmp_named
mariadb_dyncol_column_count
mariadb_dyncol_prepare_decimal
......
......@@ -4316,6 +4316,18 @@ err:
return rc;
}
/**
Free arrays allocated by mariadb_dyncol_unpack()
@param names Where to put names (should be free by user)
@param vals Where to put values (should be free by user)
*/
void mariadb_dyncol_unpack_free(LEX_STRING *names, DYNAMIC_COLUMN_VALUE *vals)
{
my_free(names);
my_free(vals);
}
/**
Get not NULL column count
......
......@@ -1925,16 +1925,9 @@ int ha_cassandra::write_dynamic_row(uint count,
void ha_cassandra::free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals,
LEX_STRING **names)
{
if (*vals)
{
my_free(*vals);
mariadb_dyncol_unpack_free(*names, *vals);
*vals= 0;
}
if (*names)
{
my_free(*names);
*names= 0;
}
}
int ha_cassandra::write_row(uchar *buf)
......
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