~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

  • Committer: Mark Atwood
  • Date: 2011-06-24 11:45:17 UTC
  • mfrom: (2318.6.64 rf)
  • Revision ID: me@mark.atwood.name-20110624114517-1mq8no6jlp2nrg7m
mergeĀ lp:~olafvdspek/drizzle/refactor15

Show diffs side-by-side

added added

removed removed

Lines of Context:
608
608
  Performs checks upon the table.
609
609
 
610
610
  @param session                thread doing CHECK Table operation
611
 
  @param check_opt          options from the parser
612
611
 
613
612
  @retval
614
613
    HA_ADMIN_OK               Successful upgrade
619
618
  @retval
620
619
    HA_ADMIN_NOT_IMPLEMENTED
621
620
*/
622
 
int Cursor::ha_check(Session *, HA_CHECK_OPT *)
 
621
int Cursor::ha_check(Session *)
623
622
{
624
623
  return HA_ADMIN_OK;
625
624
}
680
679
     * @todo Make TransactionServices generic to AfterTriggerServices
681
680
     * or similar...
682
681
     */
683
 
    Session *const session= getTable()->in_use;
684
 
    TransactionServices &transaction_services= TransactionServices::singleton();
685
 
    transaction_services.truncateTable(*session, *getTable());
 
682
    Session& session= *getTable()->in_use;
 
683
    TransactionServices::truncateTable(session, *getTable());
686
684
  }
687
685
 
688
686
  return result;
711
709
*/
712
710
 
713
711
int
714
 
Cursor::ha_analyze(Session* session, HA_CHECK_OPT*)
 
712
Cursor::ha_analyze(Session* session)
715
713
{
716
714
  setTransactionReadWrite();
717
715
 
1263
1261
                                    const unsigned char *before_record,
1264
1262
                                    const unsigned char *after_record)
1265
1263
{
1266
 
  TransactionServices &transaction_services= TransactionServices::singleton();
1267
1264
  Session *const session= table->in_use;
1268
1265
 
1269
 
  if (table->getShare()->getType() || not transaction_services.shouldConstructMessages())
 
1266
  if (table->getShare()->getType() || not TransactionServices::shouldConstructMessages())
1270
1267
    return false;
1271
1268
 
1272
1269
  bool result= false;
1283
1280
     * CREATE TABLE will commit the transaction containing
1284
1281
     * it).
1285
1282
     */
1286
 
    result= transaction_services.insertRecord(*session, *table);
 
1283
    result= TransactionServices::insertRecord(*session, *table);
1287
1284
    break;
1288
1285
  case SQLCOM_REPLACE:
1289
1286
  case SQLCOM_REPLACE_SELECT:
1312
1309
       * as the row to delete (this is the conflicting row), so
1313
1310
       * we need to notify TransactionService to use that row.
1314
1311
       */
1315
 
      transaction_services.deleteRecord(*session, *table, true);
 
1312
      TransactionServices::deleteRecord(*session, *table, true);
1316
1313
      /* 
1317
1314
       * We set the "current" statement message to NULL.  This triggers
1318
1315
       * the replication services component to generate a new statement
1319
1316
       * message for the inserted record which will come next.
1320
1317
       */
1321
 
      transaction_services.finalizeStatementMessage(*session->getStatementMessage(), *session);
 
1318
      TransactionServices::finalizeStatementMessage(*session->getStatementMessage(), *session);
1322
1319
    }
1323
1320
    else
1324
1321
    {
1325
1322
      if (before_record == NULL)
1326
 
        result= transaction_services.insertRecord(*session, *table);
 
1323
        result= TransactionServices::insertRecord(*session, *table);
1327
1324
      else
1328
 
        transaction_services.updateRecord(*session, *table, before_record, after_record);
 
1325
        TransactionServices::updateRecord(*session, *table, before_record, after_record);
1329
1326
    }
1330
1327
    break;
1331
1328
  case SQLCOM_INSERT:
1338
1335
     * an update.
1339
1336
     */
1340
1337
    if (before_record == NULL)
1341
 
      result= transaction_services.insertRecord(*session, *table);
 
1338
      result= TransactionServices::insertRecord(*session, *table);
1342
1339
    else
1343
 
      transaction_services.updateRecord(*session, *table, before_record, after_record);
 
1340
      TransactionServices::updateRecord(*session, *table, before_record, after_record);
1344
1341
    break;
1345
1342
 
1346
1343
  case SQLCOM_UPDATE:
1347
 
    transaction_services.updateRecord(*session, *table, before_record, after_record);
 
1344
    TransactionServices::updateRecord(*session, *table, before_record, after_record);
1348
1345
    break;
1349
1346
 
1350
1347
  case SQLCOM_DELETE:
1351
 
    transaction_services.deleteRecord(*session, *table);
 
1348
    TransactionServices::deleteRecord(*session, *table);
1352
1349
    break;
1353
1350
  default:
1354
1351
    break;