Copy a value from another BLOB field of the same character set. This method is used by Copy_field, e.g. during ALTER TABLE. */
| 8919 | This method is used by Copy_field, e.g. during ALTER TABLE. |
| 8920 | */ |
| 8921 | int Field_blob::copy_value(Field_blob *from) |
| 8922 | { |
| 8923 | DBUG_ASSERT(field_charset()->eq_collation(from->charset())); |
| 8924 | DBUG_ASSERT(!compression_method() == !from->compression_method()); |
| 8925 | int rc= 0; |
| 8926 | uint32 length= from->get_length(); |
| 8927 | uchar *data= from->get_ptr(); |
| 8928 | if (packlength < from->packlength) |
| 8929 | { |
| 8930 | set_if_smaller(length, Field_blob::max_data_length()); |
| 8931 | length= (uint32) Well_formed_prefix(field_charset(), |
| 8932 | (const char *) data, length).length(); |
| 8933 | rc= report_if_important_data((const char *) data + length, |
| 8934 | (const char *) data + from->get_length(), |
| 8935 | true); |
| 8936 | } |
| 8937 | store_length(length); |
| 8938 | bmove(ptr + packlength, (uchar*) &data, sizeof(char*)); |
| 8939 | return rc; |
| 8940 | } |
| 8941 | |
| 8942 | |
| 8943 | int Field_blob::store(const char *from,size_t length,CHARSET_INFO *cs) |
no test coverage detected