summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2010-06-02 16:23:50 +0400
committerAlexander Barkov <bar@mysql.com>2010-06-02 16:23:50 +0400
commiteed26e92a61344b9b12374504ba12da24e729bb9 (patch)
treef491a7947edaa201f68c7b3d9485a598a4b66c4e /sql/field.h
parente01117534cf250f41c3339f2147f116a180aaf98 (diff)
downloadmariadb-git-eed26e92a61344b9b12374504ba12da24e729bb9.tar.gz
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
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h
index 66b13d02b89..46d8a2aa6d9 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -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); }