~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2010-11-08 08:02:36 UTC
  • mto: (1921.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1916.
  • Revision ID: brian@tangent.org-20101108080236-8gaumfjlec0webqm
Second pass on move code to global lock encapsulation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1232
1232
      If we are not under LOCK TABLES we should have only one table
1233
1233
      open and locked so it makes sense to remove the lock at once.
1234
1234
    */
1235
 
    mysql_unlock_tables(this, lock);
 
1235
    mysql_unlock_tables(lock);
1236
1236
    lock= 0;
1237
1237
  }
1238
1238
 
1325
1325
    */
1326
1326
    some_tables_deleted= false;
1327
1327
 
1328
 
    if ((local_lock= mysql_lock_tables(this, tables, (uint32_t) (tables_ptr - tables),
1329
 
                                 flags, &not_used)))
 
1328
    if ((local_lock= mysql_lock_tables(tables, (uint32_t) (tables_ptr - tables),
 
1329
                                       flags, &not_used)))
1330
1330
    {
1331
1331
      /* unused */
1332
1332
    }
1392
1392
              lock on it. This will also give them a chance to close their
1393
1393
              instances of this table.
1394
1394
            */
1395
 
            mysql_lock_abort(this, ulcktbl);
1396
 
            mysql_lock_remove(this, ulcktbl);
 
1395
            mysql_lock_abort(ulcktbl);
 
1396
            mysql_lock_remove(ulcktbl);
1397
1397
            ulcktbl->lock_count= 0;
1398
1398
          }
1399
1399
          if ((ulcktbl != table) && ulcktbl->db_stat)
1513
1513
    next=table->getNext();
1514
1514
    if (table->getShare()->getCacheKey() == identifier.getKey())
1515
1515
    {
1516
 
      mysql_lock_remove(session, table);
 
1516
      session->mysql_lock_remove(table);
1517
1517
 
1518
1518
      if (!found)
1519
1519
      {
1559
1559
    if (table->getShare()->getCacheKey() == identifier.getKey())
1560
1560
    {
1561
1561
      /* If MERGE child, forward lock handling to parent. */
1562
 
      mysql_lock_abort(session, table);
 
1562
      session->mysql_lock_abort(table);
1563
1563
      break;
1564
1564
    }
1565
1565
  }
1742
1742
 
1743
1743
    assert(lock == 0);  // You must lock everything at once
1744
1744
    if ((table->reginfo.lock_type= lock_type) != TL_UNLOCK)
1745
 
      if (! (lock= mysql_lock_tables(this, &table_list->table, 1, 0, &refresh)))
 
1745
      if (! (lock= mysql_lock_tables(&table_list->table, 1, 0, &refresh)))
1746
1746
        table= 0;
1747
1747
  }
1748
1748
 
1805
1805
      *(ptr++)= table->table;
1806
1806
  }
1807
1807
 
1808
 
  if (!(session->lock= mysql_lock_tables(session, start, (uint32_t) (ptr - start),
1809
 
                                         lock_flag, need_reopen)))
 
1808
  if (!(session->lock= session->mysql_lock_tables(start, (uint32_t) (ptr - start), lock_flag, need_reopen)))
1810
1809
  {
1811
1810
    return -1;
1812
1811
  }