summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-03-15 20:05:55 +0200
committerunknown <heikki@hundin.mysql.fi>2003-03-15 20:05:55 +0200
commit3ad8b4c19c93a309466579cce971bbcc382511d4 (patch)
tree742cf9e5ecded3fad9de53fe161b1070e74ff403 /innobase
parentd8ea9fc972982e582637c4cd2f486c1d32a4ab82 (diff)
downloadmariadb-git-3ad8b4c19c93a309466579cce971bbcc382511d4.tar.gz
row0sel.c:
Fix bug number 154: GROUP BY and DISTINCT could treat NULL values inequal innobase/row/row0sel.c: Fix bug number 154: GROUP BY and DISTINCT could treat NULL values inequal
Diffstat (limited to 'innobase')
-rw-r--r--innobase/row/row0sel.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 5f260634149..c9de502eb9a 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2115,19 +2115,14 @@ row_sel_store_mysql_rec(
extern_field_heap = NULL;
}
} else {
- /* MySQL sometimes seems to copy the 'data'
- pointed to by a BLOB field even if the field
- has been marked to contain the SQL NULL value.
- This caused seg faults reported by two users.
- Set the BLOB length to 0 and the data pointer
- to NULL to avoid a seg fault. */
-
- if (templ->type == DATA_BLOB) {
- row_sel_field_store_in_mysql_format(
- mysql_rec + templ->mysql_col_offset,
- templ->mysql_col_len, NULL,
- 0, templ->type, templ->is_unsigned);
- }
+ /* MySQL seems to assume the field for an SQL NULL
+ value is set to zero. Not taking this into account
+ caused seg faults with NULL BLOB fields, and
+ 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',
+ templ->mysql_col_len);
if (!templ->mysql_null_bit_mask) {
fprintf(stderr,