~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: Stewart Smith
  • Date: 2011-01-14 05:19:11 UTC
  • mto: (2086.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 2087.
  • Revision ID: stewart@flamingspork.com-20110114051911-blfrsfy6yjvjg9rs
add note that impl of DROP INDEX should be documented

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
 
#include <drizzled/session.h>
28
 
#include <plugin/myisam/myisam.h>
29
 
#include <drizzled/plugin/transactional_storage_engine.h>
30
 
 
31
 
#include <drizzled/table/instance.h>
32
 
 
33
 
#include <drizzled/table.h>
 
27
#include "drizzled/session.h"
 
28
#include "plugin/myisam/myisam.h"
 
29
#include "drizzled/plugin/transactional_storage_engine.h"
 
30
 
 
31
#include "drizzled/table.h"
34
32
 
35
33
namespace drizzled
36
34
{
68
66
  if (session->getKilled())
69
67
    return true;
70
68
 
71
 
  identifier::Table identifier(table_list->getSchemaName(), table_list->getTableName());
 
69
  TableIdentifier identifier(table_list->getSchemaName(), table_list->getTableName());
72
70
  if (open_unireg_entry(session, table_list->getTableName(), identifier))
73
71
  {
74
72
    intern_close_table();
121
119
 
122
120
int table::Concurrent::open_unireg_entry(Session *session,
123
121
                                         const char *alias,
124
 
                                         identifier::Table &identifier)
 
122
                                         TableIdentifier &identifier)
125
123
{
126
124
  int error;
127
125
  TableShare::shared_ptr share;
129
127
 
130
128
  safe_mutex_assert_owner(table::Cache::singleton().mutex().native_handle());
131
129
retry:
132
 
  if (not (share= table::instance::Shared::make_shared(session,
133
 
                                                       identifier,
134
 
                                                       error)))
 
130
  if (not (share= TableShare::getShareCreate(session,
 
131
                                             identifier,
 
132
                                             error)))
135
133
  {
136
134
    return 1;
137
135
  }
150
148
      share->resetVersion();                        // Mark share as old
151
149
      if (discover_retry_count++)               // Retry once
152
150
      {
153
 
        table::instance::release(share);
 
151
        TableShare::release(share);
154
152
        return 1;
155
153
      }
156
154
 
175
173
      */
176
174
      if (share->getTableCount() != 1)
177
175
      {
178
 
        table::instance::release(share);
 
176
        TableShare::release(share);
179
177
        return 1;
180
178
      }
181
 
 
182
179
      /* Free share and wait until it's released by all threads */
183
 
      table::instance::release(share);
 
180
      TableShare::release(share);
184
181
 
185
182
      if (not session->getKilled())
186
183
      {
188
185
        session->clear_error();                 // Clear error message
189
186
        goto retry;
190
187
      }
191
 
 
192
188
      return 1;
193
189
    }
194
190
 
195
 
    table::instance::release(share);
 
191
    TableShare::release(share);
196
192
 
197
193
    return 1;
198
194
  }
208
204
  // delete if this happens.
209
205
  if (getShare()->getType() == message::Table::STANDARD)
210
206
  {
211
 
    table::instance::release(getMutableShare());
 
207
    TableShare::release(getMutableShare());
212
208
  }
213
209
  else
214
210
  {