mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-21831: Assertion `length == pack_length()' failed in Field_inet6::sort_string upon INSERT into RocksDB table
For INET6 columns the values are stored as BINARY columns and returned to the client in TEXT format. For rocksdb the indexes store mem-comparable images for columns, so use the pack_length() to store the mem-comparable form for INET6 columns. This would also remain consistent with CHAR columns.
This commit is contained in:
@@ -3317,7 +3317,9 @@ bool Rdb_field_packing::setup(const Rdb_key_def *const key_descr,
|
||||
field->field_length = field->char_length() * cs->mbmaxlen.
|
||||
*/
|
||||
const CHARSET_INFO *cs = field->charset();
|
||||
m_max_image_len = cs->strnxfrmlen(field->field_length);
|
||||
m_max_image_len = cs->strnxfrmlen(type == MYSQL_TYPE_STRING ?
|
||||
field->pack_length() :
|
||||
field->field_length);
|
||||
}
|
||||
const bool is_varchar = (type == MYSQL_TYPE_VARCHAR);
|
||||
const CHARSET_INFO *cs = field->charset();
|
||||
|
Reference in New Issue
Block a user