~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table/concurrent.cc

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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
 
 
 
27
#include <drizzled/session.h>
 
28
#include <plugin/myisam/myisam.h>
 
29
#include <drizzled/open_tables_state.h>
 
30
#include <drizzled/plugin/transactional_storage_engine.h>
31
31
#include <drizzled/table/instance.h>
32
 
 
33
 
#include "drizzled/table.h"
34
 
 
35
 
namespace drizzled
36
 
{
37
 
 
38
 
namespace table
39
 
{
 
32
#include <drizzled/table.h>
 
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
 
  if (not (share= table::instance::Shared::make_shared(session,
133
 
                                                       identifier,
134
 
                                                       error)))
 
129
  if (not (share= table::instance::Shared::make_shared(session, identifier, error)))
135
130
  {
136
131
    return 1;
137
132
  }