diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 0a3d0fc56e0..326b8a3f16a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -141,6 +141,17 @@ bool Key_part_spec::check_key_for_blob(const handler *file) const } +bool Key_part_spec::check_key_length_for_blob() const +{ + if (!length) + { + my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), field_name.str); + return true; + } + return false; +} + + bool Key_part_spec::init_multiple_key_for_blob(const handler *file) { if (check_key_for_blob(file)) diff --git a/sql/sql_class.h b/sql/sql_class.h index ab7f06304c2..bad9a5796f8 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -290,15 +290,7 @@ public: Key_part_spec *clone(MEM_ROOT *mem_root) const { return new (mem_root) Key_part_spec(*this); } bool check_key_for_blob(const class handler *file) const; - bool check_key_length_for_blob() const - { - if (!length) - { - my_error(ER_BLOB_KEY_WITHOUT_LENGTH, MYF(0), field_name.str); - return true; - } - return false; - } + bool check_key_length_for_blob() const; bool check_primary_key_for_blob(const class handler *file) const { return check_key_for_blob(file) || check_key_length_for_blob();