summaryrefslogtreecommitdiff
path: root/innobase/rem
diff options
context:
space:
mode:
authorheikki@donna.mysql.fi <>2001-08-04 19:36:14 +0300
committerheikki@donna.mysql.fi <>2001-08-04 19:36:14 +0300
commit94db78ce61a998d28a9335bade3e5e1df558a4ea (patch)
treee6dc89cb458f496f2b93e907afb60d3cd886cc18 /innobase/rem
parent596d69b5ce815c325d8a1af7934ed50efce5aed3 (diff)
downloadmariadb-git-94db78ce61a998d28a9335bade3e5e1df558a4ea.tar.gz
srv0srv.h Support raw disk partitions as data files
srv0start.c Support raw disk partitions as data files srv0srv.c Support raw disk partitions as data files row0purge.c < 4 GB rows, doublewrite, hang fixes row0row.c < 4 GB rows, doublewrite, hang fixes row0sel.c < 4 GB rows, doublewrite, hang fixes row0uins.c < 4 GB rows, doublewrite, hang fixes row0umod.c < 4 GB rows, doublewrite, hang fixes row0undo.c < 4 GB rows, doublewrite, hang fixes row0upd.c < 4 GB rows, doublewrite, hang fixes srv0srv.c < 4 GB rows, doublewrite, hang fixes srv0start.c < 4 GB rows, doublewrite, hang fixes sync0rw.c < 4 GB rows, doublewrite, hang fixes sync0sync.c < 4 GB rows, doublewrite, hang fixes trx0purge.c < 4 GB rows, doublewrite, hang fixes trx0rec.c < 4 GB rows, doublewrite, hang fixes trx0sys.c < 4 GB rows, doublewrite, hang fixes btr0btr.c < 4 GB rows, doublewrite, hang fixes btr0cur.c < 4 GB rows, doublewrite, hang fixes buf0buf.c < 4 GB rows, doublewrite, hang fixes buf0flu.c < 4 GB rows, doublewrite, hang fixes buf0rea.c < 4 GB rows, doublewrite, hang fixes data0data.c < 4 GB rows, doublewrite, hang fixes fil0fil.c < 4 GB rows, doublewrite, hang fixes fsp0fsp.c < 4 GB rows, doublewrite, hang fixes ibuf0ibuf.c < 4 GB rows, doublewrite, hang fixes lock0lock.c < 4 GB rows, doublewrite, hang fixes log0log.c < 4 GB rows, doublewrite, hang fixes log0recv.c < 4 GB rows, doublewrite, hang fixes os0file.c < 4 GB rows, doublewrite, hang fixes page0cur.c < 4 GB rows, doublewrite, hang fixes pars0pars.c < 4 GB rows, doublewrite, hang fixes rem0cmp.c < 4 GB rows, doublewrite, hang fixes rem0rec.c < 4 GB rows, doublewrite, hang fixes row0ins.c < 4 GB rows, doublewrite, hang fixes row0mysql.c < 4 GB rows, doublewrite, hang fixes univ.i < 4 GB rows, doublewrite, hang fixes data0data.ic < 4 GB rows, doublewrite, hang fixes mach0data.ic < 4 GB rows, doublewrite, hang fixes rem0rec.ic < 4 GB rows, doublewrite, hang fixes row0upd.ic < 4 GB rows, doublewrite, hang fixes trx0rec.ic < 4 GB rows, doublewrite, hang fixes rem0cmp.h < 4 GB rows, doublewrite, hang fixes rem0rec.h < 4 GB rows, doublewrite, hang fixes row0ins.h < 4 GB rows, doublewrite, hang fixes row0mysql.h < 4 GB rows, doublewrite, hang fixes row0row.h < 4 GB rows, doublewrite, hang fixes row0upd.h < 4 GB rows, doublewrite, hang fixes srv0srv.h < 4 GB rows, doublewrite, hang fixes sync0sync.h < 4 GB rows, doublewrite, hang fixes trx0rec.h < 4 GB rows, doublewrite, hang fixes trx0sys.h < 4 GB rows, doublewrite, hang fixes trx0types.h < 4 GB rows, doublewrite, hang fixes trx0undo.h < 4 GB rows, doublewrite, hang fixes ut0dbg.h < 4 GB rows, doublewrite, hang fixes ut0ut.h < 4 GB rows, doublewrite, hang fixes btr0btr.h < 4 GB rows, doublewrite, hang fixes btr0cur.h < 4 GB rows, doublewrite, hang fixes buf0buf.h < 4 GB rows, doublewrite, hang fixes buf0flu.h < 4 GB rows, doublewrite, hang fixes data0data.h < 4 GB rows, doublewrite, hang fixes dict0mem.h < 4 GB rows, doublewrite, hang fixes fil0fil.h < 4 GB rows, doublewrite, hang fixes fsp0fsp.h < 4 GB rows, doublewrite, hang fixes os0file.h < 4 GB rows, doublewrite, hang fixes
Diffstat (limited to 'innobase/rem')
-rw-r--r--innobase/rem/rem0cmp.c49
-rw-r--r--innobase/rem/rem0rec.c67
2 files changed, 106 insertions, 10 deletions
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c
index 78f4e450269..cdf1f363946 100644
--- a/innobase/rem/rem0cmp.c
+++ b/innobase/rem/rem0cmp.c
@@ -295,14 +295,18 @@ This function is used to compare a data tuple to a physical record.
Only dtuple->n_fields_cmp first fields are taken into account for
the the data tuple! If we denote by n = n_fields_cmp, then rec must
have either m >= n fields, or it must differ from dtuple in some of
-the m fields rec has. */
+the m fields rec has. If rec has an externally stored field we do not
+compare it but return with value 0 if such a comparison should be
+made. */
int
cmp_dtuple_rec_with_match(
/*======================*/
/* out: 1, 0, -1, if dtuple is greater, equal,
less than rec, respectively, when only the
- common first fields are compared */
+ common first fields are compared, or
+ until the first externally stored field in
+ rec */
dtuple_t* dtuple, /* in: data tuple */
rec_t* rec, /* in: physical record which differs from
dtuple in some of the common fields, or which
@@ -344,7 +348,8 @@ cmp_dtuple_rec_with_match(
ut_ad(cur_field <= dtuple_get_n_fields_cmp(dtuple));
ut_ad(cur_field <= rec_get_n_fields(rec));
- /* Match fields in a loop; stop if we run out of fields in dtuple */
+ /* Match fields in a loop; stop if we run out of fields in dtuple
+ or find an externally stored field */
while (cur_field < dtuple_get_n_fields_cmp(dtuple)) {
@@ -357,7 +362,8 @@ cmp_dtuple_rec_with_match(
/* If we have matched yet 0 bytes, it may be that one or
both the fields are SQL null, or the record or dtuple may be
- the predefined minimum record */
+ the predefined minimum record, or the field is externally
+ stored */
if (cur_bytes == 0) {
if (cur_field == 0) {
@@ -384,6 +390,15 @@ cmp_dtuple_rec_with_match(
}
}
+ if (rec_get_nth_field_extern_bit(rec, cur_field)) {
+ /* We do not compare to an externally
+ stored field */
+
+ ret = 0;
+
+ goto order_resolved;
+ }
+
if (dtuple_f_len == UNIV_SQL_NULL
|| rec_f_len == UNIV_SQL_NULL) {
@@ -604,7 +619,8 @@ cmp_dtuple_rec_prefix_equal(
/*****************************************************************
This function is used to compare two physical records. Only the common
-first fields are compared. */
+first fields are compared, and if an externally stored field is
+encountered, then 0 is returned. */
int
cmp_rec_rec_with_match(
@@ -688,8 +704,18 @@ cmp_rec_rec_with_match(
goto order_resolved;
}
- }
+ }
+
+ if (rec_get_nth_field_extern_bit(rec1, cur_field)
+ || rec_get_nth_field_extern_bit(rec2, cur_field)) {
+ /* We do not compare to an externally
+ stored field */
+ ret = 0;
+
+ goto order_resolved;
+ }
+
if (rec1_f_len == UNIV_SQL_NULL
|| rec2_f_len == UNIV_SQL_NULL) {
@@ -812,7 +838,8 @@ order_resolved:
Used in debug checking of cmp_dtuple_... .
This function is used to compare a data tuple to a physical record. If
dtuple has n fields then rec must have either m >= n fields, or it must
-differ from dtuple in some of the m fields rec has. */
+differ from dtuple in some of the m fields rec has. If encounters an
+externally stored field, returns 0. */
static
int
cmp_debug_dtuple_rec_with_match(
@@ -882,6 +909,14 @@ cmp_debug_dtuple_rec_with_match(
rec_f_data = rec_get_nth_field(rec, cur_field, &rec_f_len);
+ if (rec_get_nth_field_extern_bit(rec, cur_field)) {
+ /* We do not compare to an externally stored field */
+
+ ret = 0;
+
+ goto order_resolved;
+ }
+
ret = cmp_data_data(cur_type, dtuple_f_data, dtuple_f_len,
rec_f_data, rec_f_len);
if (ret != 0) {
diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c
index 9ddfe7a4b9a..88009f2f5c9 100644
--- a/innobase/rem/rem0rec.c
+++ b/innobase/rem/rem0rec.c
@@ -1,7 +1,7 @@
/************************************************************************
Record manager
-(c) 1994-1996 Innobase Oy
+(c) 1994-2001 Innobase Oy
Created 5/30/1994 Heikki Tuuri
*************************************************************************/
@@ -12,6 +12,9 @@ Created 5/30/1994 Heikki Tuuri
#include "rem0rec.ic"
#endif
+#include "mtr0mtr.h"
+#include "mtr0log.h"
+
/* PHYSICAL RECORD
===============
@@ -21,7 +24,10 @@ found in index pages of the database, has the following format
represented on a higher text line):
| offset of the end of the last field of data, the most significant
- bit is set to 1 if and only if the field is SQL-null |
+ bit is set to 1 if and only if the field is SQL-null,
+ if the offset is 2-byte, then the second most significant
+ bit is set to 1 if the field is stored on another page:
+ mostly this will occur in the case of big BLOB fields |
...
| offset of the end of the first field of data + the SQL-null bit |
| 4 bits used to delete mark a record, and mark a predefined
@@ -122,7 +128,8 @@ rec_get_nth_field(
return(rec + os);
}
- next_os = next_os & ~REC_2BYTE_SQL_NULL_MASK;
+ next_os = next_os & ~(REC_2BYTE_SQL_NULL_MASK
+ | REC_2BYTE_EXTERN_MASK);
}
*len = next_os - os;
@@ -170,6 +177,60 @@ rec_set_nth_field_null_bit(
rec_2_set_field_end_info(rec, i, info);
}
+/***************************************************************
+Sets the value of the ith field extern storage bit. */
+
+void
+rec_set_nth_field_extern_bit(
+/*=========================*/
+ rec_t* rec, /* in: record */
+ ulint i, /* in: ith field */
+ ibool val, /* in: value to set */
+ mtr_t* mtr) /* in: mtr holding an X-latch to the page where
+ rec is, or NULL; in the NULL case we do not
+ write to log about the change */
+{
+ ulint info;
+
+ ut_a(!rec_get_1byte_offs_flag(rec));
+ ut_a(i < rec_get_n_fields(rec));
+
+ info = rec_2_get_field_end_info(rec, i);
+
+ if (val) {
+ info = info | REC_2BYTE_EXTERN_MASK;
+ } else {
+ info = info & ~REC_2BYTE_EXTERN_MASK;
+ }
+
+ if (mtr) {
+ mlog_write_ulint(rec - REC_N_EXTRA_BYTES - 2 * (i + 1), info,
+ MLOG_2BYTES, mtr);
+ } else {
+ rec_2_set_field_end_info(rec, i, info);
+ }
+}
+
+/***************************************************************
+Sets TRUE the extern storage bits of fields mentioned in an array. */
+
+void
+rec_set_field_extern_bits(
+/*======================*/
+ rec_t* rec, /* in: record */
+ ulint* vec, /* in: array of field numbers */
+ ulint n_fields, /* in: number of fields numbers */
+ mtr_t* mtr) /* in: mtr holding an X-latch to the page
+ where rec is, or NULL; in the NULL case we
+ do not write to log about the change */
+{
+ ulint i;
+
+ for (i = 0; i < n_fields; i++) {
+ rec_set_nth_field_extern_bit(rec, vec[i], TRUE, mtr);
+ }
+}
+
/***************************************************************
Sets a record field to SQL null. The physical size of the field is not
changed. */