~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Mark Atwood
  • Date: 2011-06-22 20:04:22 UTC
  • mfrom: (2318.6.39 rf)
  • Revision ID: me@mark.atwood.name-20110622200422-609npl456o0e5p32
mergeĀ lp:~olafvdspek/drizzle/refactor13

Show diffs side-by-side

added added

removed removed

Lines of Context:
1625
1625
 
1626
1626
int Session::lock_tables(TableList *tables, uint32_t count, bool *need_reopen)
1627
1627
{
1628
 
  TableList *table;
1629
1628
  Session *session= this;
1630
1629
 
1631
1630
  /*
1638
1637
    return 0;
1639
1638
 
1640
1639
  assert(session->open_tables.lock == 0);       // You must lock everything at once
1641
 
  Table **start,**ptr;
1642
1640
  uint32_t lock_flag= DRIZZLE_LOCK_NOTIFY_IF_NEED_REOPEN;
1643
1641
 
1644
 
  if (!(ptr=start=(Table**) session->getMemRoot()->allocate(sizeof(Table*)*count)))
1645
 
    return -1;
1646
 
 
1647
 
  for (table= tables; table; table= table->next_global)
 
1642
  Table** start;
 
1643
  Table** ptr=start=(Table**) session->mem.alloc(sizeof(Table*)*count);
 
1644
  for (TableList* table= tables; table; table= table->next_global)
1648
1645
  {
1649
1646
    if (!table->placeholder())
1650
1647
      *(ptr++)= table->table;
1651
1648
  }
1652
 
 
1653
1649
  if (not (session->open_tables.lock= session->lockTables(start, (uint32_t) (ptr - start), lock_flag)))
1654
1650
  {
1655
1651
    return -1;
1656
1652
  }
1657
 
 
1658
1653
  return 0;
1659
1654
}
1660
1655