MCPcopy Create free account
hub / github.com/MariaDB/server / copy_value

Method copy_value

sql/field.cc:8921–8940  ·  view source on GitHub ↗

Copy a value from another BLOB field of the same character set. This method is used by Copy_field, e.g. during ALTER TABLE. */

Source from the content-addressed store, hash-verified

8919 This method is used by Copy_field, e.g. during ALTER TABLE.
8920*/
8921int 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
8943int Field_blob::store(const char *from,size_t length,CHARSET_INFO *cs)

Callers 1

do_copy_blobMethod · 0.80

Calls 8

Well_formed_prefixClass · 0.85
eq_collationMethod · 0.80
store_lengthFunction · 0.70
charsetMethod · 0.45
compression_methodMethod · 0.45
get_lengthMethod · 0.45
get_ptrMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected