~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Lee Bieber
  • Date: 2011-03-23 23:16:25 UTC
  • mfrom: (2247.1.2 build)
  • Revision ID: kalebral@gmail.com-20110323231625-61k77qbh7n1iu776
Merge Olaf - Use BOOST_FOREACH
Merge Olaf - Remove std::nothrow from new()

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
    {
237
237
      std::string table_error;
238
238
 
239
 
      for (util::string::vector::iterator iter= wrong_tables.begin();
240
 
           iter != wrong_tables.end();
241
 
           iter++)
 
239
      BOOST_FOREACH(util::string::vector::reference iter, wrong_tables)
242
240
      {
243
 
        table_error+= *iter;
 
241
        table_error+= iter;
244
242
        table_error+= ',';
245
243
      }
246
244
      table_error.resize(table_error.size() -1);
1627
1625
                   const identifier::Table &from,
1628
1626
                   const identifier::Table &to)
1629
1627
{
1630
 
  int error= 0;
1631
 
 
1632
 
  assert(base);
1633
 
 
1634
1628
  if (not plugin::StorageEngine::doesSchemaExist(to))
1635
1629
  {
1636
1630
    my_error(ER_NO_DB_ERROR, MYF(0), to.getSchemaName().c_str());
1637
1631
    return true;
1638
1632
  }
1639
1633
 
1640
 
  error= base->renameTable(session, from, to);
1641
 
 
 
1634
  int error= base->renameTable(session, from, to);
1642
1635
  if (error == HA_ERR_WRONG_COMMAND)
1643
 
  {
1644
1636
    my_error(ER_NOT_SUPPORTED_YET, MYF(0), "ALTER Table");
1645
 
  }
1646
1637
  else if (error)
1647
1638
  {
1648
 
    std::string from_path;
1649
 
    std::string to_path;
1650
 
 
1651
 
    from.getSQLPath(from_path);
1652
 
    to.getSQLPath(to_path);
1653
 
 
1654
 
    const char *from_identifier= from.isTmp() ? "#sql-temporary" : from_path.c_str();
1655
 
    const char *to_identifier= to.isTmp() ? "#sql-temporary" : to_path.c_str();
1656
 
 
1657
 
    my_error(ER_ERROR_ON_RENAME, MYF(0), from_identifier, to_identifier, error);
 
1639
    my_error(ER_ERROR_ON_RENAME, MYF(0), 
 
1640
                        from.isTmp() ? "#sql-temporary" : from.getSQLPath().c_str(), 
 
1641
                        to.isTmp() ? "#sql-temporary" : to.getSQLPath().c_str(), error);
1658
1642
  }
1659
 
 
1660
 
  return error ? true : false; 
 
1643
  return error; 
1661
1644
}
1662
1645
 
1663
1646
 
1770
1753
  for (table= tables; table; table= table->next_local)
1771
1754
  {
1772
1755
    identifier::Table table_identifier(table->getSchemaName(), table->getTableName());
1773
 
    std::string table_name;
1774
1756
    bool fatal_error=0;
1775
1757
 
1776
 
    table_identifier.getSQLPath(table_name);
 
1758
    std::string table_name = table_identifier.getSQLPath();
1777
1759
 
1778
1760
    table->lock_type= lock_type;
1779
1761
    /* open only one table from local list of command */