diff --git a/include/row0mysql.h b/include/row0mysql.h index 9441e53e522..c7d9a0e4b61 100644 --- a/include/row0mysql.h +++ b/include/row0mysql.h @@ -63,12 +63,17 @@ Stores a reference to a BLOB in the MySQL format. */ void row_mysql_store_blob_ref( /*=====================*/ - byte* dest, /* in: where to store */ - ulint col_len, /* in: dest buffer size: determines into + byte* dest, /* in: where to store */ + ulint col_len,/* in: dest buffer size: determines into how many bytes the BLOB length is stored, - this may vary from 1 to 4 bytes */ - byte* data, /* in: BLOB data */ - ulint len); /* in: BLOB length */ + the space for the length may vary from 1 + to 4 bytes */ + const void* data, /* in: BLOB data; if the value to store + is SQL NULL this should be NULL pointer */ + ulint len); /* in: BLOB length; if the value to store + is SQL NULL this should be 0; remember + also to set the NULL bit in the MySQL record + header! */ /*********************************************************************** Reads a reference to a BLOB in the MySQL format. */ diff --git a/row/row0mysql.c b/row/row0mysql.c index f6fcc7c02f5..c4f1572a3ac 100644 --- a/row/row0mysql.c +++ b/row/row0mysql.c @@ -180,14 +180,14 @@ Stores a reference to a BLOB in the MySQL format. */ void row_mysql_store_blob_ref( /*=====================*/ - byte* dest, /* in: where to store */ - ulint col_len, /* in: dest buffer size: determines into + byte* dest, /* in: where to store */ + ulint col_len,/* in: dest buffer size: determines into how many bytes the BLOB length is stored, the space for the length may vary from 1 to 4 bytes */ - byte* data, /* in: BLOB data; if the value to store + const void* data, /* in: BLOB data; if the value to store is SQL NULL this should be NULL pointer */ - ulint len) /* in: BLOB length; if the value to store + ulint len) /* in: BLOB length; if the value to store is SQL NULL this should be 0; remember also to set the NULL bit in the MySQL record header! */ @@ -208,7 +208,7 @@ row_mysql_store_blob_ref( mach_write_to_n_little_endian(dest, col_len - 8, len); - ut_memcpy(dest + col_len - 8, &data, sizeof(byte*)); + memcpy(dest + col_len - 8, &data, sizeof data); } /***********************************************************************