Skip to content

Commit

Permalink
Fixing compilation failure on Windows: moving references to type_hand…
Browse files Browse the repository at this point in the history
…ler_xxx from field.h to field.cc
  • Loading branch information
Alexander Barkov committed Apr 26, 2017
1 parent 852f230 commit b445c1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
16 changes: 16 additions & 0 deletions sql/field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8176,6 +8176,22 @@ void Field_blob::sort_string(uchar *to,uint length)
}


/*
Return the data type handler, according to packlength.
Implemented in field.cc rather than in field.h
to avoid exporting type_handler_xxx with MYSQL_PLUGIN_IMPORT.
*/
const Type_handler *Field_blob::type_handler() const
{
switch (packlength) {
case 1: return &type_handler_tiny_blob;
case 2: return &type_handler_blob;
case 3: return &type_handler_medium_blob;
}
return &type_handler_long_blob;
}


void Field_blob::sql_type(String &res) const
{
const char *str;
Expand Down
10 changes: 1 addition & 9 deletions sql/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -3238,15 +3238,7 @@ class Field_blob :public Field_longstr {
:Field_longstr((uchar*) 0, 0, (uchar*) "", 0, NONE, &temp_lex_str,
system_charset_info),
packlength(packlength_arg) {}
const Type_handler *type_handler() const
{
switch (packlength) {
case 1: return &type_handler_tiny_blob;
case 2: return &type_handler_blob;
case 3: return &type_handler_medium_blob;
}
return &type_handler_long_blob;
}
const Type_handler *type_handler() const;
/* Note that the default copy constructor is used, in clone() */
enum_field_types type() const
{
Expand Down

0 comments on commit b445c1e

Please sign in to comment.