~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2011-02-15 18:20:10 UTC
  • mfrom: (2167.3.2 drizzle-build)
  • Revision ID: brian@tangent.org-20110215182010-a19zcrdzp4h0hw49
Merge datetime tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1090
1090
 
1091
1091
bool Item::is_datetime()
1092
1092
{
1093
 
  switch (field_type())
1094
 
  {
1095
 
    case DRIZZLE_TYPE_TIME:
1096
 
    case DRIZZLE_TYPE_DATE:
1097
 
    case DRIZZLE_TYPE_DATETIME:
1098
 
    case DRIZZLE_TYPE_TIMESTAMP:
1099
 
    case DRIZZLE_TYPE_MICROTIME:
1100
 
      return true;
1101
 
    case DRIZZLE_TYPE_BLOB:
1102
 
    case DRIZZLE_TYPE_VARCHAR:
1103
 
    case DRIZZLE_TYPE_DOUBLE:
1104
 
    case DRIZZLE_TYPE_DECIMAL:
1105
 
    case DRIZZLE_TYPE_ENUM:
1106
 
    case DRIZZLE_TYPE_LONG:
1107
 
    case DRIZZLE_TYPE_LONGLONG:
1108
 
    case DRIZZLE_TYPE_NULL:
1109
 
    case DRIZZLE_TYPE_UUID:
1110
 
    case DRIZZLE_TYPE_BOOLEAN:
1111
 
      return false;
1112
 
  }
1113
 
 
1114
 
  assert(0);
1115
 
  abort();
 
1093
  return field::isDateTime(field_type());
1116
1094
}
1117
1095
 
1118
1096
String *Item::check_well_formed_result(String *str, bool send_error)
1219
1197
                            name, decimals, 0, unsigned_flag);
1220
1198
    break;
1221
1199
  case DRIZZLE_TYPE_NULL:
1222
 
    field= new Field_null((unsigned char*) 0, max_length, name, &my_charset_bin);
 
1200
    field= new Field_null((unsigned char*) 0, max_length, name);
1223
1201
    break;
1224
1202
  case DRIZZLE_TYPE_DATE:
1225
 
    field= new Field_date(maybe_null, name, &my_charset_bin);
 
1203
    field= new Field_date(maybe_null, name);
1226
1204
    break;
1227
1205
 
1228
1206
  case DRIZZLE_TYPE_MICROTIME:
1233
1211
    field= new field::Epoch(maybe_null, name);
1234
1212
    break;
1235
1213
  case DRIZZLE_TYPE_DATETIME:
1236
 
    field= new Field_datetime(maybe_null, name, &my_charset_bin);
 
1214
    field= new Field_datetime(maybe_null, name);
1237
1215
    break;
1238
1216
  case DRIZZLE_TYPE_TIME:
1239
 
    field= new field::Time(maybe_null, name, &my_charset_bin);
 
1217
    field= new field::Time(maybe_null, name);
1240
1218
    break;
1241
1219
  case DRIZZLE_TYPE_BOOLEAN:
1242
1220
  case DRIZZLE_TYPE_UUID:
1703
1681
  case STRING_RESULT:
1704
1682
    assert(item->collation.collation);
1705
1683
 
1706
 
    enum enum_field_types type;
1707
1684
    /*
1708
1685
      DATE/TIME fields have STRING_RESULT result type.
1709
1686
      To preserve type they needed to be handled separately.
1710
1687
    */
1711
 
    if ((type= item->field_type()) == DRIZZLE_TYPE_DATETIME ||
1712
 
        type == DRIZZLE_TYPE_TIME ||
1713
 
        type == DRIZZLE_TYPE_MICROTIME ||
1714
 
        type == DRIZZLE_TYPE_DATE ||
1715
 
        type == DRIZZLE_TYPE_TIMESTAMP)
 
1688
    if (field::isDateTime(item->field_type()))
1716
1689
    {
1717
1690
      new_field= item->tmp_table_field_from_field_type(table, 1);
1718
1691
      /*