~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/schema_engine.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-23 10:47:03 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110623104703-hw93svu0vfgcqt9p
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
146
146
    if (success)
147
147
    {
148
148
      success_count++;
149
 
      TransactionServices &transaction_services= TransactionServices::singleton();
150
 
      transaction_services.allocateNewTransactionId();
 
149
      TransactionServices::allocateNewTransactionId();
151
150
    }
152
151
  }
153
152
};
161
160
 
162
161
  if (success_count)
163
162
  {
164
 
    TransactionServices &transaction_services= TransactionServices::singleton();
165
 
    transaction_services.allocateNewTransactionId();
 
163
    TransactionServices::allocateNewTransactionId();
166
164
  }
167
165
 
168
166
  return (bool)success_count;
190
188
    if (success)
191
189
    {
192
190
      success_count++;
193
 
      TransactionServices &transaction_services= TransactionServices::singleton();
194
 
      transaction_services.allocateNewTransactionId();
 
191
      TransactionServices::allocateNewTransactionId();
195
192
    }
196
193
  }
197
194
};
201
198
                                      identifier::table::vector &dropped_tables,
202
199
                                      uint64_t &deleted)
203
200
{
204
 
  TransactionServices &transaction_services= TransactionServices::singleton();
205
 
 
206
201
  plugin::StorageEngine::getIdentifiers(session, identifier, dropped_tables);
207
202
 
208
 
  for (identifier::table::vector::iterator it= dropped_tables.begin();
209
 
       it != dropped_tables.end();
210
 
       it++)
 
203
  for (identifier::table::vector::iterator it= dropped_tables.begin(); it != dropped_tables.end(); it++)
211
204
  {
212
205
    boost::mutex::scoped_lock scopedLock(table::Cache::mutex());
213
206
 
224
217
      my_error(ER_TABLE_DROP, *it);
225
218
      return false;
226
219
    }
227
 
    transaction_services.dropTable(session, *it, *message, true);
 
220
    TransactionServices::dropTable(session, *it, *message, true);
228
221
    deleted++;
229
222
  }
230
223
 
284
277
    else
285
278
    {
286
279
      /* We've already verified that the schema does exist, so safe to log it */
287
 
      TransactionServices &transaction_services= TransactionServices::singleton();
288
 
      transaction_services.dropSchema(session, identifier, schema_message);
 
280
      TransactionServices::dropSchema(session, identifier, schema_message);
289
281
    }
290
282
  } while (0);
291
283
 
337
329
 
338
330
  if (success_count)
339
331
  {
340
 
    TransactionServices &transaction_services= TransactionServices::singleton();
341
 
    transaction_services.allocateNewTransactionId();
 
332
    TransactionServices::allocateNewTransactionId();
342
333
  }
343
334
 
344
335
  return success_count ? true : false;