mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-33623 Partitioning is broken on big endian architectures
MDEV-33502 Slowdown when running nested statement with many partitions caused this error as I failed to take into account bigendian architectures. This patch also introduces bitmap_import() and bitmap_export() to be used when one wants to store bitmaps in files/logs in a portable way. Reviewed-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
@@ -512,10 +512,14 @@ error:
|
||||
|
||||
my_bool test_copy(MY_BITMAP *map, uint bitsize)
|
||||
{
|
||||
my_bitmap_map buff[16];
|
||||
MY_BITMAP map2;
|
||||
my_bitmap_map buff[16], buff2[16], buff3[16];
|
||||
MY_BITMAP map2, map3;
|
||||
uint rnd_bit;
|
||||
|
||||
my_bitmap_init(&map2, buff, sizeof(buff)*8, FALSE);
|
||||
memset((void*) buff, 0xff, sizeof(buff));
|
||||
my_bitmap_init(&map3, buff2, sizeof(buff)*8, FALSE);
|
||||
bitmap_set_all(&map2);
|
||||
bitmap_set_all(&map3);
|
||||
|
||||
bitsize= MY_MIN(bitsize, map2.n_bits);
|
||||
bitmap_copy(map, &map2);
|
||||
@@ -524,6 +528,15 @@ my_bool test_copy(MY_BITMAP *map, uint bitsize)
|
||||
diag("bitmap_copy failed on bitsize %d", bitsize);
|
||||
return 1;
|
||||
}
|
||||
bitmap_set_prefix(&map2, rnd_bit= get_rand_bit(bitsize)+1);
|
||||
bitmap_export((uchar*) buff3, &map2);
|
||||
bitmap_import(&map3, (uchar*) buff3);
|
||||
if (!bitmap_cmp(&map2, &map3))
|
||||
{
|
||||
diag("bitmap_export/bitmap_import failed on bitsize %d rnd_bit: %d",
|
||||
bitsize, rnd_bit);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -639,6 +652,7 @@ my_bool do_test(uint bitsize)
|
||||
bitmap_clear_all(&map);
|
||||
if (test_copy(&map,bitsize))
|
||||
goto error;
|
||||
bitmap_clear_all(&map);
|
||||
if (test_bitmap_exists_intersection(&map, bitsize))
|
||||
goto error;
|
||||
return FALSE;
|
||||
|
Reference in New Issue
Block a user