~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field.cc

Fixed bashism.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
    DRIZZLE_TYPE_VARCHAR,
73
73
    //DRIZZLE_TYPE_VARCHAR
74
74
    DRIZZLE_TYPE_VARCHAR,
75
 
    //DRIZZLE_TYPE_DECIMAL
76
 
    DRIZZLE_TYPE_DECIMAL,
 
75
    //DRIZZLE_TYPE_NEWDECIMAL
 
76
    DRIZZLE_TYPE_NEWDECIMAL,
77
77
    //DRIZZLE_TYPE_ENUM
78
78
    DRIZZLE_TYPE_VARCHAR,
79
79
    //DRIZZLE_TYPE_BLOB
97
97
    DRIZZLE_TYPE_VARCHAR,
98
98
    //DRIZZLE_TYPE_VARCHAR
99
99
    DRIZZLE_TYPE_VARCHAR,
100
 
    //DRIZZLE_TYPE_DECIMAL
 
100
    //DRIZZLE_TYPE_NEWDECIMAL
101
101
    DRIZZLE_TYPE_DOUBLE,
102
102
    //DRIZZLE_TYPE_ENUM
103
103
    DRIZZLE_TYPE_VARCHAR,
122
122
    DRIZZLE_TYPE_DATE,
123
123
    //DRIZZLE_TYPE_VARCHAR
124
124
    DRIZZLE_TYPE_VARCHAR,
125
 
    //DRIZZLE_TYPE_DECIMAL
126
 
    DRIZZLE_TYPE_DECIMAL,
 
125
    //DRIZZLE_TYPE_NEWDECIMAL
 
126
    DRIZZLE_TYPE_NEWDECIMAL,
127
127
    //DRIZZLE_TYPE_ENUM
128
128
    DRIZZLE_TYPE_ENUM,
129
129
    //DRIZZLE_TYPE_BLOB
147
147
    DRIZZLE_TYPE_DATE,
148
148
    //DRIZZLE_TYPE_VARCHAR
149
149
    DRIZZLE_TYPE_VARCHAR,
150
 
    //DRIZZLE_TYPE_DECIMAL
 
150
    //DRIZZLE_TYPE_NEWDECIMAL
151
151
    DRIZZLE_TYPE_VARCHAR,
152
152
    //DRIZZLE_TYPE_ENUM
153
153
    DRIZZLE_TYPE_VARCHAR,
172
172
    DRIZZLE_TYPE_DATE,
173
173
    //DRIZZLE_TYPE_VARCHAR
174
174
    DRIZZLE_TYPE_VARCHAR,
175
 
    //DRIZZLE_TYPE_DECIMAL DRIZZLE_TYPE_ENUM
176
 
    DRIZZLE_TYPE_DECIMAL,
 
175
    //DRIZZLE_TYPE_NEWDECIMAL DRIZZLE_TYPE_ENUM
 
176
    DRIZZLE_TYPE_NEWDECIMAL,
177
177
    DRIZZLE_TYPE_VARCHAR,
178
178
    //DRIZZLE_TYPE_BLOB
179
179
    DRIZZLE_TYPE_BLOB,
196
196
    DRIZZLE_TYPE_DATE,
197
197
    //DRIZZLE_TYPE_VARCHAR
198
198
    DRIZZLE_TYPE_VARCHAR,
199
 
    //DRIZZLE_TYPE_DECIMAL
 
199
    //DRIZZLE_TYPE_NEWDECIMAL
200
200
    DRIZZLE_TYPE_VARCHAR,
201
201
    //DRIZZLE_TYPE_ENUM
202
202
    DRIZZLE_TYPE_VARCHAR,
221
221
    DRIZZLE_TYPE_DATE,
222
222
    //DRIZZLE_TYPE_VARCHAR
223
223
    DRIZZLE_TYPE_VARCHAR,
224
 
    //DRIZZLE_TYPE_DECIMAL
 
224
    //DRIZZLE_TYPE_NEWDECIMAL
225
225
    DRIZZLE_TYPE_VARCHAR,
226
226
    //DRIZZLE_TYPE_ENUM
227
227
    DRIZZLE_TYPE_VARCHAR,
246
246
    DRIZZLE_TYPE_VARCHAR,
247
247
    //DRIZZLE_TYPE_VARCHAR
248
248
    DRIZZLE_TYPE_VARCHAR,
249
 
    //DRIZZLE_TYPE_DECIMAL
 
249
    //DRIZZLE_TYPE_NEWDECIMAL
250
250
    DRIZZLE_TYPE_VARCHAR,
251
251
    //DRIZZLE_TYPE_ENUM
252
252
    DRIZZLE_TYPE_VARCHAR,
253
253
    //DRIZZLE_TYPE_BLOB
254
254
    DRIZZLE_TYPE_BLOB,
255
255
  },
256
 
  /* DRIZZLE_TYPE_DECIMAL -> */
 
256
  /* DRIZZLE_TYPE_NEWDECIMAL -> */
257
257
  {
258
258
    //DRIZZLE_TYPE_LONG
259
 
    DRIZZLE_TYPE_DECIMAL,
 
259
    DRIZZLE_TYPE_NEWDECIMAL,
260
260
    //DRIZZLE_TYPE_DOUBLE
261
261
    DRIZZLE_TYPE_DOUBLE,
262
262
    //DRIZZLE_TYPE_NULL
263
 
    DRIZZLE_TYPE_DECIMAL,
 
263
    DRIZZLE_TYPE_NEWDECIMAL,
264
264
    //DRIZZLE_TYPE_TIMESTAMP
265
265
    DRIZZLE_TYPE_VARCHAR,
266
266
    //DRIZZLE_TYPE_LONGLONG
267
 
    DRIZZLE_TYPE_DECIMAL,
 
267
    DRIZZLE_TYPE_NEWDECIMAL,
268
268
    //DRIZZLE_TYPE_DATETIME
269
269
    DRIZZLE_TYPE_VARCHAR,
270
270
    //DRIZZLE_TYPE_DATE
271
271
    DRIZZLE_TYPE_VARCHAR,
272
272
    //DRIZZLE_TYPE_VARCHAR
273
273
    DRIZZLE_TYPE_VARCHAR,
274
 
    //DRIZZLE_TYPE_DECIMAL
275
 
    DRIZZLE_TYPE_DECIMAL,
 
274
    //DRIZZLE_TYPE_NEWDECIMAL
 
275
    DRIZZLE_TYPE_NEWDECIMAL,
276
276
    //DRIZZLE_TYPE_ENUM
277
277
    DRIZZLE_TYPE_VARCHAR,
278
278
    //DRIZZLE_TYPE_BLOB
296
296
    DRIZZLE_TYPE_VARCHAR,
297
297
    //DRIZZLE_TYPE_VARCHAR
298
298
    DRIZZLE_TYPE_VARCHAR,
299
 
    //DRIZZLE_TYPE_DECIMAL
 
299
    //DRIZZLE_TYPE_NEWDECIMAL
300
300
    DRIZZLE_TYPE_VARCHAR,
301
301
    //DRIZZLE_TYPE_ENUM
302
302
    DRIZZLE_TYPE_VARCHAR,
321
321
    DRIZZLE_TYPE_BLOB,
322
322
    //DRIZZLE_TYPE_VARCHAR
323
323
    DRIZZLE_TYPE_BLOB,
324
 
    //DRIZZLE_TYPE_DECIMAL
 
324
    //DRIZZLE_TYPE_NEWDECIMAL
325
325
    DRIZZLE_TYPE_BLOB,
326
326
    //DRIZZLE_TYPE_ENUM
327
327
    DRIZZLE_TYPE_BLOB,
348
348
  STRING_RESULT,
349
349
  //DRIZZLE_TYPE_VARCHAR
350
350
  STRING_RESULT,
351
 
  //DRIZZLE_TYPE_DECIMAL   
 
351
  //DRIZZLE_TYPE_NEWDECIMAL   
352
352
  DECIMAL_RESULT,           
353
353
  //DRIZZLE_TYPE_ENUM
354
354
  STRING_RESULT,
848
848
 
849
849
bool Field::optimize_range(uint32_t idx, uint32_t part)
850
850
{
851
 
  return test(table->cursor->index_flags(idx, part, 1) & HA_READ_RANGE);
 
851
  return test(table->file->index_flags(idx, part, 1) & HA_READ_RANGE);
852
852
}
853
853
 
854
854
Field *Field::new_field(MEM_ROOT *root, Table *new_table, bool)
944
944
  case DRIZZLE_TYPE_NULL: return 0;
945
945
  case DRIZZLE_TYPE_BLOB: return 4 + portable_sizeof_char_ptr;
946
946
  case DRIZZLE_TYPE_ENUM:
947
 
  case DRIZZLE_TYPE_DECIMAL:
 
947
  case DRIZZLE_TYPE_NEWDECIMAL:
948
948
    abort();
949
949
  default:
950
950
    return 0;
1037
1037
 
1038
1038
  switch (field_type)
1039
1039
  {
1040
 
  case DRIZZLE_TYPE_DECIMAL:
1041
 
    return new (root) Field_decimal(ptr,
1042
 
                                    field_length,
1043
 
                                    null_pos,
1044
 
                                    null_bit,
1045
 
                                    unireg_check,
1046
 
                                    field_name,
1047
 
                                    decimals,
1048
 
                                    false,
1049
 
                                    false /* is_unsigned */);
 
1040
  case DRIZZLE_TYPE_NEWDECIMAL:
 
1041
    return new (root) Field_new_decimal(ptr,
 
1042
                                        field_length,
 
1043
                                        null_pos,
 
1044
                                        null_bit,
 
1045
                                        unireg_check,
 
1046
                                        field_name,
 
1047
                                        decimals,
 
1048
                                        false,
 
1049
                                        false /* is_unsigned */);
1050
1050
  case DRIZZLE_TYPE_DOUBLE:
1051
1051
    return new (root) Field_double(ptr,
1052
1052
                                   field_length,