~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/cache.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
Remove custom error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
23
#include <sys/types.h>
24
24
#include <sys/stat.h>
25
25
#include <fcntl.h>
26
26
 
27
27
 
28
 
#include <drizzled/identifier.h>
29
 
#include <drizzled/table.h>
30
 
#include <drizzled/session.h>
31
 
#include <drizzled/table/concurrent.h>
32
 
 
33
 
#include <drizzled/table/cache.h>
34
 
#include <drizzled/table/unused.h>
35
 
 
36
 
#include <drizzled/pthread_globals.h>
 
28
#include "drizzled/identifier/table.h"
 
29
#include "drizzled/table.h"
 
30
#include "drizzled/session.h"
 
31
#include "drizzled/table/concurrent.h"
 
32
 
 
33
#include "drizzled/table/cache.h"
 
34
#include "drizzled/table/unused.h"
 
35
 
 
36
#include "drizzled/pthread_globals.h"
37
37
 
38
38
namespace drizzled
39
39
{
67
67
    getUnused().unlink(table);
68
68
  }
69
69
 
70
 
  boost::checked_delete(table);
 
70
  delete table;
71
71
}
72
72
 
73
73
void remove_table(table::Concurrent *arg)
99
99
{
100
100
  do
101
101
  {
102
 
    const identifier::Table::Key &key(table->getShare()->getCacheKey());
 
102
    const TableIdentifier::Key &key(table->getShare()->getCacheKey());
103
103
 
104
104
    table::CacheRange ppp= table::getCache().equal_range(key);
105
105
 
136
136
and afterwards delete those marked unused.
137
137
*/
138
138
 
139
 
void Cache::removeSchema(const identifier::Schema &schema_identifier)
 
139
void Cache::removeSchema(const SchemaIdentifier &schema_identifier)
140
140
{
141
141
  boost::mutex::scoped_lock scopedLock(_mutex);
142
142
 
172
172
  1  Table is in use by another thread
173
173
*/
174
174
 
175
 
bool Cache::removeTable(Session *session, identifier::Table &identifier, uint32_t flags)
 
175
bool Cache::removeTable(Session *session, TableIdentifier &identifier, uint32_t flags)
176
176
{
177
 
  const identifier::Table::Key &key(identifier.getKey());
 
177
  const TableIdentifier::Key &key(identifier.getKey());
178
178
  bool result= false; 
179
179
  bool signalled= false;
180
180
 
235
235
    table::getUnused().cullByVersion();
236
236
 
237
237
    /* Remove table from table definition cache if it's not in use */
238
 
    table::instance::release(identifier);
 
238
    TableShare::release(identifier);
239
239
 
240
240
    if (result && (flags & RTFC_WAIT_OTHER_THREAD_FLAG))
241
241
    {