~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/statement_transform.cc

  • Committer: Brian Aker
  • Date: 2011-01-08 10:35:13 UTC
  • mfrom: (2057.2.9 timestamp)
  • Revision ID: brian@tangent.org-20110108103513-3wuo8tsyajjcxjrg
Merge in fractional seconds to timestamp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1377
1377
  case Table::Field::DATE:
1378
1378
    destination.append(" DATE", 5);
1379
1379
    break;
 
1380
 
1380
1381
  case Table::Field::EPOCH:
1381
 
    destination.append(" TIMESTAMP",  10);
 
1382
    if (field.time_options().microseconds())
 
1383
    {
 
1384
      destination.append(" TIMESTAMP(6)");
 
1385
    }
 
1386
    else
 
1387
    {
 
1388
      destination.append(" TIMESTAMP",  10);
 
1389
    }
1382
1390
    break;
 
1391
 
1383
1392
  case Table::Field::DATETIME:
1384
1393
    destination.append(" DATETIME",  9);
1385
1394
    break;
1410
1419
    }
1411
1420
  }
1412
1421
 
1413
 
  if (field.has_constraints() &&
1414
 
      ! field.constraints().is_nullable())
 
1422
  if (field.has_constraints() && not field.constraints().is_nullable())
1415
1423
  {
1416
1424
    destination.append(" NOT NULL", 9);
1417
1425
  }
1418
1426
  else if (field.type() == Table::Field::EPOCH)
 
1427
  {
1419
1428
    destination.append(" NULL", 5);
 
1429
  }
1420
1430
 
1421
1431
  if (field.type() == Table::Field::INTEGER || 
1422
1432
      field.type() == Table::Field::BIGINT)
1500
1510
  case DRIZZLE_TYPE_NULL:
1501
1511
    assert(false); /* Not a user definable type */
1502
1512
    return Table::Field::INTEGER; /* unreachable */
 
1513
  case DRIZZLE_TYPE_MICROTIME:
1503
1514
  case DRIZZLE_TYPE_TIMESTAMP:
1504
1515
    return Table::Field::EPOCH;
1505
1516
  case DRIZZLE_TYPE_LONGLONG: