summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-01-27 20:10:04 +0200
committerunknown <heikki@hundin.mysql.fi>2004-01-27 20:10:04 +0200
commitbd980424268b146dca070d5c3c250afc23ee0576 (patch)
tree2591c5dd6372b050f3041662e6e6e8828a54b62a /innobase/include
parent4db4ffef27624e58cc5c45cc8a165bfb9509fbfa (diff)
downloadmariadb-git-bd980424268b146dca070d5c3c250afc23ee0576.tar.gz
data0data.ic, data0data.h, row0sel.c:
Fix bug #2483 with InnoDB, UNIQUE secondary index, and NULL values in that unique index; with the IS NULL predicate, InnoDB returned only the first matching row, though there can be many innobase/row/row0sel.c: Fix bug #2483 with InnoDB, UNIQUE secondary index, and NULL values in that unique index; with the IS NULL predicate, InnoDB returned only the first matching row, though there can be many innobase/include/data0data.h: Fix bug #2483 with InnoDB, UNIQUE secondary index, and NULL values in that unique index; with the IS NULL predicate, InnoDB returned only the first matching row, though there can be many innobase/include/data0data.ic: Fix bug #2483 with InnoDB, UNIQUE secondary index, and NULL values in that unique index; with the IS NULL predicate, InnoDB returned only the first matching row, though there can be many
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/data0data.h8
-rw-r--r--innobase/include/data0data.ic25
2 files changed, 33 insertions, 0 deletions
diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h
index 889d148d3fe..2ec94a9517a 100644
--- a/innobase/include/data0data.h
+++ b/innobase/include/data0data.h
@@ -262,6 +262,14 @@ dtuple_set_types_binary(
/*====================*/
dtuple_t* tuple, /* in: data tuple */
ulint n); /* in: number of fields to set */
+/**************************************************************************
+Checks if a dtuple contains an SQL null value. */
+UNIV_INLINE
+ibool
+dtuple_contains_null(
+/*=================*/
+ /* out: TRUE if some field is SQL null */
+ dtuple_t* tuple); /* in: dtuple */
/**************************************************************
Checks that a data field is typed. Asserts an error if not. */
diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic
index d356664df21..bc5a93cb2f8 100644
--- a/innobase/include/data0data.ic
+++ b/innobase/include/data0data.ic
@@ -406,3 +406,28 @@ data_write_sql_null(
data[j] = '\0';
}
}
+
+/**************************************************************************
+Checks if a dtuple contains an SQL null value. */
+UNIV_INLINE
+ibool
+dtuple_contains_null(
+/*=================*/
+ /* out: TRUE if some field is SQL null */
+ dtuple_t* tuple) /* in: dtuple */
+{
+ ulint n;
+ ulint i;
+
+ n = dtuple_get_n_fields(tuple);
+
+ for (i = 0; i < n; i++) {
+ if (dfield_get_len(dtuple_get_nth_field(tuple, i))
+ == UNIV_SQL_NULL) {
+
+ return(TRUE);
+ }
+ }
+
+ return(FALSE);
+} \ No newline at end of file