Commit 3d3f11f8 authored by serg@serg.mylan's avatar serg@serg.mylan

making InnoDB to return the row exactly the same (bytewise) as it was written to it

parent 2fcab1c2
......@@ -2077,9 +2077,9 @@ row_sel_store_mysql_rec(
prebuilt->blob_heap = NULL;
}
/* Mark all columns as not SQL NULL */
/* Mark all columns as SQL NULL */
memset(mysql_rec, '\0', prebuilt->null_bitmap_len);
memset(mysql_rec, 255, prebuilt->null_bitmap_len);
for (i = 0; i < prebuilt->n_template; i++) {
......@@ -2144,6 +2144,11 @@ row_sel_store_mysql_rec(
mem_heap_free(extern_field_heap);
extern_field_heap = NULL;
}
if (templ->mysql_null_bit_mask) {
mysql_rec[templ->mysql_null_byte_offset] &=
~(byte) (templ->mysql_null_bit_mask);
}
} else {
/* MySQL seems to assume the field for an SQL NULL
value is set to zero. Not taking this into account
......@@ -2151,17 +2156,11 @@ row_sel_store_mysql_rec(
bug number 154 in the MySQL bug database: GROUP BY
and DISTINCT could treat NULL values inequal. */
memset(mysql_rec + templ->mysql_col_offset, '\0',
memset(mysql_rec + templ->mysql_col_offset,
((templ->type == DATA_VARCHAR ||
templ->type == DATA_VARMYSQL ||
templ->type == DATA_BINARY) ? ' ' : '\0'),
templ->mysql_col_len);
if (!templ->mysql_null_bit_mask) {
fprintf(stderr,
"InnoDB: Error: trying to return an SQL NULL field in a non-null\n"
"innoDB: column! Table name %s\n", prebuilt->table->name);
} else {
mysql_rec[templ->mysql_null_byte_offset] |=
(byte) (templ->mysql_null_bit_mask);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment