1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-27 05:41:41 +03:00

MDEV-18737 Spider "Out of memory" on armv7hl (#1363)

This is an issue of memory alignment of variable argument when calling my_multi_malloc().
The fix is strictly casting allocating size to "uint".
This commit is contained in:
Kentoku SHIBA
2019-07-25 22:52:45 +09:00
committed by GitHub
parent 061a0f0b8d
commit ddce859076
12 changed files with 324 additions and 279 deletions

View File

@@ -588,16 +588,16 @@ int spider_db_oracle_row::init()
if (
!(ind = (sb2 *)
spider_bulk_malloc(spider_current_trx, 161, MYF(MY_WME | MY_ZEROFILL),
&ind, sizeof(sb2) * field_count,
&rlen, sizeof(ub2) * field_count,
&coltp, sizeof(ub2) * field_count,
&colsz, sizeof(ub2) * field_count,
&row_size, sizeof(ulong) * field_count,
&val, sizeof(char *) * field_count,
&tmp_val, MAX_FIELD_WIDTH * field_count,
&defnp, sizeof(OCIDefine *) * field_count,
&lobhp, sizeof(OCILobLocator *) * field_count,
&colhp, sizeof(OCIParam *) * field_count,
&ind, (uint) (sizeof(sb2) * field_count),
&rlen, (uint) (sizeof(ub2) * field_count),
&coltp, (uint) (sizeof(ub2) * field_count),
&colsz, (uint) (sizeof(ub2) * field_count),
&row_size, (uint) (sizeof(ulong) * field_count),
&val, (uint) (sizeof(char *) * field_count),
&tmp_val, (uint) (MAX_FIELD_WIDTH * field_count),
&defnp, (uint) (sizeof(OCIDefine *) * field_count),
&lobhp, (uint) (sizeof(OCILobLocator *) * field_count),
&colhp, (uint) (sizeof(OCIParam *) * field_count),
NullS)
) ||
!(val_str = new spider_string[field_count])
@@ -12519,7 +12519,7 @@ int spider_oracle_handler::init_union_table_name_pos()
if (!union_table_name_pos_first)
{
if (!spider_bulk_malloc(spider_current_trx, 238, MYF(MY_WME),
&union_table_name_pos_first, sizeof(SPIDER_INT_HLD),
&union_table_name_pos_first, (uint) (sizeof(SPIDER_INT_HLD)),
NullS)
) {
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
@@ -12540,7 +12540,7 @@ int spider_oracle_handler::set_union_table_name_pos()
if (!union_table_name_pos_current->next)
{
if (!spider_bulk_malloc(spider_current_trx, 239, MYF(MY_WME),
&union_table_name_pos_current->next, sizeof(SPIDER_INT_HLD),
&union_table_name_pos_current->next, (uint) (sizeof(SPIDER_INT_HLD)),
NullS)
) {
DBUG_RETURN(HA_ERR_OUT_OF_MEM);