mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-5404 Can't free data returned by mariadb_dyncol_unpack on windows
add mariadb_dyncol_unpack_free()
This commit is contained in:
parent
e853b6ccfd
commit
1fa1ea0f2d
4 changed files with 19 additions and 10 deletions
|
@ -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);
|
||||
*vals= 0;
|
||||
}
|
||||
if (*names)
|
||||
{
|
||||
my_free(*names);
|
||||
*names= 0;
|
||||
}
|
||||
mariadb_dyncol_unpack_free(*names, *vals);
|
||||
*vals= 0;
|
||||
*names= 0;
|
||||
}
|
||||
|
||||
int ha_cassandra::write_row(uchar *buf)
|
||||
|
|
Loading…
Add table
Reference in a new issue