~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.h

  • Committer: Jay Pipes
  • Date: 2009-11-19 18:58:35 UTC
  • mto: (1223.1.2 push)
  • mto: This revision was merged to the branch mainline in revision 1224.
  • Revision ID: jpipes@serialcoder-20091119185835-o59wyfjiet3keutu
Fixes some valgrind warnings regarding conditionals depending on unintialized variables.  Use initializer lists properly, dang it. :) Also, removed the new_Cached_item() function's use_result_field, as this was only used for views and was producing a valgrind warning unnecessarily.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
class TableShare
34
34
{
35
35
public:
36
 
  TableShare() 
 
36
  TableShare() :
 
37
    table_category(TABLE_UNKNOWN_CATEGORY),
 
38
    open_count(0),
 
39
    field(NULL),
 
40
    found_next_number_field(NULL),
 
41
    timestamp_field(NULL),
 
42
    key_info(NULL),
 
43
    blob_field(NULL),
 
44
    intervals(NULL),
 
45
    default_values(NULL),
 
46
    block_size(0),
 
47
    version(0),
 
48
    timestamp_offset(0),
 
49
    reclength(0),
 
50
    stored_rec_length(0),
 
51
    row_type(ROW_TYPE_DEFAULT),
 
52
    max_rows(0),
 
53
    table_proto(NULL),
 
54
    storage_engine(NULL),
 
55
    tmp_table(NO_TMP_TABLE),
 
56
    ref_count(0),
 
57
    null_bytes(0),
 
58
    last_null_bit_pos(0),
 
59
    fields(0),
 
60
    rec_buff_length(0),
 
61
    keys(0),
 
62
    key_parts(0),
 
63
    max_key_length(0),
 
64
    max_unique_length(0),
 
65
    total_key_length(0),
 
66
    uniques(0),
 
67
    null_fields(0),
 
68
    blob_fields(0),
 
69
    timestamp_field_offset(0),
 
70
    varchar_fields(0),
 
71
    db_create_options(0),
 
72
    db_options_in_use(0),
 
73
    db_record_offset(0),
 
74
    rowid_field_offset(0),
 
75
    primary_key(0),
 
76
    next_number_index(0),
 
77
    next_number_key_offset(0),
 
78
    next_number_keypart(0),
 
79
    error(0),
 
80
    open_errno(0),
 
81
    errarg(0),
 
82
    column_bitmap_size(0),
 
83
    blob_ptr_size(0),
 
84
    db_low_byte_first(false),
 
85
    crashed(false),
 
86
    name_lock(false),
 
87
    replace_with_name_lock(false),
 
88
    waiting_on_cond(false),
 
89
    keys_in_use(0),
 
90
    keys_for_keyread(0)
37
91
  {
38
92
    init();
39
 
  }                    /* Remove gcc warning */
 
93
  }
40
94
 
41
95
  TableShare(const char *key,
42
 
             uint32_t key_length, const char *new_table_name,
43
 
             const char *new_path)
 
96
             uint32_t key_length,
 
97
             const char *new_table_name,
 
98
             const char *new_path) :
 
99
    table_category(TABLE_UNKNOWN_CATEGORY),
 
100
    open_count(0),
 
101
    field(NULL),
 
102
    found_next_number_field(NULL),
 
103
    timestamp_field(NULL),
 
104
    key_info(NULL),
 
105
    blob_field(NULL),
 
106
    intervals(NULL),
 
107
    default_values(NULL),
 
108
    block_size(0),
 
109
    version(0),
 
110
    timestamp_offset(0),
 
111
    reclength(0),
 
112
    stored_rec_length(0),
 
113
    row_type(ROW_TYPE_DEFAULT),
 
114
    max_rows(0),
 
115
    table_proto(NULL),
 
116
    storage_engine(NULL),
 
117
    tmp_table(NO_TMP_TABLE),
 
118
    ref_count(0),
 
119
    null_bytes(0),
 
120
    last_null_bit_pos(0),
 
121
    fields(0),
 
122
    rec_buff_length(0),
 
123
    keys(0),
 
124
    key_parts(0),
 
125
    max_key_length(0),
 
126
    max_unique_length(0),
 
127
    total_key_length(0),
 
128
    uniques(0),
 
129
    null_fields(0),
 
130
    blob_fields(0),
 
131
    timestamp_field_offset(0),
 
132
    varchar_fields(0),
 
133
    db_create_options(0),
 
134
    db_options_in_use(0),
 
135
    db_record_offset(0),
 
136
    rowid_field_offset(0),
 
137
    primary_key(0),
 
138
    next_number_index(0),
 
139
    next_number_key_offset(0),
 
140
    next_number_keypart(0),
 
141
    error(0),
 
142
    open_errno(0),
 
143
    errarg(0),
 
144
    column_bitmap_size(0),
 
145
    blob_ptr_size(0),
 
146
    db_low_byte_first(false),
 
147
    crashed(false),
 
148
    name_lock(false),
 
149
    replace_with_name_lock(false),
 
150
    waiting_on_cond(false),
 
151
    keys_in_use(0),
 
152
    keys_for_keyread(0)
44
153
  {
45
154
    init(key, key_length, new_table_name, new_path);
46
155
  }
66
175
  pthread_mutex_t mutex;                /* For locking the share  */
67
176
  pthread_cond_t cond;                  /* To signal that share is ready */
68
177
 
69
 
 
70
178
  unsigned char *default_values;                /* row with default values */
71
179
  const CHARSET_INFO *table_charset; /* Default charset of string fields */
72
180