mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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:
@@ -390,12 +390,15 @@ int spider_udf_get_copy_tgt_tables(
|
||||
do {
|
||||
if (!(table_conn = (SPIDER_COPY_TABLE_CONN *)
|
||||
spider_bulk_malloc(spider_current_trx, 25, MYF(MY_WME | MY_ZEROFILL),
|
||||
&table_conn, sizeof(SPIDER_COPY_TABLE_CONN),
|
||||
&tmp_share, sizeof(SPIDER_SHARE),
|
||||
&tmp_connect_info, sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT,
|
||||
&tmp_connect_info_length, sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT,
|
||||
&tmp_long, sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT,
|
||||
&tmp_longlong, sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT,
|
||||
&table_conn, (uint) (sizeof(SPIDER_COPY_TABLE_CONN)),
|
||||
&tmp_share, (uint) (sizeof(SPIDER_SHARE)),
|
||||
&tmp_connect_info,
|
||||
(uint) (sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT),
|
||||
&tmp_connect_info_length,
|
||||
(uint) (sizeof(uint) * SPIDER_TMP_SHARE_UINT_COUNT),
|
||||
&tmp_long, (uint) (sizeof(long) * SPIDER_TMP_SHARE_LONG_COUNT),
|
||||
&tmp_longlong,
|
||||
(uint) (sizeof(longlong) * SPIDER_TMP_SHARE_LONGLONG_COUNT),
|
||||
NullS))
|
||||
) {
|
||||
spider_sys_index_end(table_tables);
|
||||
@@ -706,12 +709,12 @@ int spider_udf_copy_tables_create_table_list(
|
||||
if (!(copy_tables->link_idxs[0] = (int *)
|
||||
spider_bulk_malloc(spider_current_trx, 26, MYF(MY_WME | MY_ZEROFILL),
|
||||
©_tables->link_idxs[0],
|
||||
sizeof(int) * copy_tables->link_idx_count[0],
|
||||
(uint) (sizeof(int) * copy_tables->link_idx_count[0]),
|
||||
©_tables->link_idxs[1],
|
||||
sizeof(int) * copy_tables->link_idx_count[1],
|
||||
&tmp_name_ptr, sizeof(char) * (
|
||||
(uint) (sizeof(int) * copy_tables->link_idx_count[1]),
|
||||
&tmp_name_ptr, (uint) (sizeof(char) * (
|
||||
spider_table_name_length * 2 + copy_tables->database_length + 3
|
||||
),
|
||||
)),
|
||||
NullS))
|
||||
) {
|
||||
my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
|
||||
@@ -906,7 +909,7 @@ long long spider_copy_tables_body(
|
||||
|
||||
if (!(copy_tables = (SPIDER_COPY_TABLES *)
|
||||
spider_bulk_malloc(spider_current_trx, 27, MYF(MY_WME | MY_ZEROFILL),
|
||||
©_tables, sizeof(SPIDER_COPY_TABLES),
|
||||
©_tables, (uint) (sizeof(SPIDER_COPY_TABLES)),
|
||||
NullS))
|
||||
) {
|
||||
my_error(ER_OUT_OF_RESOURCES, MYF(0), HA_ERR_OUT_OF_MEM);
|
||||
|
Reference in New Issue
Block a user