1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-34914 maria.bulk_insert_crash fails on s390x (10.6+, Debug)

This was caused by a wrong handling of bitmaps in
copy_not_changed_fields() that did not work on big endian machines.
This bug caused recovery of Aria files to fail on big endian machines
like s390x or Sparc.

This issue was noticed by the bulk_insert_crash.test on the
s390x builder.
This commit is contained in:
Monty
2025-09-04 17:05:52 +03:00
parent d00e0f71a4
commit 8f771b28a1
4 changed files with 9 additions and 9 deletions

View File

@@ -1,6 +1,9 @@
create table t1 (a int primary key, b int, c int, unique key(b), key(c)) engine=aria transactional=1;
insert into t1 values (1000,1000,1000);
insert into t1 select seq,seq+100, seq+200 from seq_1_to_10;
select sum(a),sum(b),sum(c) from t1;
sum(a) sum(b) sum(c)
1055 2055 3055
SET GLOBAL debug_dbug="+d,crash_end_bulk_insert";
REPLACE into t1 select seq+20,seq+95, seq + 300 from seq_1_to_10;
ERROR HY000: Lost connection to server during query

View File

@@ -18,6 +18,8 @@ create table t1 (a int primary key, b int, c int, unique key(b), key(c)) engine=
insert into t1 values (1000,1000,1000);
insert into t1 select seq,seq+100, seq+200 from seq_1_to_10;
select sum(a),sum(b),sum(c) from t1;
# Insert into t1 with batch insert where we get a rows replaced after
# a few sucessful inserts

View File

@@ -199,6 +199,7 @@ err:
/* don't touch anything more, in case we hit a bug */
fprintf(stderr, "%s: FAILED\n", my_progname_short);
free_tmpdir(&maria_chk_tmpdir);
my_hash_free(&tables_to_redo);
free_defaults(default_argv);
exit(1);
}

View File

@@ -953,14 +953,13 @@ void copy_not_changed_fields(MARIA_HA *info, MY_BITMAP *changed_fields,
uchar *to, uchar *from)
{
MARIA_COLUMNDEF *column, *end_column;
uchar *bitmap= (uchar*) changed_fields->bitmap;
MARIA_SHARE *share= info->s;
uint bit= 1;
uint bit= 0;
for (column= share->columndef, end_column= column+ share->base.fields;
column < end_column; column++)
column < end_column; column++, bit++)
{
if (!(*bitmap & bit))
if (!bitmap_is_set(changed_fields, bit))
{
uint field_length= column->length;
if (column->type == FIELD_VARCHAR)
@@ -972,11 +971,6 @@ void copy_not_changed_fields(MARIA_HA *info, MY_BITMAP *changed_fields,
}
memcpy(to + column->offset, from + column->offset, field_length);
}
if ((bit= (bit << 1)) == 256)
{
bitmap++;
bit= 1;
}
}
}