summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-01-12 23:22:12 +0300
committerunknown <sergefp@mysql.com>2005-01-12 23:22:12 +0300
commit4596579c999c7dbf5e0f9152fb0d645e94e11e7c (patch)
treeb1069c3c3bbffb3caa2fc2f236c475494af3cc7c /innobase
parent4c9d5f80c1f84e66c7a6bde7bf370f199abbf4ee (diff)
parent5861c6dc172ec508ca85eaff437a2a6bab8825aa (diff)
downloadmariadb-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')
-rw-r--r--innobase/include/row0mysql.h8
-rw-r--r--innobase/row/row0sel.c18
2 files changed, 11 insertions, 15 deletions
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index bd5ad3adba5..575d8ee67bb 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -531,10 +531,7 @@ struct row_prebuilt_struct {
format */
ulint hint_need_to_fetch_extra_cols;
/* normally this is set to 0; if this
- is set to ROW_RETRIEVE_PRIMARY_KEY
- (that value is obsolete starting from
- 5.0.2, because we always fetch the
- primary key cols),
+ is set to ROW_RETRIEVE_PRIMARY_KEY,
then we should at least retrieve all
columns in the primary key; if this
is set to ROW_RETRIEVE_ALL_COLS, then
@@ -607,9 +604,6 @@ struct row_prebuilt_struct {
/* Values for hint_need_to_fetch_extra_cols */
#define ROW_RETRIEVE_PRIMARY_KEY 1
- /* value 1 is obsolete starting from
- 5.0.2, because we always fetch the
- primary key cols */
#define ROW_RETRIEVE_ALL_COLS 2
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