~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/ha_archive.cc

  • Committer: Monty Taylor
  • Author(s): Stewart Smith
  • Date: 2010-11-08 02:27:42 UTC
  • mto: This revision was merged to the branch mainline in revision 1931.
  • Revision ID: stewart@flamingspork.com-20101108022742-dttxey4d30pqj346
fix large stack usage in ARCHIVE:

use auto_ptr for azio_stream

plugin/archive/ha_archive.cc: In member function virtual int ArchiveEngine::doCreateTable(drizzled::Session&, drizzled::Table&, const drizzled::TableIdentifier&, drizzled::message::Table&):
plugin/archive/ha_archive.cc:592: error: the frame size of 82480 bytes is larger than 32768 bytes [-Wframe-larger-than=]

Show diffs side-by-side

added added

removed removed

Lines of Context:
502
502
                                 drizzled::message::Table& proto)
503
503
{
504
504
  int error= 0;
505
 
  azio_stream create_stream;            /* Archive file we are working with */
 
505
  auto_ptr<azio_stream> create_stream(new azio_stream);
506
506
  uint64_t auto_increment_value;
507
507
  string serialized_proto;
508
508
 
529
529
  named_file.append(ARZ);
530
530
 
531
531
  errno= 0;
532
 
  if (azopen(&create_stream, named_file.c_str(), O_CREAT|O_RDWR,
 
532
  if (azopen(create_stream.get(), named_file.c_str(), O_CREAT|O_RDWR,
533
533
             AZ_METHOD_BLOCK) == 0)
534
534
  {
535
535
    error= errno;
548
548
    return(error ? error : -1);
549
549
  }
550
550
 
551
 
  if (azwrite_frm(&create_stream, serialized_proto.c_str(),
 
551
  if (azwrite_frm(create_stream.get(), serialized_proto.c_str(),
552
552
                  serialized_proto.length()))
553
553
  {
554
554
    unlink(named_file.c_str());
560
560
  {
561
561
    int write_length;
562
562
 
563
 
    write_length= azwrite_comment(&create_stream,
 
563
    write_length= azwrite_comment(create_stream.get(),
564
564
                                  proto.options().comment().c_str(),
565
565
                                  proto.options().comment().length());
566
566
 
577
577
    Yes you need to do this, because the starting value
578
578
    for the autoincrement may not be zero.
579
579
  */
580
 
  create_stream.auto_increment= auto_increment_value ?
 
580
  create_stream->auto_increment= auto_increment_value ?
581
581
    auto_increment_value - 1 : 0;
582
582
 
583
 
  if (azclose(&create_stream))
 
583
  if (azclose(create_stream.get()))
584
584
  {
585
585
    error= errno;
586
586
    unlink(named_file.c_str());