diff options
author | unknown <sergefp@mysql.com> | 2005-01-12 23:22:12 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-01-12 23:22:12 +0300 |
commit | 4596579c999c7dbf5e0f9152fb0d645e94e11e7c (patch) | |
tree | b1069c3c3bbffb3caa2fc2f236c475494af3cc7c /innobase/row | |
parent | 4c9d5f80c1f84e66c7a6bde7bf370f199abbf4ee (diff) | |
parent | 5861c6dc172ec508ca85eaff437a2a6bab8825aa (diff) | |
download | mariadb-git-4596579c999c7dbf5e0f9152fb0d645e94e11e7c.tar.gz |
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/dbdata/psergey/mysql-5.0-bug5401-2
sql/opt_range.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
Diffstat (limited to 'innobase/row')
-rw-r--r-- | innobase/row/row0sel.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 6cd265f23e3..f3a5f911171 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2331,11 +2331,6 @@ row_sel_store_mysql_rec( prebuilt->blob_heap = NULL; } - /* MySQL assumes that all columns have the SQL NULL bit set unless it - is a nullable column with a non-NULL value */ - - memset(mysql_rec, 0xFF, prebuilt->null_bitmap_len); - for (i = 0; i < prebuilt->n_template; i++) { templ = prebuilt->mysql_template + i; @@ -2431,6 +2426,8 @@ row_sel_store_mysql_rec( bug number 154 in the MySQL bug database: GROUP BY and DISTINCT could treat NULL values inequal. */ + mysql_rec[templ->mysql_null_byte_offset] |= + (byte) (templ->mysql_null_bit_mask); if (templ->type == DATA_VARCHAR || templ->type == DATA_CHAR || templ->type == DATA_BINARY @@ -2749,10 +2746,15 @@ row_sel_pop_cached_row_for_mysql( buf + templ->mysql_col_offset, cached_rec + templ->mysql_col_offset, templ->mysql_col_len); - + /* Copy NULL bit of the current field from cached_rec + to buf */ if (templ->mysql_null_bit_mask) - buf[templ->mysql_null_byte_offset] &= - cached_rec[templ->mysql_null_byte_offset]; + { + buf[templ->mysql_null_byte_offset] ^= + (buf[templ->mysql_null_byte_offset] ^ + cached_rec[templ->mysql_null_byte_offset]) & + (byte)templ->mysql_null_bit_mask; + } } } else |