~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/rem0rec.ic

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
26
26
#include "mach0data.h"
27
27
#include "ut0byte.h"
28
28
#include "dict0dict.h"
 
29
#include "btr0types.h"
29
30
 
30
31
/* Compact flag ORed to the extra size returned by rec_get_offsets() */
31
32
#define REC_OFFS_COMPACT        ((ulint) 1 << 31)
1087
1088
        return(UNIV_UNLIKELY(*rec_offs_base(offsets) & REC_OFFS_EXTERNAL));
1088
1089
}
1089
1090
 
 
1091
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
 
1092
/******************************************************//**
 
1093
Determine if the offsets are for a record containing null BLOB pointers.
 
1094
@return first field containing a null BLOB pointer, or NULL if none found */
 
1095
UNIV_INLINE
 
1096
const byte*
 
1097
rec_offs_any_null_extern(
 
1098
/*=====================*/
 
1099
        const rec_t*    rec,            /*!< in: record */
 
1100
        const ulint*    offsets)        /*!< in: rec_get_offsets(rec) */
 
1101
{
 
1102
        ulint   i;
 
1103
        ut_ad(rec_offs_validate(rec, NULL, offsets));
 
1104
 
 
1105
        if (!rec_offs_any_extern(offsets)) {
 
1106
                return(NULL);
 
1107
        }
 
1108
 
 
1109
        for (i = 0; i < rec_offs_n_fields(offsets); i++) {
 
1110
                if (rec_offs_nth_extern(offsets, i)) {
 
1111
                        ulint           len;
 
1112
                        const byte*     field
 
1113
                                = rec_get_nth_field(rec, offsets, i, &len);
 
1114
 
 
1115
                        ut_a(len >= BTR_EXTERN_FIELD_REF_SIZE);
 
1116
                        if (!memcmp(field + len
 
1117
                                    - BTR_EXTERN_FIELD_REF_SIZE,
 
1118
                                    field_ref_zero,
 
1119
                                    BTR_EXTERN_FIELD_REF_SIZE)) {
 
1120
                                return(field);
 
1121
                        }
 
1122
                }
 
1123
        }
 
1124
 
 
1125
        return(NULL);
 
1126
}
 
1127
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
 
1128
 
1090
1129
/******************************************************//**
1091
1130
Returns nonzero if the extern bit is set in nth field of rec.
1092
1131
@return nonzero if externally stored */