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

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
#include <drizzled/session.h>
28
28
#include <plugin/myisam/myisam.h>
 
29
#include <drizzled/open_tables_state.h>
29
30
#include <drizzled/plugin/transactional_storage_engine.h>
30
 
 
31
31
#include <drizzled/table/instance.h>
32
 
 
33
32
#include <drizzled/table.h>
34
 
 
35
 
namespace drizzled
36
 
{
37
 
 
38
 
namespace table
39
 
{
 
33
#include <drizzled/table_list.h>
 
34
 
 
35
namespace drizzled {
 
36
namespace table {
40
37
 
41
38
/*
42
39
  Open table which is already name-locked by this thread.
54
51
  pointer.
55
52
 
56
53
  NOTE
57
 
  This function assumes that its caller already acquired table::Cache::singleton().mutex() mutex.
 
54
  This function assumes that its caller already acquired table::Cache::mutex() mutex.
58
55
 
59
56
  RETURN VALUE
60
57
  false - Success
63
60
 
64
61
bool Concurrent::reopen_name_locked_table(TableList* table_list, Session *session)
65
62
{
66
 
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
 
63
  safe_mutex_assert_owner(table::Cache::mutex().native_handle());
67
64
 
68
65
  if (session->getKilled())
69
66
    return true;
86
83
  getMutableShare()->resetVersion();
87
84
  in_use = session;
88
85
 
89
 
  tablenr= session->current_tablenr++;
 
86
  tablenr= session->open_tables.current_tablenr++;
90
87
  used_fields= 0;
91
88
  const_table= 0;
92
89
  null_row= false;
112
109
 
113
110
  NOTES
114
111
  Extra argument for open is taken from session->open_options
115
 
  One must have a lock on table::Cache::singleton().mutex() when calling this function
 
112
  One must have a lock on table::Cache::mutex() when calling this function
116
113
 
117
114
  RETURN
118
115
  0     ok
127
124
  TableShare::shared_ptr share;
128
125
  uint32_t discover_retry_count= 0;
129
126
 
130
 
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
 
127
  safe_mutex_assert_owner(table::Cache::mutex().native_handle());
131
128
retry:
132
129
  if (not (share= table::instance::Shared::make_shared(session, identifier, error)))
133
130
  {
182
179
 
183
180
      if (not session->getKilled())
184
181
      {
185
 
        drizzle_reset_errors(session, 1);         // Clear warnings
 
182
        drizzle_reset_errors(*session, true);         // Clear warnings
186
183
        session->clear_error();                 // Clear error message
187
184
        goto retry;
188
185
      }