~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-10-29 15:43:40 UTC
  • mfrom: (1.2.12) (2.1.19 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131029154340-2gp39el6cv8bwf2o
Tags: 1:7.2.3-2ubuntu1
* Merge from debian, remaining changes:
  - Link against boost_system because of boost_thread.
  - Add required libs to message/include.am
  - Add upstart job and adjust init script to be upstart compatible.
  - Disable -floop-parallelize-all due to gcc-4.8/4.9 compiler ICE
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57732

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
static const char *make_unique_key_name(const char *field_name,KeyInfo *start,KeyInfo *end);
66
66
static bool prepare_blob_field(Session *session, CreateField *sql_field);
67
67
 
68
 
void set_table_default_charset(HA_CREATE_INFO *create_info, const char *db)
 
68
void set_table_default_charset(const identifier::Catalog &catalog, HA_CREATE_INFO *create_info, const char *db)
69
69
{
70
70
  /*
71
71
    If the table character set was not given explicitly,
73
73
    apply it to the table.
74
74
  */
75
75
  if (not create_info->default_table_charset)
76
 
    create_info->default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier::Schema(str_ref(db)));
 
76
    create_info->default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier::Schema(catalog, str_ref(db)));
77
77
}
78
78
 
79
79
/*
125
125
 
126
126
    for (table= tables; table; table= table->next_local)
127
127
    {
128
 
      identifier::Table tmp_identifier(table->getSchemaName(), table->getTableName());
 
128
      identifier::Table tmp_identifier(session->catalog().identifier(),
 
129
                                       table->getSchemaName(),
 
130
                                       table->getTableName());
129
131
 
130
132
      error= session->open_tables.drop_temporary_table(tmp_identifier);
131
133
 
159
161
          break;
160
162
        }
161
163
      }
162
 
      identifier::Table identifier(table->getSchemaName(), table->getTableName(), table->getInternalTmpTable() ? message::Table::INTERNAL : message::Table::STANDARD);
 
164
      identifier::Table identifier(session->catalog().identifier(),
 
165
                                   table->getSchemaName(),
 
166
                                   table->getTableName(),
 
167
                                   table->getInternalTmpTable() ? message::Table::INTERNAL : message::Table::STANDARD);
163
168
 
164
169
      message::table::shared_ptr message= plugin::StorageEngine::getTableMessage(*session, identifier, true);
165
170
 
1406
1411
  assert(identifier.getTableName() == table_proto.name());
1407
1412
  db_options= create_info->table_options;
1408
1413
 
1409
 
  set_table_default_charset(create_info, identifier.getSchemaName().c_str());
 
1414
  set_table_default_charset(session->catalog().identifier(),create_info, identifier.getSchemaName().c_str());
1410
1415
 
1411
1416
  /* Build a Table object to pass down to the engine, and the do the actual create. */
1412
1417
  if (not prepare_create_table(session, create_info, table_proto, alter_info,
1639
1644
  session->abortLock(table);    /* end threads waiting on lock */
1640
1645
 
1641
1646
  /* Wait until all there are no other threads that has this table open */
1642
 
  identifier::Table identifier(table->getShare()->getSchemaName(), table->getShare()->getTableName());
 
1647
  identifier::Table identifier(session->catalog().identifier(),table->getShare()->getSchemaName(), table->getShare()->getTableName());
1643
1648
  table::Cache::removeTable(*session, identifier, RTFC_WAIT_OTHER_THREAD_FLAG);
1644
1649
}
1645
1650
 
1711
1716
 
1712
1717
  for (table= tables; table; table= table->next_local)
1713
1718
  {
1714
 
    identifier::Table table_identifier(table->getSchemaName(), table->getTableName());
 
1719
    identifier::Table table_identifier(session->catalog().identifier(), table->getSchemaName(), table->getTableName());
1715
1720
    bool fatal_error=0;
1716
1721
 
1717
1722
    std::string table_name = table_identifier.getSQLPath();
1785
1790
      const char *old_message=session->enter_cond(COND_refresh, table::Cache::mutex(),
1786
1791
                                                  "Waiting to get writelock");
1787
1792
      session->abortLock(table->table);
1788
 
      identifier::Table identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
 
1793
      identifier::Table identifier(session->catalog().identifier(),table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
1789
1794
      table::Cache::removeTable(*session, identifier, RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG);
1790
1795
      session->exit_cond(old_message);
1791
1796
      if (session->getKilled())
1884
1889
        else
1885
1890
        {
1886
1891
          boost::unique_lock<boost::mutex> lock(table::Cache::mutex());
1887
 
          identifier::Table identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
 
1892
          identifier::Table identifier(session->catalog().identifier(),
 
1893
                                       table->table->getShare()->getSchemaName(),
 
1894
                                       table->table->getShare()->getTableName());
1888
1895
          table::Cache::removeTable(*session, identifier, RTFC_NO_FLAG);
1889
1896
        }
1890
1897
      }