row0sel.c:

  Fix bug number 154: GROUP BY and DISTINCT could treat NULL values inequal
parent 81db1e7f
...@@ -2115,19 +2115,14 @@ row_sel_store_mysql_rec( ...@@ -2115,19 +2115,14 @@ row_sel_store_mysql_rec(
extern_field_heap = NULL; extern_field_heap = NULL;
} }
} else { } else {
/* MySQL sometimes seems to copy the 'data' /* MySQL seems to assume the field for an SQL NULL
pointed to by a BLOB field even if the field value is set to zero. Not taking this into account
has been marked to contain the SQL NULL value. caused seg faults with NULL BLOB fields, and
This caused seg faults reported by two users. bug number 154 in the MySQL bug database: GROUP BY
Set the BLOB length to 0 and the data pointer and DISTINCT could treat NULL values inequal. */
to NULL to avoid a seg fault. */
memset(mysql_rec + templ->mysql_col_offset, '\0',
if (templ->type == DATA_BLOB) { templ->mysql_col_len);
row_sel_field_store_in_mysql_format(
mysql_rec + templ->mysql_col_offset,
templ->mysql_col_len, NULL,
0, templ->type, templ->is_unsigned);
}
if (!templ->mysql_null_bit_mask) { if (!templ->mysql_null_bit_mask) {
fprintf(stderr, fprintf(stderr,
......
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