Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
This code in sql_table.cc is not friendly to data type plugins:
if ((sql_field->real_field_type() != MYSQL_TYPE_STRING && |
sql_field->real_field_type() != MYSQL_TYPE_VARCHAR &&
|
!f_is_blob(sql_field->pack_flag)) ||
|
sql_field->charset == &my_charset_bin ||
|
sql_field->charset->mbminlen > 1 || // ucs2 doesn't work yet |
(ft_key_charset && sql_field->charset != ft_key_charset))
|
{
|
my_error(ER_BAD_FT_COLUMN, MYF(0), column->field_name.str);
|
DBUG_RETURN(-1);
|
}
|
ft_key_charset=sql_field->charset;
|
/*
|
for fulltext keys keyseg length is 1 for blobs (it's ignored in ft |
code anyway, and 0 (set to column width later) for char's. it has |
to be correct col width for char's, as char data are not prefixed |
with length (unlike blobs, where ft code takes data length from a |
data prefix, ignoring column->length). |
*/
|
column->length= MY_TEST(f_is_blob(sql_field->pack_flag)); |
New data types will reuse the same type codes. For example, INET6 will report itself as MYSQL_TYPE_STRING while it won't support fulltext.
Let's add a new method in Type_handler:
virtual bool Key_part_spec_init_ft(Key_part_spec *part, |
const Column_definition &def) const; |
and split this code into virtual implementations for specific Type_handler_xxx implementations.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed