mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#52520 Difference in tinytext utf column metadata
Problems: - regression (compating to version 5.1) in metadata for BLOB types - inconsistency between length metadata in server and embedded for BLOB types - wrong max_length calculation in items derived from BLOB columns @ libmysqld/lib_sql.cc Calculating length metadata in embedded similary to server version, using new function char_to_byte_length_safe(). @ mysql-test/r/ctype_utf16.result Adding tests @ mysql-test/r/ctype_utf32.result Adding tests @ mysql-test/r/ctype_utf8.result Adding tests @ mysql-test/r/ctype_utf8mb4.result Adding tests @ mysql-test/t/ctype_utf16.test Adding tests @ mysql-test/t/ctype_utf32.test Adding tests @ mysql-test/t/ctype_utf8.test Adding tests @ mysql-test/t/ctype_utf8mb4.test Adding tests @ sql/field.cc Overriding char_length() for Field_blob: unlike in generic Item::char_length() we don't divide to mbmaxlen for BLOBs. @ sql/field.h - Making Field::char_length() virtual - Adding prototype for Field_blob::char_length() @ sql/item.h - Adding new helper function char_to_byte_length_safe() - Using new function @ sql/protocol.cc Using new function char_to_byte_length_safe(). modified: libmysqld/lib_sql.cc mysql-test/r/ctype_utf16.result mysql-test/r/ctype_utf32.result mysql-test/r/ctype_utf8.result mysql-test/r/ctype_utf8mb4.result mysql-test/t/ctype_utf16.test mysql-test/t/ctype_utf32.test mysql-test/t/ctype_utf8.test mysql-test/t/ctype_utf8mb4.test sql/field.cc sql/field.h sql/item.h sql/protocol.cc
This commit is contained in:
@ -499,7 +499,7 @@ public:
|
||||
longlong convert_decimal2longlong(const my_decimal *val, bool unsigned_flag,
|
||||
int *err);
|
||||
/* The max. number of characters */
|
||||
inline uint32 char_length() const
|
||||
virtual uint32 char_length()
|
||||
{
|
||||
return field_length / charset()->mbmaxlen;
|
||||
}
|
||||
@ -1813,6 +1813,7 @@ public:
|
||||
bool has_charset(void) const
|
||||
{ return charset() == &my_charset_bin ? FALSE : TRUE; }
|
||||
uint32 max_display_length();
|
||||
uint32 char_length();
|
||||
uint is_equal(Create_field *new_field);
|
||||
inline bool in_read_set() { return bitmap_is_set(table->read_set, field_index); }
|
||||
inline bool in_write_set() { return bitmap_is_set(table->write_set, field_index); }
|
||||
|
Reference in New Issue
Block a user