~thomir-deactivatedaccount/drizzle/drizzle-fix-bug653747

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2010-10-10 02:07:52 UTC
  • mfrom: (1827.2.3 staging)
  • Revision ID: brian@tangent.org-20101010020752-ktv73isay5dxtvp3
Merge in switch on table_share_instance inheritance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1445
1445
                                 &key_info_buffer, &key_count,
1446
1446
                                 select_field_count))
1447
1447
  {
1448
 
    boost_unique_lock_t lock(LOCK_open); /* CREATE TABLE (some confussion on naming, double check) */
 
1448
    boost::mutex::scoped_lock lock(LOCK_open); /* CREATE TABLE (some confussion on naming, double check) */
1449
1449
    error= locked_create_event(session,
1450
1450
                               identifier,
1451
1451
                               create_info,
1511
1511
 
1512
1512
  if (name_lock)
1513
1513
  {
1514
 
    boost_unique_lock_t lock(LOCK_open); /* Lock for removing name_lock during table create */
 
1514
    boost::mutex::scoped_lock lock(LOCK_open); /* Lock for removing name_lock during table create */
1515
1515
    session->unlink_open_table(name_lock);
1516
1516
  }
1517
1517
 
1680
1680
  mysql_lock_abort(session, table);     /* end threads waiting on lock */
1681
1681
 
1682
1682
  /* Wait until all there are no other threads that has this table open */
1683
 
  TableIdentifier identifier(table->getShare()->getSchemaName(), table->getShare()->getTableName());
 
1683
  TableIdentifier identifier(table->getMutableShare()->getSchemaName(), table->getMutableShare()->getTableName());
1684
1684
  remove_table_from_cache(session, identifier, RTFC_WAIT_OTHER_THREAD_FLAG);
1685
1685
}
1686
1686
 
1832
1832
      const char *old_message=session->enter_cond(COND_refresh, LOCK_open,
1833
1833
                                                  "Waiting to get writelock");
1834
1834
      mysql_lock_abort(session,table->table);
1835
 
      TableIdentifier identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
 
1835
      TableIdentifier identifier(table->table->getMutableShare()->getSchemaName(), table->table->getMutableShare()->getTableName());
1836
1836
      remove_table_from_cache(session, identifier,
1837
1837
                              RTFC_WAIT_OTHER_THREAD_FLAG |
1838
1838
                              RTFC_CHECK_KILLED_FLAG);
1935
1935
        }
1936
1936
        else
1937
1937
        {
1938
 
          boost::unique_lock<boost::mutex> lock(LOCK_open);
1939
 
          TableIdentifier identifier(table->table->getShare()->getSchemaName(), table->table->getShare()->getTableName());
 
1938
          boost::mutex::scoped_lock lock(LOCK_open);
 
1939
          TableIdentifier identifier(table->table->getMutableShare()->getSchemaName(), table->table->getMutableShare()->getTableName());
1940
1940
          remove_table_from_cache(session, identifier, RTFC_NO_FLAG);
1941
1941
        }
1942
1942
      }
2077
2077
  if (session->open_tables_from_list(&src_table, &not_used))
2078
2078
    return true;
2079
2079
 
2080
 
  TableIdentifier src_identifier(src_table->table->getShare()->getSchemaName(),
2081
 
                                 src_table->table->getShare()->getTableName(), src_table->table->getShare()->getType());
 
2080
  TableIdentifier src_identifier(src_table->table->getMutableShare()->getSchemaName(),
 
2081
                                 src_table->table->getMutableShare()->getTableName(), src_table->table->getMutableShare()->getType());
2082
2082
 
2083
2083
 
2084
2084
 
2122
2122
    {
2123
2123
      if (name_lock)
2124
2124
      {
2125
 
        boost_unique_lock_t lock(LOCK_open); /* unlink open tables for create table like*/
 
2125
        boost::mutex::scoped_lock lock(LOCK_open); /* unlink open tables for create table like*/
2126
2126
        session->unlink_open_table(name_lock);
2127
2127
      }
2128
2128
 
2141
2141
    {
2142
2142
      bool was_created;
2143
2143
      {
2144
 
        boost_unique_lock_t lock(LOCK_open); /* We lock for CREATE TABLE LIKE to copy table definition */
 
2144
        boost::mutex::scoped_lock lock(LOCK_open); /* We lock for CREATE TABLE LIKE to copy table definition */
2145
2145
        was_created= create_table_wrapper(*session, create_table_proto, destination_identifier,
2146
2146
                                               src_identifier, is_engine_set);
2147
2147
      }
2160
2160
 
2161
2161
    if (name_lock)
2162
2162
    {
2163
 
      boost_unique_lock_t lock(LOCK_open); /* unlink open tables for create table like*/
 
2163
      boost::mutex::scoped_lock lock(LOCK_open); /* unlink open tables for create table like*/
2164
2164
      session->unlink_open_table(name_lock);
2165
2165
    }
2166
2166
  }