~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.h

  • Committer: Brian Aker
  • Date: 2009-11-18 06:11:12 UTC
  • mfrom: (1220.1.10 staging)
  • Revision ID: brian@gaz-20091118061112-tyf4qrfr5v7i946b
Monty + Brian Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
    the Session of that thread); that thread is (and must remain, for now) the
439
439
    only responsible for freeing this member.
440
440
  */
441
 
  char *db;
442
 
  uint32_t db_length; /**< Length of current schema name */
 
441
  std::string db;
443
442
 
444
443
  /**
445
444
    Constant for Session::where initialization in the beginning of every query.
1151
1150
  */
1152
1151
  bool set_db(const char *new_db, size_t new_db_len);
1153
1152
 
1154
 
  /**
1155
 
    Set the current database; use shallow copy of C-string.
1156
 
 
1157
 
    @param new_db     a pointer to the new database name.
1158
 
    @param new_db_len length of the new database name.
1159
 
 
1160
 
    @note This operation just sets {db, db_length}. Switching the current
1161
 
    database usually involves other actions, like switching other database
1162
 
    attributes including security context. In the future, this operation
1163
 
    will be made private and more convenient interface will be provided.
1164
 
  */
1165
 
  void reset_db(char *new_db, size_t new_db_len)
1166
 
  {
1167
 
    db= new_db;
1168
 
    db_length= new_db_len;
1169
 
  }
1170
1153
  /*
1171
1154
    Copy the current database to the argument. Use the current arena to
1172
1155
    allocate memory for a deep copy: current database may be freed after
1460
1443
  /* Work with temporary tables */
1461
1444
  Table *find_temporary_table(TableList *table_list);
1462
1445
  Table *find_temporary_table(const char *db, const char *table_name);
 
1446
 
1463
1447
  void close_temporary_tables();
1464
 
  void close_temporary_table(Table *table, bool free_share, bool delete_table);
1465
 
  void close_temporary(Table *table, bool free_share, bool delete_table);
 
1448
  void close_temporary_table(Table *table);
 
1449
  // The method below just handles the de-allocation of the table. In
 
1450
  // a better memory type world, this would not be needed. 
 
1451
private:
 
1452
  void close_temporary(Table *table);
 
1453
public:
 
1454
 
1466
1455
  int drop_temporary_table(TableList *table_list);
1467
1456
  bool rm_temporary_table(drizzled::plugin::StorageEngine *base, char *path);
1468
1457
  Table *open_temporary_table(const char *path, const char *db,
1469
 
                              const char *table_name, bool link_in_list);
 
1458
                              const char *table_name, bool link_in_list= true);
1470
1459
  
1471
1460
  /* Reopen operations */
1472
1461
  bool reopen_tables(bool get_locks, bool mark_share_as_old);