~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/dict0dict.ic

  • Committer: Lee Bieber
  • Date: 2010-12-03 01:16:19 UTC
  • mfrom: (1819.9.81 update-innobase)
  • Revision ID: kalebral@gmail.com-20101203011619-n6v584rijwdet05b
Merge Stewart - update Innobase plugin based on InnoDB 1.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "rem0types.h"
30
30
 
31
31
/*********************************************************************//**
 
32
Gets the minimum number of bytes per character.
 
33
@return minimum multi-byte char size, in bytes */
 
34
UNIV_INLINE
 
35
ulint
 
36
dict_col_get_mbminlen(
 
37
/*==================*/
 
38
        const dict_col_t*       col)    /*!< in: column */
 
39
{
 
40
        return(DATA_MBMINLEN(col->mbminmaxlen));
 
41
}
 
42
/*********************************************************************//**
 
43
Gets the maximum number of bytes per character.
 
44
@return maximum multi-byte char size, in bytes */
 
45
UNIV_INLINE
 
46
ulint
 
47
dict_col_get_mbmaxlen(
 
48
/*==================*/
 
49
        const dict_col_t*       col)    /*!< in: column */
 
50
{
 
51
        return(DATA_MBMAXLEN(col->mbminmaxlen));
 
52
}
 
53
/*********************************************************************//**
 
54
Sets the minimum and maximum number of bytes per character. */
 
55
UNIV_INLINE
 
56
void
 
57
dict_col_set_mbminmaxlen(
 
58
/*=====================*/
 
59
        dict_col_t*     col,            /*!< in/out: column */
 
60
        ulint           mbminlen,       /*!< in: minimum multi-byte
 
61
                                        character size, in bytes */
 
62
        ulint           mbmaxlen)       /*!< in: minimum multi-byte
 
63
                                        character size, in bytes */
 
64
{
 
65
        ut_ad(mbminlen < DATA_MBMAX);
 
66
        ut_ad(mbmaxlen < DATA_MBMAX);
 
67
        ut_ad(mbminlen <= mbmaxlen);
 
68
 
 
69
        col->mbminmaxlen = DATA_MBMINMAXLEN(mbminlen, mbmaxlen);
 
70
}
 
71
/*********************************************************************//**
32
72
Gets the column data type. */
33
73
UNIV_INLINE
34
74
void
42
82
        type->mtype = col->mtype;
43
83
        type->prtype = col->prtype;
44
84
        type->len = col->len;
45
 
        type->mbminlen = col->mbminlen;
46
 
        type->mbmaxlen = col->mbmaxlen;
 
85
        type->mbminmaxlen = col->mbminmaxlen;
47
86
}
48
87
#endif /* !UNIV_HOTBACKUP */
49
88
 
65
104
        ut_ad(col->prtype == type->prtype);
66
105
        ut_ad(col->len == type->len);
67
106
# ifndef UNIV_HOTBACKUP
68
 
        ut_ad(col->mbminlen == type->mbminlen);
69
 
        ut_ad(col->mbmaxlen == type->mbmaxlen);
 
107
        ut_ad(col->mbminmaxlen == type->mbminmaxlen);
70
108
# endif /* !UNIV_HOTBACKUP */
71
109
 
72
110
        return(TRUE);
84
122
        const dict_col_t*       col)    /*!< in: column */
85
123
{
86
124
        return(dtype_get_min_size_low(col->mtype, col->prtype, col->len,
87
 
                                      col->mbminlen, col->mbmaxlen));
 
125
                                      col->mbminmaxlen));
88
126
}
89
127
/***********************************************************************//**
90
128
Returns the maximum size of the column.
109
147
        ulint                   comp)   /*!< in: nonzero=ROW_FORMAT=COMPACT  */
110
148
{
111
149
        return(dtype_get_fixed_size_low(col->mtype, col->prtype, col->len,
112
 
                                        col->mbminlen, col->mbmaxlen, comp));
 
150
                                        col->mbminmaxlen, comp));
113
151
}
114
152
/***********************************************************************//**
115
153
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column.
781
819
dict_table_t*
782
820
dict_table_get_on_id_low(
783
821
/*=====================*/
784
 
        dulint  table_id)       /*!< in: table id */
 
822
        table_id_t      table_id)       /*!< in: table id */
785
823
{
786
824
        dict_table_t*   table;
787
825
        ulint           fold;
789
827
        ut_ad(mutex_own(&(dict_sys->mutex)));
790
828
 
791
829
        /* Look for the table name in the hash table */
792
 
        fold = ut_fold_dulint(table_id);
 
830
        fold = ut_fold_ull(table_id);
793
831
 
794
832
        HASH_SEARCH(id_hash, dict_sys->table_id_hash, fold,
795
833
                    dict_table_t*, table, ut_ad(table->cached),
796
 
                    !ut_dulint_cmp(table->id, table_id));
 
834
                    table->id == table_id);
797
835
        if (table == NULL) {
798
836
                table = dict_load_table_on_id(table_id);
799
837
        }