~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-22 07:12:16 UTC
  • mfrom: (2096.1.16 alter-table)
  • Revision ID: brian@tangent.org-20110122071216-j0e8bwecb1cqefm9
Merge in work for parser cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1404
1404
    destination.append(" INT", 4);
1405
1405
    break;
1406
1406
  case Table::Field::BIGINT:
1407
 
    destination.append(" BIGINT", 7);
 
1407
    if (field.has_constraints() and
 
1408
        field.constraints().is_unsigned())
 
1409
    {
 
1410
      destination.append(" BIGINT UNSIGNED", sizeof(" BIGINT UNSIGNED") -1);
 
1411
    }
 
1412
    else
 
1413
    {
 
1414
      destination.append(" BIGINT", 7);
 
1415
    }
1408
1416
    break;
1409
1417
  case Table::Field::DECIMAL:
1410
1418
    {
1438
1446
    break;
1439
1447
  }
1440
1448
 
1441
 
  if (field.type() == Table::Field::INTEGER || 
1442
 
      field.type() == Table::Field::BIGINT)
1443
 
  {
1444
 
    if (field.has_constraints() &&
1445
 
        field.constraints().has_is_unsigned() &&
1446
 
        field.constraints().is_unsigned())
1447
 
    {
1448
 
      destination.append(" UNSIGNED", 9);
1449
 
    }
1450
 
  }
1451
 
 
1452
1449
  if (field.type() == Table::Field::BLOB ||
1453
1450
      field.type() == Table::Field::VARCHAR)
1454
1451
  {
1460
1457
    }
1461
1458
  }
1462
1459
 
 
1460
  if (field.has_constraints() and field.constraints().is_unique())
 
1461
  {
 
1462
    destination.append(" UNIQUE", sizeof(" UNIQUE") -1);
 
1463
  }
 
1464
 
1463
1465
  if (field.has_constraints() && field.constraints().is_notnull())
1464
1466
  {
1465
1467
    destination.append(" NOT NULL", 9);
1494
1496
  {
1495
1497
    const string &v= field.options().default_bin_value();
1496
1498
    if (v.length() == 0)
 
1499
    {
1497
1500
      destination.append(" DEFAULT ''", 11);
 
1501
    }
1498
1502
    else
1499
1503
    {
1500
1504
      destination.append(" DEFAULT 0x", 11);