Commit 50a2e8b1 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-32140: Valgrind/MSAN warnings in dynamic_column_update_move_left

Do not manipulate empty dynamic column, just better return empty dynamic column from the begining.
(it is also optimisation)
parent 9b5275b8
......@@ -1956,3 +1956,15 @@ DROP TABLE t1;
#
# End of 10.2 tests
#
#
# MDEV-32140: Valgrind/MSAN warnings in dynamic_column_update_move_left
#
SELECT COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL),3 AS INTEGER);
COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL),3 AS INTEGER)
NULL
SELECT HEX(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL));
HEX(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL))
000000
#
# End of 10.4 tests
#
......@@ -986,3 +986,13 @@ DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #
--echo #
--echo # MDEV-32140: Valgrind/MSAN warnings in dynamic_column_update_move_left
--echo #
SELECT COLUMN_GET(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL),3 AS INTEGER);
SELECT HEX(COLUMN_ADD(COLUMN_CREATE(1,10),2,NULL,1,NULL));
--echo #
--echo # End of 10.4 tests
--echo #
......@@ -2872,6 +2872,13 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan,
write= (uchar *)str->str + FIXED_HEADER_SIZE;
set_fixed_header(str, (uint)new_offset_size, new_column_count);
if (!new_column_count)
{
// No records left
DBUG_ASSERT(new_header_size == 0);
str->length= FIXED_HEADER_SIZE;
return ER_DYNCOL_OK;
}
/*
Move headers first.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment