Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
The code in sql_show.cc displaying INFORMATION_SCHEMA.COLUMNS.CHARACTER_OCTET_LENGTH and INFORMATION_SCHEMA.COLUMNS.CHARACTER_MAXIMUM_LENGTH:
- tests field->type() and field->real_type() for various hard-coded constant MYSQL_TYPE_XXX
- uses max_display_length() with special tricks for the BLOB data types, e.g.:
uint32 octet_max_length= field->max_display_length();
if (is_blob && octet_max_length != (uint32) UINT_MAX32)
octet_max_length /= field->charset()->mbmaxlen;
where the test for UINT_MAX32 is a workaround to address a special behavior of Field_blob::max_display_length() for LONGBLOB.
- Uses has_charset() to detect data types which need NULL to be displayed in the mentioned I_S columns.
This is non friendly to pluggable data types.
Also, this makes it hard to fix bugs in max_display_length().
Under terms of this task we'll move the code in sql_show.cc into a new virtual method in Field:
virtual Information_schema_character_attributes
|
information_schema_character_attributes();
|
where Information_schema_character_attributes is a new class with approximately this structure:
class Information_schema_character_attributes
|
{
|
uint32 m_octet_length;
|
uint32 m_char_length;
|
bool m_has_octet_length;
|
bool m_has_char_length;
|
public: |
.. constructors and access methods .. |
}
|
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
- relates to
-
MDEV-13232 Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)->thread)' failed in _ma_state_info_write
- Closed