Skip to content

Commit da087b1

Browse files
Sergey Glukhovdahlerlend
Sergey Glukhov
authored andcommitted
Bug#31451475 UBSAN ERROR IN I_JSON.ARRAY_INDEX-BUG31152942.
Fixed ubsan failures due to wrong typecasting. Reviewed-by: Tor Didriksen <[email protected]> Change-Id: I2fe29046260bcbc596fed555f0b521456c12271c
1 parent 353464b commit da087b1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

sql/field_conv.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ Copy_field::Copy_func *Copy_field::get_copy_func(bool save) {
646646
else
647647
return do_save_blob;
648648
}
649+
if (m_to_field->is_array() && m_from_field->is_array()) return do_save_blob;
649650

650651
bool compatible_db_low_byte_first =
651652
(m_to_field->table->s->db_low_byte_first ==

storage/temptable/src/column.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Column::Column(const unsigned char *mysql_row,
5252

5353
size_t data_offset;
5454

55-
m_is_blob = mysql_field.is_flag_set(BLOB_FLAG);
55+
m_is_blob = (mysql_field.is_flag_set(BLOB_FLAG) || mysql_field.is_array());
5656

5757
if (m_is_blob) {
5858
auto &blob_field = static_cast<const Field_blob &>(mysql_field);

0 commit comments

Comments
 (0)