~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2010-05-18 15:49:50 UTC
  • Revision ID: brian@gaz-20100518154950-qhctxu6lvvnyxy9i
Simplify out Open_tables_state() backup/restore (no longer needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
         !strcmp(field_name.str, other.field_name.str);
93
93
}
94
94
 
95
 
Open_tables_state::Open_tables_state(uint64_t version_arg)
96
 
  :version(version_arg), backups_available(false)
 
95
Open_tables_state::Open_tables_state(uint64_t version_arg) :
 
96
  version(version_arg)
97
97
{
98
 
  reset_open_tables_state();
 
98
  open_tables= temporary_tables= derived_tables= NULL;
 
99
  extra_lock= lock= NULL;
99
100
}
100
101
 
101
102
/*
161
162
  return (int) session->variables.tx_isolation;
162
163
}
163
164
 
164
 
Session::Session(plugin::Client *client_arg)
165
 
  :
 
165
Session::Session(plugin::Client *client_arg) :
166
166
  Open_tables_state(refresh_version),
167
167
  mem_root(&main_mem_root),
168
168
  lex(&main_lex),
1543
1543
}
1544
1544
 
1545
1545
 
1546
 
/****************************************************************************
1547
 
  Handling of open and locked tables states.
1548
 
 
1549
 
  This is used when we want to open/lock (and then close) some tables when
1550
 
  we already have a set of tables open and locked. We use these methods for
1551
 
  access to mysql.proc table to find definitions of stored routines.
1552
 
****************************************************************************/
1553
 
 
1554
 
void Session::reset_n_backup_open_tables_state(Open_tables_state *backup)
1555
 
{
1556
 
  backup->set_open_tables_state(this);
1557
 
  reset_open_tables_state();
1558
 
  backups_available= false;
1559
 
}
1560
 
 
1561
 
 
1562
 
void Session::restore_backup_open_tables_state(Open_tables_state *backup)
1563
 
{
1564
 
  /*
1565
 
    Before we will throw away current open tables state we want
1566
 
    to be sure that it was properly cleaned up.
1567
 
  */
1568
 
  assert(open_tables == 0 && temporary_tables == 0 &&
1569
 
              derived_tables == 0 &&
1570
 
              lock == 0);
1571
 
  set_open_tables_state(backup);
1572
 
}
1573
 
 
1574
1546
bool Session::set_db(const std::string &new_db)
1575
1547
{
1576
1548
  /* Do not reallocate memory if current chunk is big enough. */
1877
1849
    does not belong to statement for which we do close_thread_tables()).
1878
1850
    TODO: This should be fixed in later releases.
1879
1851
   */
1880
 
  if (backups_available == false)
1881
1852
  {
1882
1853
    TransactionServices &transaction_services= TransactionServices::singleton();
1883
1854
    main_da.can_overwrite_status= true;