~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Brian Aker
  • Date: 2010-12-07 18:30:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1983.
  • Revision ID: brian@tangent.org-20101207183053-eg32l3701i5qvkh7
This resolves the issue where one thread may be looking at schema while
another thread could be updating it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
506
506
    the Session of that thread); that thread is (and must remain, for now) the
507
507
    only responsible for freeing this member.
508
508
  */
509
 
  std::string db;
 
509
private:
 
510
  util::string::shared_ptr _schema;
 
511
public:
510
512
 
511
 
  const std::string &getSchema() const
 
513
  util::string::const_shared_ptr schema() const
512
514
  {
513
 
    return db;
 
515
    return _schema;
514
516
  }
515
517
  std::string catalog;
516
518
  /* current cache key */
1370
1372
    database usually involves other actions, like switching other database
1371
1373
    attributes including security context. In the future, this operation
1372
1374
    will be made private and more convenient interface will be provided.
1373
 
 
1374
 
    @return Operation status
1375
 
      @retval false Success
1376
 
      @retval true  Out-of-memory error
1377
1375
  */
1378
 
  bool set_db(const std::string &new_db);
 
1376
  void set_db(const std::string &new_db);
1379
1377
 
1380
1378
  /*
1381
1379
    Copy the current database to the argument. Use the current arena to