~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

  • Committer: Brian Aker
  • Date: 2009-12-18 23:20:19 UTC
  • mfrom: (1241.7.8 fix-dtrace-target)
  • Revision ID: brian@gaz-20091218232019-2eg8yvil821t08pr
MErge Padraig

Show diffs side-by-side

added added

removed removed

Lines of Context:
1438
1438
  */
1439
1439
  assert(next_insert_id == 0);
1440
1440
 
 
1441
  if (DRIZZLE_CURSOR_RDLOCK_START_ENABLED() ||
 
1442
      DRIZZLE_CURSOR_WRLOCK_START_ENABLED() ||
 
1443
      DRIZZLE_CURSOR_UNLOCK_START_ENABLED())
 
1444
  {
 
1445
    if (lock_type == F_RDLCK)
 
1446
    {
 
1447
      DRIZZLE_CURSOR_RDLOCK_START(table_share->db.str,
 
1448
                                  table_share->table_name.str);
 
1449
    }
 
1450
    else if (lock_type == F_WRLCK)
 
1451
    {
 
1452
      DRIZZLE_CURSOR_WRLOCK_START(table_share->db.str,
 
1453
                                  table_share->table_name.str);
 
1454
    }
 
1455
    else if (lock_type == F_UNLCK)
 
1456
    {
 
1457
      DRIZZLE_CURSOR_UNLOCK_START(table_share->db.str,
 
1458
                                  table_share->table_name.str);
 
1459
    }
 
1460
  }
 
1461
 
1441
1462
  /*
1442
1463
    We cache the table flags if the locking succeeded. Otherwise, we
1443
1464
    keep them as they were when they were fetched in ha_open().
1445
1466
 
1446
1467
  int error= external_lock(session, lock_type);
1447
1468
 
 
1469
  if (DRIZZLE_CURSOR_RDLOCK_DONE_ENABLED() ||
 
1470
      DRIZZLE_CURSOR_WRLOCK_DONE_ENABLED() ||
 
1471
      DRIZZLE_CURSOR_UNLOCK_DONE_ENABLED())
 
1472
  {
 
1473
    if (lock_type == F_RDLCK)
 
1474
    {
 
1475
      DRIZZLE_CURSOR_RDLOCK_DONE(error);
 
1476
    }
 
1477
    else if (lock_type == F_WRLCK)
 
1478
    {
 
1479
      DRIZZLE_CURSOR_WRLOCK_DONE(error);
 
1480
    }
 
1481
    else if (lock_type == F_UNLCK)
 
1482
    {
 
1483
      DRIZZLE_CURSOR_UNLOCK_DONE(error);
 
1484
    }
 
1485
  }
 
1486
 
1448
1487
  return error;
1449
1488
}
1450
1489
 
1483
1522
  if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
1484
1523
    table->timestamp_field->set_time();
1485
1524
 
 
1525
  DRIZZLE_INSERT_ROW_START(table_share->db.str, table_share->table_name.str);
1486
1526
  mark_trx_read_write();
 
1527
  error= write_row(buf);
 
1528
  DRIZZLE_INSERT_ROW_DONE(error);
1487
1529
 
1488
 
  if (unlikely(error= write_row(buf)))
 
1530
  if (unlikely(error))
1489
1531
  {
1490
1532
    return error;
1491
1533
  }
1507
1549
   */
1508
1550
  assert(new_data == table->record[0]);
1509
1551
 
 
1552
  DRIZZLE_UPDATE_ROW_START(table_share->db.str, table_share->table_name.str);
1510
1553
  mark_trx_read_write();
 
1554
  error= update_row(old_data, new_data);
 
1555
  DRIZZLE_UPDATE_ROW_DONE(error);
1511
1556
 
1512
 
  if (unlikely(error= update_row(old_data, new_data)))
 
1557
  if (unlikely(error))
1513
1558
  {
1514
1559
    return error;
1515
1560
  }
1524
1569
{
1525
1570
  int error;
1526
1571
 
 
1572
  DRIZZLE_DELETE_ROW_START(table_share->db.str, table_share->table_name.str);
1527
1573
  mark_trx_read_write();
 
1574
  error= delete_row(buf);
 
1575
  DRIZZLE_DELETE_ROW_DONE(error);
1528
1576
 
1529
 
  if (unlikely(error= delete_row(buf)))
 
1577
  if (unlikely(error))
1530
1578
    return error;
1531
1579
 
1532
1580
  if (unlikely(log_row_for_replication(table, buf, NULL)))