~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2011-01-13 07:03:39 UTC
  • mfrom: (2077.1.3 drizzle)
  • Revision ID: brian@gir-3-20110113070339-bnfp4yvngb6frhru
Merge in all of the fixes for definition to instance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
 
52
52
#include "drizzled/identifier.h"
53
53
 
54
 
#include "drizzled/table/instance.h"
 
54
#include "drizzled/table/singular.h"
55
55
 
56
56
#include "plugin/myisam/myisam.h"
57
57
#include "drizzled/internal/iocache.h"
65
65
#include <fcntl.h>
66
66
#include <algorithm>
67
67
#include <climits>
 
68
 
68
69
#include <boost/filesystem.hpp>
 
70
#include <boost/checked_delete.hpp>
69
71
 
70
72
#include "drizzled/util/backtrace.h"
71
73
 
362
364
       iter++)
363
365
  {
364
366
    user_var_entry *entry= (*iter).second;
365
 
    delete entry;
 
367
    boost::checked_delete(entry);
366
368
  }
367
369
  user_vars.clear();
368
370
 
399
401
  if (client)
400
402
  {
401
403
    client->close();
402
 
    delete client;
 
404
    boost::checked_delete(client);
 
405
    client= NULL;
403
406
  }
404
407
 
405
408
  if (cleanup_done == false)
421
424
 
422
425
  for (PropertyMap::iterator iter= life_properties.begin(); iter != life_properties.end(); iter++)
423
426
  {
424
 
    delete (*iter).second;
 
427
    boost::checked_delete((*iter).second);
425
428
  }
426
429
  life_properties.clear();
427
430
}
1608
1611
  /* Fix for Intel compiler */
1609
1612
  if (copy_field)
1610
1613
  {
1611
 
    delete [] copy_field;
 
1614
    boost::checked_array_delete(copy_field);
1612
1615
    save_copy_field= save_copy_field_end= copy_field= copy_field_end= 0;
1613
1616
  }
1614
1617
}
1783
1786
  TableIdentifier identifier(table->getShare()->getSchemaName(), table->getShare()->getTableName(), table->getShare()->getPath());
1784
1787
  rm_temporary_table(table_type, identifier);
1785
1788
 
1786
 
  delete table->getMutableShare();
 
1789
  boost::checked_delete(table->getMutableShare());
1787
1790
 
1788
 
  delete table;
 
1791
  boost::checked_delete(table);
1789
1792
}
1790
1793
 
1791
1794
/** Clear most status variables. */
1829
1832
 
1830
1833
  if (not returnable.second)
1831
1834
  {
1832
 
    delete entry;
 
1835
    boost::checked_delete(entry);
1833
1836
  }
1834
1837
 
1835
1838
  return entry;
2111
2114
  return true;
2112
2115
}
2113
2116
 
2114
 
table::Instance *Session::getInstanceTable()
 
2117
table::Singular *Session::getInstanceTable()
2115
2118
{
2116
 
  temporary_shares.push_back(new table::Instance()); // This will not go into the tableshare cache, so no key is used.
 
2119
  temporary_shares.push_back(new table::Singular()); // This will not go into the tableshare cache, so no key is used.
2117
2120
 
2118
 
  table::Instance *tmp_share= temporary_shares.back();
 
2121
  table::Singular *tmp_share= temporary_shares.back();
2119
2122
 
2120
2123
  assert(tmp_share);
2121
2124
 
2141
2144
  @return
2142
2145
    0 if out of memory, Table object in case of success
2143
2146
*/
2144
 
table::Instance *Session::getInstanceTable(List<CreateField> &field_list)
 
2147
table::Singular *Session::getInstanceTable(List<CreateField> &field_list)
2145
2148
{
2146
 
  temporary_shares.push_back(new table::Instance(this, field_list)); // This will not go into the tableshare cache, so no key is used.
 
2149
  temporary_shares.push_back(new table::Singular(this, field_list)); // This will not go into the tableshare cache, so no key is used.
2147
2150
 
2148
 
  table::Instance *tmp_share= temporary_shares.back();
 
2151
  table::Singular *tmp_share= temporary_shares.back();
2149
2152
 
2150
2153
  assert(tmp_share);
2151
2154