~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2010-03-31 05:53:34 UTC
  • Revision ID: brian@gaz-20100331055334-yqqmzlgqb2xq1p5b
Mass overhaul to use schema_identifier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
687
687
  /* Change database if necessary */
688
688
  if (in_db && in_db[0])
689
689
  {
690
 
    if (mysql_change_db(this, in_db))
 
690
    SchemaIdentifier identifier(in_db);
 
691
    if (mysql_change_db(this, identifier))
691
692
    {
692
693
      /* mysql_change_db() has pushed the error message. */
693
694
      return false;
1623
1624
  set_open_tables_state(backup);
1624
1625
}
1625
1626
 
1626
 
bool Session::set_db(const char *new_db, size_t length)
 
1627
bool Session::set_db(const std::string &new_db)
1627
1628
{
1628
1629
  /* Do not reallocate memory if current chunk is big enough. */
1629
 
  if (length)
 
1630
  if (new_db.length())
1630
1631
    db= new_db;
1631
1632
  else
1632
1633
    db.clear();
2007
2008
    if (open_tables_from_list(&tables, &counter))
2008
2009
      return true;
2009
2010
 
2010
 
    if (!lock_tables(tables, counter, &need_reopen))
 
2011
    if (not lock_tables(tables, counter, &need_reopen))
2011
2012
      break;
2012
 
    if (!need_reopen)
 
2013
    if (not need_reopen)
2013
2014
      return true;
2014
2015
    close_tables_for_reopen(&tables);
2015
2016
  }